End tags, semi-colons and maintainable code
In Of parser-fetishists and semi-colons, Chris Heilmann brings up the importance of code maintainability, something that I feel is overlooked a bit too often.
Another language where some people make code harder to read by omitting characters is HTML (I wrote a bit about that a while ago in HTML5 syntax guidelines). You can omit the end tags of some elements, the start and end tags of some, quotation marks around attributes, etc. It is valid HTML and browsers will parse it, but again, it will not make the code easier for fellow developers to understand and maintain.
There are more examples in Christian’s post, so do read it. And remember this:
Writing clean and readable code makes you a nice person to the people who take code over from you.
Relying on browsers to magically insert missing code is not developer-friendly.
- Previous post: The HTML5 placeholder attribute is not a substitute for the label element
- Next post: Automatic line breaks in narrow columns with CSS 3 hyphens and word-wrap
Subscribe / follow
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost