Linked by MOS6510 on Thu 10th Jan 2013 23:25 UTC
General Development "For years I've tried my damnedest to get away from C. Too simple, too many details to manage, too old and crufty, too low level. I've had intense and torrid love affairs with Java, C++, and Erlang. I've built things I'm proud of with all of them, and yet each has broken my heart. They've made promises they couldn't keep, created cultures that focus on the wrong things, and made devastating tradeoffs that eventually make you suffer painfully. And I keep crawling back to C."
Thread beginning with comment 548360
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: true, but some libraries...
by kwan_e on Fri 11th Jan 2013 11:51 UTC in reply to "RE: true, but some libraries..."
kwan_e
Member since:
2007-02-18

One thing that's always confused me is the odd separation between the STL and language features. For example, why are Iterators an STL class rather than being a language construct, along with some syntactic sugar like a foreach statement?


One of the biggest reasons why C++ is the complicated language it is is due to the design principle they used that most of the heavy lifting be done in libraries.

The STL and TR/Boost libraries serve as a demonstration of C++ language features.

There's also the other principle of "you don't pay for what you don't use". Having library features as part of the language features could result in unwanted features being pulled into low level code. Having a separate library is a very strong signal that the inclusion of heavy weight stuff is intentional when it's in code.

Reply Parent Score: 4

Vanders Member since:
2005-07-06

One of the biggest reasons why C++ is the complicated language it is is due to the design principle they used that most of the heavy lifting be done in libraries.


That explains my question regarding Iterators, but I still find the split rather odd and slightly arbitrary.

Of course my complaint is technically invalid since C++11 added syntactic sugar for foreach loops, so at least the syntax isn't as ugly now.

Reply Parent Score: 3

Carewolf Member since:
2005-09-08

It is because C++ is a library programing language. If you don't need a specialized library, you probably shouldn't be using C++. This is also the reason STL doesn't matter, if you need STL you are using C++ wrong.

Reply Parent Score: 2

tylerdurden Member since:
2009-03-17

So the main reason for using C++ are libraries, except when you use them, in which case you're using C++ wrong... ;-)

Edited 2013-01-12 21:07 UTC

Reply Parent Score: 2

kwan_e Member since:
2007-02-18

This is also the reason STL doesn't matter, if you need STL you are using C++ wrong.


Needing containers (and now threads, with C++11) is wrong?

Reply Parent Score: 2