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.


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.

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

if (condition1 && condition2) {}
else {

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.

Sign in to participate in the conversation

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