Live data from Hacker News

Cognitive Biases in Software Development

smyachenkov.com

61–70 of 127 posts

Re: Cognitive Biases in Software Development

#61
post #39

My personal observation (and view of course) is that most people simply cannot code. And I am not talking about that reverse-a-binary-tree or traverse-a-linked-list type of coding, but more profoundly they just cannot wrap their head around a problem and are able to create a sufficient solution with respect to the context of the code and its environment at the same time. Good software development is strongly connecte…

The Fizzbuzz test sounds like a joke when you first hear about it, but it's incredibly effective at weeding out these people.

Re: Cognitive Biases in Software Development

#62
post #47

Earlier quoted context omitted.

'a' and 'i' are perfect for indexes Except they're not as good as 'index', which is obvious and provides some meaning, so why accept single character name? I have an eslint rule that blocks single character var names on my projects. It makes my team develop good habits, and no one has ever complained about it. Our code is very readable.

> so why accept single character name? Because readability suffers with repeated long variable names There's a reason why math uses i,j,k and x,y,z and it's not to be petty.

There's also a reason why a lot of people find equations incredibly hard to parse.

Re: Cognitive Biases in Software Development

#63
post #44
post #39

My personal observation (and view of course) is that most people simply cannot code. And I am not talking about that reverse-a-binary-tree or traverse-a-linked-list type of coding, but more profoundly they just cannot wrap their head around a problem and are able to create a sufficient solution with respect to the context of the code and its environment at the same time. Good software development is strongly connecte…

People think differently and the higher up in the abstraction level, the more diverse it will get. Like for example some people think in shapes and will get crazy if you do not format the code in the same shapes. Others think in words and writes the code as like they where talking to a human. Others have images in their head and doesn't really care how the code looks. Some people annotate their code so that it looks…

I have a coworker that names variables after Marvel and Disney characters.

Re: Cognitive Biases in Software Development

#64
I've been putting off writing about similar subjects. This is a favorite genre for me.

I often consider path dependence in product development. The decisions we face for any given circumstance is limited by prior decisions and experiences, even though past circumstances may no longer be relevant.

Re: Cognitive Biases in Software Development

#65
post #44

Earlier quoted context omitted.

People think differently and the higher up in the abstraction level, the more diverse it will get. Like for example some people think in shapes and will get crazy if you do not format the code in the same shapes. Others think in words and writes the code as like they where talking to a human. Others have images in their head and doesn't really care how the code looks. Some people annotate their code so that it looks…

I have a coworker that names variables after Marvel and Disney characters.

Do we have an analog to Occam's razor for can't/won't? It sounds like your colleague has an obscure sense of humor or has simply checked out.

Re: Cognitive Biases in Software Development

#66
post #39

My personal observation (and view of course) is that most people simply cannot code. And I am not talking about that reverse-a-binary-tree or traverse-a-linked-list type of coding, but more profoundly they just cannot wrap their head around a problem and are able to create a sufficient solution with respect to the context of the code and its environment at the same time. Good software development is strongly connecte…

The Fizzbuzz test sounds like a joke when you first hear about it, but it's incredibly effective at weeding out these people.

I don't think the parent is complaining about that sort of thing, they just have a higher standard. You will disagree with a lot of naming decisions from people you work with, and they all pass Fizzbuzz.

Re: Cognitive Biases in Software Development

#67
post #39

My personal observation (and view of course) is that most people simply cannot code. And I am not talking about that reverse-a-binary-tree or traverse-a-linked-list type of coding, but more profoundly they just cannot wrap their head around a problem and are able to create a sufficient solution with respect to the context of the code and its environment at the same time. Good software development is strongly connecte…

I don't think this is the right mental model of coding. It seems a bit too similar to the idea that "most people simply cannot read". We all accept that nobody can read without instruction, practice, and feedback. Why is coding somehow different? If anything, I think reading is more foreign/difficult, because coding is explicit thinking, and we all think. Whereas reading is a completely synthetic act that starts with…

> It seems a bit too similar to the idea that "most people simply cannot read".

Most people can read in that they can translate text into sounds. However most people cannot read if require that they can accurately comprehend what the text says, just look at the results of reading comprehension tests, a majority scores horribly on them.

> Why is coding different?

You can get by just fine in life without accurately understanding text, but you can't get by just fine as a programmer without accurately understanding what code does.

Re: Cognitive Biases in Software Development

#68

Personally I found that my productivity as a software developer was much higher when I was young and didn’t think so much about the cleanest code or the perfect architecture for a problem and instead just tried different approaches. Now I often feel paralyzed by having to “get it right” from the beginning. Valid (in my opinion) lessons I cherish today are keeping individual parts of a code base simple and understanda…

This is exactly where in have ended up. And I am happier for it. My code is simpler and less "clever" per line but far wiser is structure and in use.

I abstract far more carefully now and I don't mind a few extra lines of code that make it easier to digest at a glance.

Re: Cognitive Biases in Software Development

#69

Earlier quoted context omitted.

I don't think this is the right mental model of coding. It seems a bit too similar to the idea that "most people simply cannot read". We all accept that nobody can read without instruction, practice, and feedback. Why is coding somehow different? If anything, I think reading is more foreign/difficult, because coding is explicit thinking, and we all think. Whereas reading is a completely synthetic act that starts with…

> It seems a bit too similar to the idea that "most people simply cannot read". Most people can read in that they can translate text into sounds. However most people cannot read if require that they can accurately comprehend what the text says, just look at the results of reading comprehension tests, a majority scores horribly on them. > Why is coding different? You can get by just fine in life without accurately und…

I think the more apt analogy would be that most people can follow a recipe, but not many people can invent new recipes from scratch (let alone achieve a specific food effect with said recipe).

Most people can modify a recipe, if the modification is natural or easily comprehended. For example, adding extra ingredients to flavour a food. But to invent one from scratch would be akin to creating a new type of food, or new way to cook, or a new way to combine cooking methods.

Re: Cognitive Biases in Software Development

#70
post #57

Earlier quoted context omitted.

Although somewhat amusing, I'm assuming there's more to 'MemoryHolder' than just an inappropriate name. What was wrong about it at the type level that illustrates your point? Or do you mean to say that it's (somehow) illustrative of a lack of conceptual understanding?

I'm curious about the same thing. With my Ada background, I see a completely sensible interpretation of MemoryHolder: A Holder type is a managed (RAII/garbage collected) wrapper that has a reference to some unmanaged/primitive object. If that primitive object is some notion of a contiguous region of memory, then MemoryHolder is a perfectly good name for it. A name like "Buffer" might not automatically tell the users…

Thank you for this insight. I wasn't aware that this was a reasonable name when coming from Ada.
Post reply on HN