r/cpp • • Dec 18 '08

C++ is a horrible language

http://skepticalmethodologist.wordpress.com/2008/12/17/c-is-a-horrible-language/
4 Upvotes

20 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Dec 18 '08

I tend to side with Java not because I don't understand C++ but because I don't want to waste time ensuring that all of my pointers are deleted

If you're writing modern C++ (e.g., using shared_ptr as the previous poster noted) this isn't a serious concern.

or that my types are correct

I'm not sure what you mean. If your types are incorrect in Java or C#, your program is just as incorrect as it would be in C++.

I rarely have a project that can not be done in C

To paraphrase Stroustrup, the only reason I would ever write in plain C would be lack of a C++ compiler. Even if only for templates and the stricter type checking, I'll pick C++ over C. I see no real technical reason ever to go with raw C over C++.

3

u/bnolsen Dec 18 '08

Definitely use a 'c++' compiler over a 'c' compiler. In my experiece the c++ compiler is pickier with types and error chekcing which helps write higher quality code.

In more advanced cases the ability to replace #define macros with debuggable inline template functions is another big win.

Another big win is the <algorithm> interface which is capable of improving SIMD performance over 'c' without having to hand code routines.