Clumsy pointers, or why most C coders don't get OO(susam.in)
susam.in
Clumsy pointers, or why most C coders don't get OO
http://susam.in/blog/clumsy-pointers/
2 comments
Why did you retitle this with "... or why most C coders don't get OO"? I don't see the connection.
The submitter also retitled "The Rise and Fall of Bitcoin" to "The rise and... rise of Bitcoin". He seems to like pushing some agenda. http://news.ycombinator.com/item?id=3275203
Because the (ab-)use of void* instead of struct typedef pointers mean they do not understand C is OO and typesafe.
tl;dr: void* is a code smell.
tl;dr: void* is a code smell.
There are no void pointers in that example. At all.
All of it builds off of `void( * )(int * )`, which is a pointer to a function taking a pointer to `int` and returning `void`.
All of it builds off of `void( * )(int * )`, which is a pointer to a function taking a pointer to `int` and returning `void`.
Without void * there would be no malloc(), calloc(), free(), qsort(), etc.
More importantly, there is no void * in the article.
Even more importantly, it's a "silly puzzle" as already mentioned in the article. How do you conclude from that C programmers who love such puzzles don't understand OO? That's a very unscientific thing to say.
More importantly, there is no void * in the article.
Even more importantly, it's a "silly puzzle" as already mentioned in the article. How do you conclude from that C programmers who love such puzzles don't understand OO? That's a very unscientific thing to say.
malloc/calloc and free are the only legitimate outliers in my opinion.
What I was getting at is that most C programmers simply do not understand programming at all and write utter trash. A lot of the stuff I've seen is failing to use type safety in C.
What I was getting at is that most C programmers simply do not understand programming at all and write utter trash. A lot of the stuff I've seen is failing to use type safety in C.
Void pointers do have a purpose. Regardless, it's only about type safety, not being object-oriented, since C isn't.
[deleted]
Look, C is a PROCEDURAL language. But -- (and its a BIG but) without it, you wouldn't (easily) have OO languages.