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 548289
To read all comments associated with this story, please click here.
spot on
by bram on Fri 11th Jan 2013 00:40 UTC
bram
Member since:
2009-04-03

The author is spot on.
It is a well written article.

C++ does not force you to go OO, but it encourages it.
In large systems, OO will hurt you.

The older I get, the more I like C, and detest C++.
Read Scott Meyers on how you can get yourself in trouble with C++. There are hundreds of different pitfalls waiting to trap you.

Reply Score: 2

RE: spot on
by tylerdurden on Fri 11th Jan 2013 01:00 in reply to "spot on"
tylerdurden Member since:
2009-03-17

In my experience it is the opposite; C++ deters people from proper object orientation. IMO, C++ is such a syntactical kludge that plenty of programmers I have worked with revert to procedural thinking inadvertently when coding in it.

I don't think the object orientation is what makes large C++ projects hard to maintain.

Reply Parent Score: 5

RE[2]: spot on
by kwan_e on Fri 11th Jan 2013 01:10 in reply to "RE: spot on"
kwan_e Member since:
2007-02-18

IMO, C++ is such a syntactical kludge that plenty of programmers I have worked with revert to procedural thinking inadvertently when coding in it.


Despite my C++ apologetics, I have to agree with the part about reverting to procedural thinking. However, this kind of thing is implied in Bjarne Stroustrup's book.

Some things are just not suited to an OO style. I find OO best suited for defining ADTs. Frameworks should be a mixture of procedures and ADTs, not large object systems.

Reply Parent Score: 2

RE[2]: spot on
by phoudoin on Fri 11th Jan 2013 13:03 in reply to "RE: spot on"
phoudoin Member since:
2006-06-09

I don't think the object orientation is what makes large C++ projects hard to maintain.


Nope.
It's simply their size.

Reply Parent Score: 5

RE: spot on
by dorin.lazar on Fri 11th Jan 2013 01:30 in reply to "spot on"
dorin.lazar Member since:
2006-12-15

C++ does not force you to go OO, but it encourages it.

And this is a good thing ;)
In large systems, OO will hurt you.

Uhm. I dare to disagree. Depends on what you call 'large system'. It may be the feeling that OO causes bloat because it's easy to get bloaty when you're using OOP. But that doesn't mean that it will happen.
At the core of OOP we have the association of data and the methods that work with that data, through encapsulation. I see nothing wrong with that. It does help you to be more productive, it makes more sense for larger systems to go OOP. OOP systems are simply easier to handle and to extend.

Reply Parent Score: 4

RE[2]: spot on
by bram on Fri 11th Jan 2013 05:13 in reply to "RE: spot on"
bram Member since:
2009-04-03

I have found Noel Llopis' Data-oriented design paper to be an eye opener. http://gamesfromwithin.com/data-oriented-design

With OO, it is easy to end up with a menagerie of objects all referring to each other with deep complexities. With data oriented design you tend to end up with flatter architectures and fewer dependencies.

I'm a game programmer, and I like his advice on how you could code most of your game engine subsystems as you would code your particle system.

With C, I feel more easily guided to data oriented, structures-of-arrays, instead of the OO and arrays of structures/objects.

Reply Parent Score: 4