As described, I chose C++ as the language for my projects. It just seemed the right thing to do with its omnipresence in the programming world.
But I must admit that after 20.000 lines of code written in the darn thing (recently alone), I'm having increasing doubts about it. It just takes too much time to get anything done in it. And befory any of the C++ zealots come flaming me, please google your flames before posting, you will get enough counter-arguments.
This language is simply broken!!! And this was an understatement of the year! I have no idea what its proprietors are thinking when they go to the drawing board. But I'm very sure of one thing - it definitely isn't clarity and ease of programming. I've just been reading the proposed changes for C++0x standard (for the n-th time) and came back just as dissapointed as I am using this crap of a language.
I've been thinking long about how to list some of the things that bother me and decided on a plain old list in the end. There just isn't a prettier form for doing this, I think:
- The entire language is based on one of the oldest non assembler languages. In this case old implies unevolved, archaic and most definitely not modern. Note the triple use of what is essentially the same word.
- Even the basic types are completely messed up in this language. A programmer never knows exactly what he's going to get when he declares a simple integer (int). "Platform dependent" they say... Well, platform dependent my ass. I have yet to see an algorithm that scales from 8-bit to 64-bit CPU with the same int declaration. How idiotic. Not to mention that one of the most important (close to metal) integer types (byte or 8-bit integer) is named char. And to top it all off, it's even signed!!! How lame can this get?
- But these two are just the just the tip of the iceberg. The real fun begins when you pop the hood:
- There are two ways of using pointers - pointers and references. Well, references are a pathetic attempt at garbage collection. I guess. At least I have no idea what else they would be since the compiler seems to know better than me when to destroy an instance and when not. In the end you're just as forced to use pointers in C++ as you were in C since references are only useful for basic types. Either that or you have copy constructors all over the place. How can such a performance crap piece even be in the language?
- Here we have a language with templates, multiple inheritance and whatnot, but this same language has next to no run-time type information support
- We have a language with operator overloading, but for some reason class properties are evil and not to be supported even if hell freezes over.
- Compiler compiles your code in its entirety every time. Because the files your code is broken into are just good programmimg practice and there for your easier coding. To the compiler it's just a heap of code in one block.
- There is no difference between a .h and a .c / .cpp file. Whatsoever! None! Not even if you wish for it! This one actually took me years to finally understand. Especially because Pascal was my primary language and there the distinction between interface and implementation was a matter of language syntax.
- Stemming from the previous point is another language beauty: you can write fully functional implementation in the declaration section. Sure, it's meant only for inlining only the most inlinable methods, but since it doesn't matter to the compiler, why should you - the programmer - care?
- Despite its idiotic nature and completely useless existence, the preprocessor is still capable of processing one line only and is not recursive.
- In the end one of the things that disappointed me the most was my fellow programmers' mentality. Whenever I would ask how to get rid of some 4 bytes of memory usage in a class instance, all I got was: are you working on a 20year old 8-bit chip? No wonder a graphics driver control panel applet nowadays gobbles a couple hundred MB od RAM... When minimized, of course...
I believe C++ is broken as a language and will remain broken because of two things only:
- It is based on an archaic language and carries on its legacy despite the fact that they are very different languages and that the compilers actually have two separate code paths to be able to compile either
- The language is expanded and extended with the above in mind by people who know only C / C++ and are told of other languages' progress. The latest already late standard extension just proves this: it solves none of the existing shortcomings and introduces quite a few new ones. Sure it adds some nice things into the language, but the syntax for them is even more messed up than it already was.
Ahhhhhh, what the heck:
I vote for end of further mutilation of C++ language. I propose to accept for C++ 0X standard the specification of D 2.0. Then go from there and make it better.