Hacker News new | ask | show | jobs
by rayiner 4689 days ago
C++'s complexity does not arise from its power. With the exception of templates, C is just as powerful but far more orthogonal and simple.

E.g. the difference between references and pointers. E.g. the phenomenally baroque template syntax. E.g. phenomenally complex rules for multiple inheritance. Slicing problem. Syntax so hard to parse only a couple do it right. Lots of features that just don't carry their weight (operator overloading).

1 comments

> Lots of features that just don't carry their weight (operator overloading).

Operator overloading is crucial for things like graphics and bignums—basically, heavy math operations over anything that isn't a primitive.

Its a trick pony. I don't think that use is enough to carry its weight. Also, abusing it immediately in the streams library just encouraged people to find elaborate nonsensical uses for it.
Operator overloading is very useful in the context of generic code though (through templates).

I've programmed C++ for probably more than a decade now and I've been bitten by many of its features at some point, but operator overloading would rank right near the bottom of my burn list.

It can be abused, that's for sure, but so can many C features.