Live data from Hacker News

Nobody Understands C++: Intro (2007)

articles.emptycrate.com

1–10 of 53 posts

Re: Nobody Understands C++: Intro (2007)

#2
> The comment in question begins “My take on C++ is that the best programs only use a fraction of the features.” The commenter further states that he is weary of operator overloading and templates.

> In my experience, people who make comments like the above tend to be people who think they are C++ experts but who are actually only novices. I do not know the commenter personally, so I’m not trying to say anything about him specifically.

> I only have 4 years of experience with C++

... I am only a C expert, but I agree with the Slashdot guy. After spending years as a believer like the author, I realized all this class-ification effort was pure waste, since most of it would never be reused. Same with all the idiomatic conversions. Don't get me started on boost.

I withdrew from the cult and get just as much done with high quality C in half the time.

Re: Nobody Understands C++: Intro (2007)

#6

TBH, C++ has changed so much that any opinion from 2007 isn't worth much today, and that applies no matter if you think C++ got better or worse since then ;)

Furthermore the boost features used in the "better" example are now standard parts of the language and niether example looks good relative to "modern" C++17. (Though new problems have been introduced too, e.g. overuse of `auto`.)

Re: Nobody Understands C++: Intro (2007)

#8
Oh, this is Jason Turner! I'm sure he'd no longer write that kind of code, given its pre-C++11.

Not really intellectually interesting anymore IMO.

People say "I know some C++" and that could mean they have 2 decades, or 2 days, experience.

In reality, this is not a C++ problem, this is a software engineering problem. You need to learn to choose a solution that is good, not a solution that sounds good, or that will impress management.

If you need OOP, use it, otherwise, stay very far away. Same with callbacks and other funny constructs. You need them? Use them. You use them because they sound cool? It may be that you just want to call two functions after one another -- you dont need a callback to the first for that.

Re: Nobody Understands C++: Intro (2007)

#9

> The comment in question begins “My take on C++ is that the best programs only use a fraction of the features.” The commenter further states that he is weary of operator overloading and templates. > In my experience, people who make comments like the above tend to be people who think they are C++ experts but who are actually only novices. I do not know the commenter personally, so I’m not trying to say anything abou…

I believe the same is applicable in other languages. Complicated types and class structures quickly become unwieldly, it's much better to use simple types and not rely on polymorphism too much.

Re: Nobody Understands C++: Intro (2007)

#10
It is not that I necessarily disagree with the author but it does seem like he is making it a bit too easy for himself to make his point. Ever since C++ got lambdas, I would say that bind should be considered deprecated. It is more difficult to understand AND cannot possibly be more efficient.

The general point stands though. If you try to make everything as general as you can, you are going to make it more difficult for yourself than necessary. Beware of generalizing from one or fewer examples.

Post reply on HN