My advice on implementing stuff in C:
My advice on implementing stuff in C:
Posted Oct 15, 2010 14:00 UTC (Fri) by mjthayer (guest, #39183)In reply to: My advice on implementing stuff in C: by HelloWorld
Parent article: Russell: On C Library Implementation
Perhaps it is just me, but C++ always seems to me like a poisoned chalice. It has lots of useful and powerful features, but they all seem to come with lots of fine print, so that by the time you have made them work the way you want, and debugged all the hidden edge cases, you need more time than you would have needed with C. Like -
C++ classes with their automatic destruction when they get out of range (if they are on the stack, which one quickly gets into the habit of overusing) - very useful, but you also have to get your head around exceptions and copy constructors which are firmly embedded in them.
Templates are also very powerful but have a tendency to start taking over all your programming time before you get them right.
Exceptions themselves would also be great, except that they are also horribly hard to do right, witness the number of long papers telling you that "exceptions are easy, just follow this methodology to use them".
Or typecast operators which are very hard to predict, especially as a compiler may decide to cast an object to an intermediary form (without telling you which) before casting it to its final incarnation.
Anyone feel like adding to the list?
