My advice on implementing stuff in C:
My advice on implementing stuff in C:
Posted Oct 17, 2010 19:14 UTC (Sun) by wahern (subscriber, #37304)In reply to: My advice on implementing stuff in C: by jzbiciak
Parent article: Russell: On C Library Implementation
While the different kinds of casts are nice in C++, casting is frowned upon in both C and C++. Bjarne says that he purposefully made casting in C++ ugly to dissuade people from casting, and that part of the design criteria of C++ was to reduce the need to cast. And yet in actual code I see casting as far more prevalent in C++ than in C, maybe because people see the feature and feel it was put there to use freely; I dunno. Much complexity was added to replace the loss of implicit void pointer conversions, and I'm not sure there was any net gain. In any event, it's a PITA at the boundary of C and C++
