I think I'll just start photographing messy code I find while at work.

For example, I have seen many instance of code looking like this:

if (condition1 && condition2) {}
else {
doAction()
}

And if you "fix it", it crashes. 🤦‍♂️

It just so happend that condition1 or condition2 throw an exception and JS interpreter jumps to the other branch of execution. So as doing: `!condition1 || !conditon2` itself throws and exception and conditional body is not executed.

Show thread

For example, HTML documents have too much invalid elements. JavaScript code has too many access to attributes from undefined attributes.
and CSS has waaaaay too many !important and duplicates.

Show thread

As I explore more software projects, I find out more and more programmers that just copy some code and apply random changes until it works.

Further, the code does not work in a lot of cases, it's simple a coincidence we have expected results. Logs reveal too much errors and code keeps working because it is lax enough.

@DeveloperMemes In general, one should not be afraid to change code. Change it, break it, and fix it.

@DeveloperMemes

Legacy code should not be feared. Legacy code should not be stigmatizd. Legacy code should be domesticated, tamed, updated to modern, reasonable code.

Show older
Social Touha.me

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!