2 ms·
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.
by DiabloD3 15y ago
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.
- deleted 15y ago[deleted]
- kstenerud 15y agoWhere in that entire article is type void* even being used?
- lubutu 15y agoVoid pointers do have a purpose. Regardless, it's only about type safety, not being object-oriented, since C isn't.
- greyfade 15y agoThere 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`.
- iptoc 15y agoWithout 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.
- DiabloD3 15y agomalloc/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.