User Avatar

Lemmingworks

Software Development

4y ago

I'm interested in software development, languages, memory, and learning.

Bad Code Never Gets Much Easier To Read, Does It?
Lemmingworks

As a software developer, I always feel under a lot of pressure to hit the ground running with a new client. Most of the pressure is of the totally unreasonable self-imposed type that a manager would never get away with. Nevertheless, some combination of professionalism and demented ego will see me trying get my head around a new codebase in record time.

If the quality of the codebase is poor, I will fail to do this.

But, as soon as I come across the first 300 line function called fnCmp3() and have to ask myself "What on earth does this thing do?" (Note: This thought has been heavily sanitised), I'll realise that I'm in for a slog. I'm going to have to hunt down clues in multiple files, go down some rabbit holes, and put the pieces of the puzzle together with gritted teeth.

After an hour of maxing out my brain I'll get there. fnCmp3() will be sending an invoice, or calculating a discount, or whatever ordinary thing. The point is I could have saved an hour of following for loops, conditional statements, and other low level code if it had been clearly named (let alone nicely architected into small single-purpose functions).

I haven't got any cleverer. I just write code that is easier to think about.

If I were a genius, I think I would write terrible code. Instead I code for the brain that I have.

I want to make sure the logic will fit into the magical 7 plus or minus 2 slots in my working memory. So I'm always trying to simply, to reduce the difficulty-level for my future self and other developers, and to eliminate anything unnecessary.

Obviously I write plenty of crufty nonsense too, but I'm trying.

The all-in-one writing platform.

Write, publish everywhere, see what works, and become a better writer - all in one place.

Trusted by 80,000+ writers