[thelist] Why do we say what we say?

Rick den Haan rick.denhaan at gmail.com
Thu Oct 25 03:49:13 CDT 2007


Jon Hughes wrote:
> A couple of examples are having a space before the forward slash for
> singleton tags (<br /> instead of <br/>) and having your CSS included
above
> your scripts.

The sole reason I put a space there is because my editor messes up the color
highlighting of my code if I don't.

As for having the CSS included above the scripts, I tend to put everything
in my HEAD section in alphabetical order, so <link>, <meta>, <script>,
<style>, <title>. Conditional comments go at the bottom. It usually doesn't
matter to the browser what the order is, it's just for quick reference and
personal preference.

Something else that the validator will happily ignore is code indentation.
Personally, I use tabs, but some people like to use spaces, in various
amounts (2, 3, 4 or sometimes even 6 spaces per indentation). Other
developers tend to close their elements after the indentation, e.g.:

<ul
   ><li>Item 1</li
   ><li>Item 2</li
></ul>

I never saw the point in that, but I'm told it could get rid of some
unwanted space in some browsers. And the validator -and browsers- happily
accept this. What's your preference for indentation?

Rick.




More information about the thelist mailing list