Hacker News new | ask | show | jobs
by googh 800 days ago
The thing is, these problems rarely arise for programmers who daily code in C++. People who don't use C++ love to enumerate different C++ gotchas. In reality, most C++ projects define a coding style that dodges most of these problems. For instance, I don't use default arguments at all.

That said, I don't start new projects in C++ mainly because of the header/source split. After writing a lot of code in languages that don't require a header file, I believe that C/C++ not making headers files redundant in 90s itself has been a costly mistake. Think of the time wasted because of constantly having to sync header/source files. One can argue that it does not take much time but it is hard to estimate how many bugs might be introduced because of such busywork breaking mental flow.

Oddly, real problems like these are never brought in these "C++ sucks" discussions.

1 comments

Oh yeah, the header thing drives me insane as well. People put up with the stupidest shit. I try to structure my code to only ever include actual .c files, so that there's no need for .h files. (Learned to do this writing "raw" php in the past... I guess I put up with that because it was my income). Doesn't scale past a certain point sadly.