News for hackers. Stuff that matters.
Re:Cognitive Biases in Software Development by W0lf on Tuesday March 31, 2020 @04:05AM (#22735717)
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 connected with ones ability to think clearly about any given problem and the ability to logically deconstruct it in smaller, more digestible thoughts. If there's confusion in the mind, there probably will be confusion in the code as well.

Also, it just seems as if many are unable to step back and look at the broader side of things when coding. Asking questions like: Are we using the right concepts here? Did we develop sufficient abstractions? Case in point: I was just refactoring a code base for a client where the code was paved with a `MemoryHolder` type, where simply `Buffer` would have been the better name for the same concept.

Re:Cognitive Biases in Software Development by appleflaxen on Tuesday March 31, 2020 @06:34AM (#22736350)
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 arbitrary symbols that must be memorized by rote before you can even take the next step of using them.

None of us start out life being literate, but few people lack the ability to become literate. Why is coding different?

Re:Cognitive Biases in Software Development by jasode on Tuesday March 31, 2020 @09:10AM (#22737123)
>None of us start out life being literate, but few people lack the ability to become literate. Why is coding different?

To elaborate on the sibling comments, coding is generative work instead of passive consumption like reading. This split becomes easier to see when looking at a bunch of domains.

Most of people can learn to read a book but very few can write a good book. Similarly, it's easier to re-tell someone else's funny joke than be creative and write original comedy.

Many people can learn basic physics equations like "f=ma" is "force equals mass times acceleration" but fewer are able to be generative and discover new physics equations that are accepted by the science community.

Most people can listen to music and appreciate it, but a smaller percentage can play instruments. And then within the set of musicians, an even smaller percentage can compose new original music. There must be something more to it than "training and practice" to explain why a 19-year old Chopin can compose sophisticated piano compositions while most 70-year old professional concert pianists that have performed for decades with more repertoire than Chopin have written no notable original music.

Coding may not be as hard as creating "Theory of General Relativity" but it's not the same as reading literacy.

Re:Cognitive Biases in Software Development by kspacewalk2 on Tuesday March 31, 2020 @09:31AM (#22737336)
Generative work is not all created equal. Most of programming we all do is like applying physics equations in practice. A tiny portion is truly on the cutting edge, more akin to physics research.

Likewise, a lot more emails and discussion comments and school reports are written, per volume, than masterpiece books.

Re:Cognitive Biases in Software Development by iffybookmark on Tuesday March 31, 2020 @11:52AM (#22738753)
I'd be willing to bet that

{people who can look at a real world problem, choose an appropriate physics model, and apply the right equations, correctly}

and

{people who can look at a real world problem, choose an appropriate logical model, and apply the right language/frameworks/code, correctly}

are probably really quite similar sets.

Re:Cognitive Biases in Software Development by gnunez on Tuesday March 31, 2020 @01:07PM (#22739717)
I look at a coding problem and think, what problem did I or somebody else solve in the past that looks similar to this new problem? What’s different about this new problem? What’s the same? In that sense coding is more like reading, in that it is about pattern recognition and “reading the pattern”, then it is about creating something new entirely.
Re:Cognitive Biases in Software Development by username90 on Tuesday March 31, 2020 @07:03AM (#22736468)
> 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 by chii on Tuesday March 31, 2020 @07:22AM (#22736524)
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 by W0lf on Tuesday March 31, 2020 @07:28AM (#22736556)
Elaborating a bit more on this, I have made the observation that again those _most people_ don't care much reading (good) code from other people. There are many outstanding examples of code quality out there. For instance, I've found many good patterns and solutions by simply reading the Chromium source code, many of which I can apply directly to similar problems I'm facing myself for any given software project I'm doing.

The same holds true for literature, I think. Surely, there are many people how can read and write a piece of text. However, there surely is a qualitatively difference between a gossip article from the magazine and Shakespeare's Hamlet.

Re:Cognitive Biases in Software Development by ratww on Tuesday March 31, 2020 @09:22AM (#22737242)
> I have made the observation that again those _most people_ don't care much reading (good) code from other people

Yes. Lack of reading is observable even inside code bases themselves.

Some contributors are more prone than others to not read the codebase they're working on and break patterns, use different file naming and folder structures, disregard currently existing code and re-implementing things from scratch, use a completely different code style, use tabs instead of spaces.

I don't think it's fair to assume that those people are doing this out of malice, or even to push their own style, because as soon as you mention that to them, they admit they were just not paying attention.

Re:Cognitive Biases in Software Development by JoeAltmaier on Tuesday March 31, 2020 @09:24AM (#22737255)
Simpler still: they have a style and don't have the ability to change it on a dime. So they continue as they're accustomed to.
Re:Cognitive Biases in Software Development by ozim on Tuesday March 31, 2020 @09:21AM (#22737222)
Wanted to point out that parent is referring to people who are somewhat in occupation where "coding" is a requirement and probably all those people he is referring to had training or extensive training in that.

I do not think parent poster is referring to junior developers or just people on the streets.

Even though they work as developers and have experience they still don't get it. Just like people who mechanically read symbols and put it into words but don't get the meaning behind paragraphs or whole stories.

Re:Cognitive Biases in Software Development by iateanapple on Tuesday March 31, 2020 @07:26AM (#22736548)
> It seems a bit too similar to the idea that "most people simply cannot read".

Remember that most people require extensive schooling for the better part of a decade in order to learn how to read.

Re:Cognitive Biases in Software Development by commandlinefan on Tuesday March 31, 2020 @09:21AM (#22737224)
> similar to the idea that "most people simply cannot read".

I think you're probably right, but in a strictly semantic way: I think it's feasible that nearly everybody (excluding, say, the severely mentally handicapped) could learn to program to a reasonable level of proficiency, with enough effort. However, most people won't, so it ends up being the same as if most people can't.

Re:Cognitive Biases in Software Development by TheOtherHobbes on Tuesday March 31, 2020 @10:48AM (#22738027)
HN is a self-selecting population of higher=than-median IQ people with specific interests. Outside of that population, skill levels look like this:

https://www.oecd.org/skills/piaac/Country%20note%20-%20Unite...

Re:Cognitive Biases in Software Development by z3t4 on Tuesday March 31, 2020 @04:33AM (#22735840)
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 like LLVM. Others think of real world items like containers, ships, streams, etc.
Re:Cognitive Biases in Software Development by dillonmckay on Tuesday March 31, 2020 @06:48AM (#22736407)
I have a coworker that names variables after Marvel and Disney characters.
Re:Cognitive Biases in Software Development by z3t4 on Tuesday March 31, 2020 @09:13AM (#22737148)
After being tasked to do the same repetitive job over and over I became very bored, and to make it fun I changed the variable name in one of the repos. The funny name stayed there as some sort of artifact and probably still haunts the poor people tasked to maintain it. And it has become a war story about that time when one of my colleges was tasked to make a routine change, but for the life could not figure out was was wrong, only to find out that repo had a different variable name...

So your college probably need some more challenge. Put him on binary (assembly) optimization or something, where he doesn't have to come up with variable names.

That said, naming things is probably one of the most difficult tasks in programming.

Re:Cognitive Biases in Software Development by mrslave on Tuesday March 31, 2020 @06:54AM (#22736427)
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 by abiogenesis on Tuesday March 31, 2020 @10:01PM (#22744882)
I'm not proud of this but I once temporarily named an exception class after a cartoon character and it kept popping up in server logs for years.
Re:Cognitive Biases in Software Development by lmilcin on Tuesday March 31, 2020 @09:55AM (#22737542)
Depends on the definition of "can"

I think, most people have potential to be able to code. By "can" I mean if they applied themselves to learning.

The problem is there's just no easy way to somehow transfer the knowledge and experience of what it means to actually code. The Doening-Kruger effect is in full force because you can't tell if you can code until you can. Moreover, almost every technology today must cater to complete beginners so it is easy to write a Hello World but then there is no way to tell you how to put your solution together. There is nuggets of wisdom but you need to have some prerequisite knowledge and experience to make use of them.

It is easy to see that I can't sight-read music. I mean I am amateur flautist but for some reason I just can't "get it" (but I also did not try hard). I know you can sight read because there are a lot people that can just take a printout and start playing it without previously studying it.

The same is not true with programming. It is not easy to see people do programming -- you only see results that you do not understand until you actually can code. You can appreciate the music but you can't appreciate the code until you actually can code.

It does not help that the whole industry is crazy right now. There is very small proportion of people with actual experience because of exponential growth of number of developers. The salaries are inflated and newcomers are getting paid as if they were experts in other industries. If you are getting paid a lot it means you must be valuable, no?

Re:Cognitive Biases in Software Development by ng12 on Tuesday March 31, 2020 @11:29AM (#22738461)
> I think, most people have potential to be able to code. By "can" I mean if they applied themselves to learning.

My time spent teaching makes me think otherwise. I saw so many smart, motivated young people who simply could not get their homework done. This was especially discouraging since my alma matter has a very strong focus on pedagogical programming.

There's something about programming that "clicks" for some people. They can look a the little pieces and immediately understand how to put them together. If you don't have that spark it's going to be an extremely challenging journey.

Re:Cognitive Biases in Software Development by commandlinefan on Tuesday March 31, 2020 @10:14AM (#22737697)
> If you are getting paid a lot it means you must be valuable, no?

And if you actually are experienced and try to offer a newcomer some guidance in writing code that they won't regret having written a year from now, they'll accuse you of being a "perfectionist" who's wasting time trying to obtain some theoretical optimization.

Re:Cognitive Biases in Software Development by pythonaut_16 on Tuesday March 31, 2020 @11:50AM (#22738724)
Unfortunately that mentality isn't limited only to newcomers. There are plenty of developers with many years of experience who still practice that same short sightedness.
Re:Cognitive Biases in Software Development by giantDinosaur on Tuesday March 31, 2020 @04:28AM (#22735824)
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?
Re:Cognitive Biases in Software Development by kqr on Tuesday March 31, 2020 @05:44AM (#22736120)
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 that the type is managed, or that it wraps some underlying primitive type. That may or may not be relevant to the user, but it's not obviously always irrelevant, at least.

Re:Cognitive Biases in Software Development by W0lf on Tuesday March 31, 2020 @07:22AM (#22736529)
Thank you for this insight. I wasn't aware that this was a reasonable name when coming from Ada.
Re:Cognitive Biases in Software Development by henrikschroder on Tuesday March 31, 2020 @06:38AM (#22736365)
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 by inertiatic on Tuesday March 31, 2020 @06:57AM (#22736443)
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 by gibbonsrcool on Tuesday March 31, 2020 @10:57AM (#22738113)
I think we should strive to make more ways for people that "can't code" to be able to contribute. It's hard. I've been thinking recently that there might be an additional lesson behind Conway's Law; that the interface and character of a system mirrors its creator(s). This means if you hire super smart people to build something, it's going to require super smart people to interact with, operate, and maintain.
Re:Cognitive Biases in Software Development by Nevermark on Tuesday March 31, 2020 @11:43PM (#22745424)
I have noticed that adept software developer's can be more patient with tools that require fiddling, especially if the fiddling feels like challenging but rewarding puzzle solving in a sea of powerful options.

Unproductivity that feels viscerally very productive.

Alternatively, command line tools tend to be created and increase the productivity of the more technically inclined, but are opaque to the less technical.

Which effect is the GibbonsRCool's Law? Or both? GibbonsRCool's Laws of Skill Drag and Acceleration?