Live data from Hacker News

Nobody Understands C++: Intro (2007)

articles.emptycrate.com

21–30 of 53 posts

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

#21
post #16

> 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 realized all this class-ification effort was pure waste, since most of it would never be reused. I don't think this is a valid take. Classes are not about reuse at all. They are about encapsulation and specifying types/providing interfaces. > Same with all the idiomatic conversions. What's your complain about idiomatic conversions? > Don't get me started on boost. Why is Boost, or any library at all, relevant in…

> Why is Boost, or any library at all, relevant in a discussion about C++?

I don't have a dog in this fight, but I've been following the scene since early 2000s, a lot of boost made it into the standard. FYI.

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

#22
post #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…

i don't think that std::bind is that difficult to understand - here's some stuff about it i wrote earlier: https://latedev.wordpress.com/2012/08/06/using-stdbind-for-f...

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

#23
post #16

> 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 realized all this class-ification effort was pure waste, since most of it would never be reused. I don't think this is a valid take. Classes are not about reuse at all. They are about encapsulation and specifying types/providing interfaces. > Same with all the idiomatic conversions. What's your complain about idiomatic conversions? > Don't get me started on boost. Why is Boost, or any library at all, relevant in…

> Why is Boost, or any library at all, relevant in a discussion about C++?

It’s what the article uses to make its point. Did you read it?

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

#24

Earlier quoted context omitted.

I went from "c++ fondness" to "c++ distaste" over the years. The newest c++ standards fix a lot of issues, but at the same time increase complexity. The backwards-compatibility nature is the classic double-edged sword. If we could avoid it, c++ would be at least significantly nicer (not really less complex). That being said, a good team using a dab of c++ will beat "high quality C" any time of the year for me. Gettin…

> It has a huge cognitive load This. Its like trying to keep three distinct languages (C, old C++, new C++) in one's head at the same time. It is much better use of one's mental energy to spend that effort on three actually distinct languages that are, e.g., tuned to different domains and use cases. Imho the C++ community needs to address this or eventually become irrelevant as people gravitate to more sane and user-…

> or eventually become irrelevant

That's exactly what it should do. Stop adding features, keep the standard stable, let new languages slowly take over. The C committee's approach is quite close to what I would like to see.

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

#26

> 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…

> get just as much done with high quality C in half the time.

Bullshit. C++ may have plenty of warts, and sometimes people go way OTT with templates (90% of Boost), but there's no way you're writing code as fast in C as C++ unless it involves no string manipulation, pointers, containers, etc.

String manipulation alone is so awful in C that there's no way you're right. But throw in smart pointers, collections, JSON, regex, etc... All of which are much easier to use in C++ and either built in, or in JSON's case, easy to add.

If you're literally just doing basic maths, then maybe. But how many programs are like that?

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

#27
post #16

Earlier quoted context omitted.

> I realized all this class-ification effort was pure waste, since most of it would never be reused. I don't think this is a valid take. Classes are not about reuse at all. They are about encapsulation and specifying types/providing interfaces. > Same with all the idiomatic conversions. What's your complain about idiomatic conversions? > Don't get me started on boost. Why is Boost, or any library at all, relevant in…

> Why is Boost, or any library at all, relevant in a discussion about C++? I don't have a dog in this fight, but I've been following the scene since early 2000s, a lot of boost made it into the standard. FYI.

Yes, but it is for the better. Although it had the side effect of making boost less relevant.

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

#28

> 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…

In my opinion there are two C++'s:

1) the version used by people writing things like the STL/Boost

2) the version used by people writing apps.

A huge amount of the updates to the language are to make the lives of people in category 1 easier.

The people who fall into category 2 really don't need to use all the template headachery that the language allows. They can if they want, but they probably don't have to.

I've noticed that the Boost people are now deprecating old versions of C++. I look forward to hopefully quicker build times. To be fair, the Boost codebase is a masterpiece of working around decades of C++ versions and compiler bugs/missing features. Obviously that makes the code largely incomprehensible to newcomers.

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

#29
C++ still has the preprocessor and all the horribleness that brings. It's also still a language where you need to know a lot of underlying details about how things work because you want to not be slow and you want to know whether or not you've just allocated memory that you have to manage. You need to know about integer sizes, how characters and integers are similar, pointers and dereferencing.

You can still leak memory easily and use after free, segfault and so on.

So IMO there's a cognitive load where you cannot ignore how things are happening as you might in a dynamic language. Stuff can be static or inline or stack based or heap based and all of it matters. C was bad enough but C++ just piled on more and I got tired of that really. Boost took a million years (subjectively) to turn into something decent and I remember not being able to use any of it because of being stuck on an old compiler on Windows.

I do hope we've moved on from having to build a lot of optimisation in by hand towards being able to describe a problem with it's constraints and limits and have the optimisation done for us.

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

#30
post #16

> 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 realized all this class-ification effort was pure waste, since most of it would never be reused. I don't think this is a valid take. Classes are not about reuse at all. They are about encapsulation and specifying types/providing interfaces. > Same with all the idiomatic conversions. What's your complain about idiomatic conversions? > Don't get me started on boost. Why is Boost, or any library at all, relevant in…

Class composition is about reuse. Class inheritance isn't.
Post reply on HN