Hacker News new | ask | show | jobs
by kabdib 5287 days ago
C++ could have been so much . . . less.

Any language that takes the better part of a year to develop an adequate parser for is NOT to be trusted.

I had a long rant on RTTI, templates, the positively miserable experience around exceptions, and so on. But you've heard it before.

C++ should have /started/ with a string class and a set of collection classes, rather than having them be bolted on a decade later. This would have driven the language in much more useful directions.

I don't know if it's possible to remove features, but I've seen three groups independently come up with essentially the same C++ coding guidelines (the Google C++ guidelines are a great example), all deprecating large swaths of the language because they are dangerous, fragile or make bugs.

My experience with OS-level development is that you get a better code with vanilla C.

1 comments

Every person uses a different subset of C++, but that subset varies from a group to the other. You cannot therefore "remove features from C++".

A lot of people use C++ to code as they would in Java or C#, generally their experience is terrible. Exceptions don't work the way you think they do (in C++ exceptions should be exceptional). Polymorphism is more verbose, it's not introspective, etc. There's much to say about it.

I've found you enjoy the language much more when you go generic/functional full speed. You also understand why some arcane features of the languages are there (such as the .* operator).

"""Every person uses a different subset of C++, but that subset varies from a group to the other. You cannot therefore "remove features of C++""""

Actually you can. You don't remove them from the existing language that is, you make a better language with bs/redundant removed.

While "every person uses a different subset of C++" is true, it's not like everything someone uses is equally beneficial to have in a language. As the parent said, what is useful and what is not is not that controversial:

"I've seen three groups independently come up with essentially the same C++ coding guidelines (the Google C++ guidelines are a great example), all deprecating large swaths of the language"

Perhaps I would understand better what you're trying to say if you were to give me an example of a controversial feature.
Multiple inheritance.

Operator overloading.

Doing non-atomic work in constructors (allocating memory, doing file I/O, etc.).

RTTI

Template metaprogramming

... and more