From Mark Weiman's Wiki
Jump to navigation Jump to search


C++ is not a good language. There I said it. It's a language that has the solid foundations of C, but really doesn't add anything that is worth using.


Operator Overloading Is Abused

I started out looking at C++ from the perspective of a Python or C programmer's point of view. So, naturally, I would have liked to see this feature used for good.

It makes complete sense that in a language like Python, you can concatenate strings together with a simple + operation.

str_val = "a" + "b"

I also like this ability to modify + in C++ to add some similar functionality.

string str_val = "a" + "b";

This is good. I usually am not a fan of making things inconsistent with themselves, but this is a good thing for readability. Where I take issue with this is in the following horrible and nauseating statement:


What is this? How are you shifting std::cout "Hello World!" number of times?!? This is ridiculous and its EVERYWHERE in the C++ Standard Library. What's wrong with printf? What's wrong with puts? What's wrong with sprintf? AND YES, you guessed it, even trying to form strings requires this horrible mess. There's no real benefit and it's just annoying to look at.

Remember, printf works fine. Why did it need replacing?

printf("Seriously man, this works fine.\n");

Even if you want to use printf, you cannot really do it as it uses a different buffer than std::cout which makes using libraries unfeasible.