The forgiving nature of the web | Christofer Sandin

The forgiving nature of the web

HTML and CSS are both extraordinarily relaxed and forgiving. If you forget to close a tag or if you enter the wrong values in a CSS property, it’s more or less not a problem. But that does not mean that you have to take advantage of these intentionally introduced traits intentionally.

When you add JavaScript, it becomes a lot harder since a typo in JavaScript code stops the whole execution, resulting in nothing working. But JavaScript is a loosely typed system, so it’s still way more forgiving than the Ada language I was taught at university.

This does not mean you have to be sloppy and lazy. Fault-tolerant systems are a backup with robustness built-in and are not the same as ”you should not bother.”

Think of it this way. It’s nice to know that you can walk with your shoelaces untied. It’s great that it works, and occasionally, you benefit from it, but that doesn’t mean that it’s a better way than tying your shoes every day you put them on.

Write strict HTML, lint your CSS, and compile your JavaScript to up your game. Don’t rely on fault tolerance to fix your code. You win in the long run.