News for hackers. Stuff that matters.
Re:The Dark Side of C++ [pdf] by NewSoftzzz on Monday August 02, 2010 @11:00AM (#1567792)
Most of the problems mentioned there don't apply to the regular C++ coder in his daily life, many of the mentioned problems are even non-existant if you stick to the encouraged coding styles of modern and real OOP C++.

In practice just the template error messages suck as hell. I'd really like something nicer there, but in practice you actually survive those messages without too much wasting of time. You just ignore the error message and rather look at the line of code mentioned and then you usually find the problem rather fast by just looking at the line.

rgds, René

Re:The Dark Side of C++ [pdf] by colinb on Monday August 02, 2010 @11:26AM (#1567868)
"encouraged coding styles of modern and real OOP C++"

Where do I go to learn those given that I work in an all C shop? One of the problems of learning C++ is the sheer profusion of material that's available, much of it written when the technology looked a lot shinier than it does now. Would you care to recommend some books or articles on C++ style that have stood the test of more than one fashion-epoch?

I'm especially worried about the [to my eyes] rather large number of keywords in C++ and the many exciting ways in which they can interact. I think this is where advice about useful patterns [sorry] might be most useful.

thanks

c

Re:The Dark Side of C++ [pdf] by jerf on Monday August 02, 2010 @01:37PM (#1568325)
Are you talking about learning OO to apply in C? Learning modern C++ OO won't help much. A little, but not much. A quick google on "object oriented c" produced a boatload of good-looking sources.

Remember, object orientation is an attribute of a program, not a programming language. A given language may encourage or even force a certain paradigm, but it's still a property of the resulting program. An "object oriented" language is simply a language in which it is difficult or impossible to produce a program that does not have that property. Object-oriented programming in C is perfectly possible, and often quite desirable. It isn't quite as slick but it's not terribly hard.

(That said, NewSoftzzz's suggestion of the C++ FAQ Lite is still a good one. I think it's just plain required reading, personally. Even if you don't program in C++, it will step you through a lot of scenarios in one very popular OO paradigm and simply by understanding one paradigm perfectly, it is easier to understand and use the next. If this seems contradictory to my first paragraph, blame English. This is theoretically helpful, learning C++ won't practically help you much in C.)

Re:The Dark Side of C++ [pdf] by colinb on Monday August 02, 2010 @04:52PM (#1569032)
No. I've spent far more of my working life puzzling through OO in C to want to inflict it on others. But I've also become a fair to middling C programmer, and the strength I bring to that task has a much to do with knowing how to build large systems in a comprehensible way from the elements the language exposes, as it does to a basic knowledge of those elements. I.e. knowing how to code a case statement isn't the same as building a 50x400 state machine that's efficient, robust and debuggable.

I suspect the same is true of the skills and knowledge held by an experienced C++ hacker.

So I suspect that the C++ FAQ, and the Sutter book are just the ticket.

thanks

c

Re:The Dark Side of C++ [pdf] by NewSoftzzz on Monday August 02, 2010 @12:25PM (#1568058)
I really do recommend the C++ FAQ book. There is a lite version online: http://www.parashift.com/c++-faq-lite/

Since I've read both the lite online version and the book I strongly encourage you to obtain the book version!

rgds, René

Re:The Dark Side of C++ [pdf] by nuxi on Monday August 02, 2010 @01:31PM (#1568295)
In addition I'd recommend the C++ FQA lite (http://yosefk.com/c++fqa/) which dissects the FAQ and provides additional, a lot of times quite useful, information.
Re:The Dark Side of C++ [pdf] by NewSoftzzz on Monday August 02, 2010 @01:37PM (#1568326)
The C++ FQA is quite the same stuff as the .pdf linked in this topic. So the same stuff about mostly not being practically relevant applies here.

rgds, René

Re:The Dark Side of C++ [pdf] by alexk7 on Monday August 02, 2010 @11:41AM (#1567919)
The book "C++ Coding Standards" by Herb Sutter and Andrei Alexandrescu is an excellent way to get up to date with modern yet pragmatic C++ style.

I also recommend the "Effective C++" series by Scott Meyers and the "Exceptional C++" series by Herb Sutter.

Re:The Dark Side of C++ [pdf] by elmindreda on Monday August 02, 2010 @06:55PM (#1569420)
There's no substitute for reading good C++ code, especially larger projects that still manage to be usable, maintainable and somewhat consistent.

For example, the code of LLVM, Ogre, Box2D, bullet and the Second Life viewer, even though they're not always perfect, have all taught me useful things and all look far better than any of the large commercial C++ code bases I cut my teeth on.

Re:The Dark Side of C++ [pdf] by shin_lao on Monday August 02, 2010 @11:13AM (#1567838)
It's a compiler problem and clang is an attempt at solving it.