3 ms·
This quote from Kernighan should be at the top of any C++ guideline: "Everyone knows that debugging is twice as hard as writing a program in the first place. S
by DrBazza 9y ago
This quote from Kernighan should be at the top of any C++ guideline: "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?"
Writing supposedly smart code seems to be a weird culture thing in C++.
I've lost count of the number of C++ devs I've worked with that get the "Mmmm, donuts!" reaction to templates, and leave a stinking pile for everyone else to debug. I'm sure I'm included in that group of programmers, but I hope, not as much.
- lucozade 9y ago> how will you ever debug it? > leave a stinking pile for everyone else to debug I think you answered your own question. The trick is to leave the debugging to someone twice as clever as you. Job done.
- otabdeveloper2 9y agoYou've obviously never written any C++. The point of templates is precisely the fact that they make debugging easier, by replacing runtime assertions and bugs with cryptic compile-time error messages. Figuring out a compiler error is significantly easier than having to debug a malfunctioning test.
- syrrim 9y agoIs it? At runtime, I can cover my code with couts, and run a debugger. At compile time this is much harder.
- jnordwick 9y agoYou've obviously never tried to debug template heavy code. They are like ugly black boxes - you get an answer (maybe correct maybe not) or you get pages of incomprehensible often useless error messages. If c++ wanted a meta language, they really should have created one long ago instead of continuing this template madness.