Live data from Hacker News

Convincing C programmers to switch to C++: A look at human behavior (2016)

blog.kareldonk.com

71–80 of 87 posts

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#71
post #43

Earlier quoted context omitted.

And a good example in the comments here is how few people are talking about what the article is actually about (human behaviour) but instead there's mostly anti-C++ reactions. The aversion to C++ is so strong that an article that only casually is about C++ must be attacked for the perceived C++ advocacy. The article isn't really about C++ advocacy at all. It really doesn't matter if C++ is better or not. The article…

The article is a 4,000 word diatribe about how stubborn, irrational people refuse to see reason, without at any point admitting the possibility that these backward, incorrigible C holdouts could be right in any way.

It's not about C holdouts being unreasonable at all. They're only mentioned in the first three paragraphs of the article. The article isn't about C or C++. It's about why you and I are arguing right now: we're both irrational.

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#72
post #11

Earlier quoted context omitted.

> And so by following your heart instead of your head, you sometimes make seemingly illogical but objectively better decisions. And sometimes you make seemingly illogical decisions that end up being objectively worse decisions. The problem is that we don't really have a way to quantify our emotions usefully, which means we can use them accurately and are forced to allow for enormous amounts of error in our calculatio…

While you have a point that they might sometimes be counter-productive, I think that emotions are decision drivers which operate on a higher abstraction level and are a way for the mind to compile vasts amounts of experience and deliberation into a single really fast circuit able to perform split-second decisions. So I think that they are mostly correct. But it's really too bad that we cannot retoractively introspect…

I agree, but possibly in a different way. The idea of interoception[1] (which I'm not sure how accepted it is) basically means that your feeling are just your body using a heuristic to assign a feeling to a physical state of your body (that is, there is no universal feeling for anger, just a physiological response you've trained your brain to think of as the concept of anger. Some culture's literally do not have certain feelings). Your body is changing physical states based on some subconscious reasoning (often remembered response), and your brain is then interpreting that physiological state broadly and assigning an emotion to it, and it doesn't always get it right (which is why we get angry or anxious sometimes and aren't exactly sure why).

If that theory is true (not sure, I literally just learned about it this morning[1]), your emotions do have weight in something like this, but it's filtered through multiple lossy abstractions and has a propensity for false positives. That's a much less rosy interpretation of how useful they are, and if true, means we might be far better off trying to cultivate a better understanding of the nuances that are causing those reactions and assessing them rationally (to the degree possible) than to using the lossy abstraction itself with any significant weight.

1: http://www.pc.rhul.ac.uk/sites/lab/index.php/research-themes...

2: http://www.npr.org/podcasts/510307/invisibilia

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#73
post #71

Earlier quoted context omitted.

The article is a 4,000 word diatribe about how stubborn, irrational people refuse to see reason, without at any point admitting the possibility that these backward, incorrigible C holdouts could be right in any way.

It's not about C holdouts being unreasonable at all. They're only mentioned in the first three paragraphs of the article. The article isn't about C or C++. It's about why you and I are arguing right now: we're both irrational.

> It's not about C holdouts being unreasonable at all. They're only mentioned in the first three paragraphs of the article.

That's not true; they are mentioned several times in the first big bullet list. Also the Dan Saks talk he discusses several times throughout the article is specifically about talking to C programmers about C++.

But regardless of whether he is speaking about something specific (C vs. C++) or in the abstract (rational vs. irrational people), he is making the same flawed presumption: that certain choices (like C++) are unquestionably better than other choices (like C), and that if people can't see this then the only possible explanation is some kind of cognitive impairment.

The whole argument presumes that the author is smarter and more rational than other people. He might not even realize he is doing this, but other people can most definitely pick up on it.

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#74
post #3

People aren't rational actors for a reason: Sometimes things are easy to argue for but aren't that great in practice. And so by following your heart instead of your head, you sometimes make seemingly illogical but objectively better decisions. And I think that there is a case to be made about how C++ is efficient in theory, while C is effective in practice.

What you're describing is actually rational behavior. You're describing the difference between what you'll imagine beforehand makes more sense vs. what you know will actually work afterwards. The key difference is that you know more than you did in the latter case, so your descisions later have more information to guide them and thus are more likely to be correct.

To think you understood everything before you started and insist on sticking to that after you find it's not working out isn't rational, it's stubborn.

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#75
post #69
post #20

Earlier quoted context omitted.

Yeah — it's a little confusing, but the multiples are how much slower they are than the fastest. Bigger is worse.

It becomes less confusing when realizing each line is a multiple of the fastest run time. If the fastest one took 100s, then the one taking x1.57 took 157s.

Isn't that what I said? :-)

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#76

How to convince them: - Show them how classes makes things easier (automatic object management, some operator overloading, etc) - Show how the STL makes most things easier (arrays, maps, etc) How not to convince them: - Show uses of excessive/pathological inheritance - Use of templating beyond the basics - Insist they use C++ functions for every single thing - Insist they OOify every interface in their code - Creatin…

I'm going to flip the discussion a bit, and ask, what is a good use of operator overloading? What is a bad one? Is it possible to generalize the rules around good vs. bad cases (in order to make a programming standard others can follow)?

My experience is that I like writing code that uses operator overloading, but hate reading code that has it. Kind of like programming in Perl. In both cases, I find that on large projects, it is best to avoid the technology.

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#77
post #75
post #69

Earlier quoted context omitted.

It becomes less confusing when realizing each line is a multiple of the fastest run time. If the fastest one took 100s, then the one taking x1.57 took 157s.

Isn't that what I said? :-)

Yeah, I read your post once, then I kept trimming and rewording my post, and was left with that heap.

I shouldn't have made either of these posts.

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#78
post #36

Earlier quoted context omitted.

Be careful comparing complexity. C might look simple, and C++ might look complex but I have never seen a char * in C++ to mean 2d of jpg images in memory. C++ is more complex, because it covers more concepts. But when you get simple safe and to reusable things from that complex the difficulty is reduced. What is the right way to store and unknown amount of things in C? There are about a million ways to do and every p…

LOL, C++ developers complain about C developers being impervious to reason, yet can't admit one of the most blindly obvious problems with C++. Plenty of language manage to be more expressive than C++ while being far less complex. C++ is an uncritical grab bag of features. If you don't carefully design features to complement each other you can C++ style complexity. C simplicity is real. It makes it easy to write compi…

[deleted]

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#79
post #71

Earlier quoted context omitted.

It's not about C holdouts being unreasonable at all. They're only mentioned in the first three paragraphs of the article. The article isn't about C or C++. It's about why you and I are arguing right now: we're both irrational.

> It's not about C holdouts being unreasonable at all. They're only mentioned in the first three paragraphs of the article. That's not true; they are mentioned several times in the first big bullet list. Also the Dan Saks talk he discusses several times throughout the article is specifically about talking to C programmers about C++. But regardless of whether he is speaking about something specific (C vs. C++) or in t…

> The whole argument presumes that the author is smarter

Aha, so that's why everyone is posting comments about how terrible C++ is. The author is coming across like an ass, so we must attack that which he appears to be defending: C++.

I don't really pick up on the bad attitude (probably because I have it too), and I don't really care that much to defend C++ or C. I went through the article, noted a few references to whatever psychological studies were there, and decided to read those later. I don't really care if C or C++ is "better". I barely use either anymore.

Re: Convincing C programmers to switch to C++: A look at human behavior (2016)

#80
post #79

Earlier quoted context omitted.

> It's not about C holdouts being unreasonable at all. They're only mentioned in the first three paragraphs of the article. That's not true; they are mentioned several times in the first big bullet list. Also the Dan Saks talk he discusses several times throughout the article is specifically about talking to C programmers about C++. But regardless of whether he is speaking about something specific (C vs. C++) or in t…

> The whole argument presumes that the author is smarter Aha, so that's why everyone is posting comments about how terrible C++ is. The author is coming across like an ass, so we must attack that which he appears to be defending: C++. I don't really pick up on the bad attitude (probably because I have it too), and I don't really care that much to defend C++ or C. I went through the article, noted a few references to…

[deleted]
Post reply on HN