3 ms·
When I was in highschool we had this debugging macro: #define dbg(...) fprintf(stderr, __VA_ARGS__) So the dbg function is just a shortcut to "printf to s
by imslavko 13y ago
When I was in highschool we had this debugging macro:
#define dbg(...) fprintf(stderr, __VA_ARGS__)
So the dbg function is just a shortcut to "printf to stderr".
It also was easy to disable with #ifdef.
- oscargrouch 13y agoDid you learn this in high school? Im curious because kids starting to get by using C is such a nice thing.. cause its a very thin layer for how machines works.. Alienation from the machine inner working(if learning by JS or Python for instance) is such a bad thing, and can take years to the grown up to recover from it :) Im not against learning the "relaxed" languages, but its better when you do not start with them.. when you only learn them as more tools to do all sort of jobs we have to face I was lucky to be a teenager at the nineties when programming were more sane and would make us learn how the real machine works.. (before the java madness) Programmers cannot be lazy, they need to know everything in deep detail, to make the best decisions.. Lazy programmers, very weak programs.. The kids from where you grow up, should be very good when they are adults and decide to work with technology ?! :)
- imslavko 13y agoWe did Topcoder in school, so C was the best option (java wasn't available on local competitions)