Archive for June, 2009

Why I don’t like C++


I love C and Java, but I don’t like C++. C++ gives you lots of new stuff on top of C, but programming language isn’t supermarket, the more the better. Programming language shouldn’t go ad-hoc or evolution. It should go intelligent design.

C++ gives classes, inheritances, information encapsulation … lots of nice OO stuff. But on the other hand, it allows pointer manipulation. WTF! It’s like establishing a comprehensive, wonderful law, but the last rule says “You can break all the previous rules.”

C allows passing parameters by value or pointer. C++ introduces pass-by-reference which is semantically the same as pass-by-pointer but syntactically different. Being able to do the same thing in a thousand ways is not a plus for programing languages, I’d vote it to be a minus.

The only feature of C++ I like is variable declaration between statements, especially “for (int i=0 …”.