News for hackers. Stuff that matters.
Re:Cognitive Biases in Software Development by Cthulhu_ on Tuesday March 31, 2020 @03:45AM (#22735640)
I've been doing Go for a while now, and more and more I find myself just writing out really dumb looking code. Add a new line, write another short-lived variable, treat the guy reading it - me - like he's a complete idiot. I don't work in a team at the moment, but what I do now is the groundwork for something that will likely be used for the next decade (UI work, back / front-end).
Re:Cognitive Biases in Software Development by mtrycz2 on Tuesday March 31, 2020 @04:52AM (#22735910)
> really dumb looking code

You cannot imagine how I'd value having really dumb looking code in my life.

Yet here I am, swimming in a swap of cleverness that I can't refactor nor will ever be able to wrap my head around.

I envy you.

Re:Cognitive Biases in Software Development by dgb23 on Tuesday March 31, 2020 @06:38AM (#22736364)
Both "dumb" and abstracted code can be hard to read and change. The most important part is consistency.

It is generally easier to write dumb code that is consistent. It requires less mental energy and is often a very good starting point for refactoring into something more declarative and DRY.

The pain comes from inconsistent code, often either based on wrong previous assumptions, premature optimization or time pressure.

Re:Cognitive Biases in Software Development by Dowwie on Tuesday March 31, 2020 @07:34AM (#22736576)
Clear and concise isn't dumb. It's more readable and maintainable. The dumb code is the clever code that no one understands and requires weeks of effort to do, and to understand, no more than what the clear and concise code does.
Re:Cognitive Biases in Software Development by z3t4 on Tuesday March 31, 2020 @04:50AM (#22735901)
I also write the most dumb and simple code and if it works, then great, I don't touch it until it needs to be optimized or more likely: removed.

Sometimes I don't really know what I'm doing, just getting all tests to pass. Then once it's working, when I know why it works, I will clean it up by removing unnecessary variables, double negations, and name the magic numbers, etc, and try to make it as simple as possible.