News for hackers. Stuff that matters.
Re:Pointers Are More Abstract Than You Might Expect in C by reza_n on Monday July 02, 2018 @11:30AM (#17442491)
> C aficionados often claim they love C because it's "simple"(it isn't) That's what they mean, they love C because you can't really do OO with it

I do not think C programmers are anti OO. Infact, a lot of C patterns are modeled on OO (struct + function). I think the appeal of C is that you are able to write the fastest implementation any given algorithm, something that just isn't possible in most other languages.

Re:Pointers Are More Abstract Than You Might Expect in C by Matthias247 on Tuesday July 03, 2018 @12:47AM (#17447605)
> I think the appeal of C is that you are able to write the fastest implementation any given algorithm, something that just isn't possible in most other languages.

Maybe you can, but lots of the C code I've seen in the last years was pretty inefficient compared to what one would have gotten from a reasonable C++ or Rust implementation:

Examples are inefficient strlen() operations due to the default "string" type, unnecessary copies and allocations of things like strings due to ambiguous ownership, unnecessary null checks to quiet down static analyzers in the absence of non-null references, and extra indirections or allocations in order to work-around missing compile-time generics (besides macros), etc.

Re:Pointers Are More Abstract Than You Might Expect in C by pjmlp on Monday July 02, 2018 @01:39PM (#17443750)
> I think the appeal of C is that you are able to write the fastest implementation any given algorithm, something that just isn't possible in most other languages.

If you told this out loud during the 80's and early 90's everyone would just laugh.

Re:Pointers Are More Abstract Than You Might Expect in C by reza_n on Monday July 02, 2018 @02:04PM (#17443999)
True, and I meant this in the context where you could embed assembly into your functions if needed.
Re:Pointers Are More Abstract Than You Might Expect in C by Rusky on Monday July 02, 2018 @12:22PM (#17442982)
That's not a very satisfying answer, as it doesn't apply to the languages typically compared with C- C++, Rust, or even D, Nim, Zig, etc.
Re:Pointers Are More Abstract Than You Might Expect in C by clarry on Monday July 02, 2018 @01:13PM (#17443491)
I don't think struct + function is any more OO than tuple + lambda is. That's a very shallow definition of OO.
Re:Pointers Are More Abstract Than You Might Expect in C by saagarjha on Monday July 02, 2018 @01:43PM (#17443784)
Well, that's how C++ does everything…