Texts | Christofer Sandin

01001100 00101101

The forgiving nature of the web

HTML and CSS are both extraordinarily relaxed and forgiving. If you forget to close a tag or enter incorrect values in a CSS property, it’s not a big deal, as the parsers continue while ignoring the error. However, that does not mean you have to use these traits intentionally because you are lazy.

When you add JavaScript, it becomes a lot harder. A typo in that code stops execution, resulting in no code after that error being executed. But JavaScript is a loosely typed system, so it’s still way more forgiving than the Ada language I was taught at university.

HTML and CSS are both extraordinarily relaxed and forgiving.

This does not mean you have to be sloppy and lazy. Fault-tolerant systems are a backup with robustness built in. That is not an excuse to “don’t bother.”

Sooner or later, you will run into unexpected issues when you try to cut corners. From working in this field for a long time and working with many developers, I can confidently say that if you concern yourself with the details and get it right from the start, you can spend a lot of hours doing something valuable instead of fixing bugs. Trust me, you’ll have enough of those anyway…

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, when you forget to tie your shoes, you benefit from that. Still, it’s a good idea to tie your shoes when you put them on.

Therefore, 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.