[plug] web coding standards (was: Recommended computer store)

Craig Ringer craig at postnewspapers.com.au
Wed Sep 24 00:03:46 WST 2003


>>Don't use anything more 
>>complicated than JavaScript rollovers (and for those set it up so that 
>>the underlying links work without JS), and you should be right. 
>>Sloppiness here might be indicative of the same elsewhere.
>>
>>Cheers; Leon
>>
> It is my understanding that it is bad practice to use Javascript in web 
> programming, as different browsers interpret Javascript differently, 
> and some browsers do not have Javascript enabled.

There's nothing wrong with using JavaScript to add functionality or 
"sparkle" - so long as the site does not rely on the JavaScript to be 
useable. Browsers that don't understand JavaScript will be happy, and 
browsers that have ancient and broken JavaScript implementations are (a) 
not the web developer's problem and (b) can have JavaScript turned off.

It is this principle that causes me to stay away from CSS. Nice idea, 
but the broken browsers are too common, and it's hard to write a site in 
"pure" CSS2/XHTML-1 that works _WELL_ in non-CSS or crap-CSS (eg 
Netscape 4, MSIE4 & 5, etc) browsers. I'll use CSS to achieve an 
additional tweak or bit of polish, but won't rely on it for things like 
layout because too many browsers are broken or don't support it.

> A quick example that 
> comes to mind, is Star Office 5.2.

Uggh, what a god-awful hack. I wouldn't bother to care if that didn't 
work, frankly - no more than i'd care if a perl-based browser I'd 
written in 5 minutes didn't work. The client must also make an effort to 
be compliant.

> I believe (and many will disagree) that processing should be done 
> server-side, to minimise differences in what web site vistors see.

To a large extent, that's wise. There are times when JavaScript can be 
really handy. As an example, form validation can be done in JavaScript, 
and this is a useful tool to the user - so long as the form still works 
fine when submitted without the client-side JS validation code having run.

 > As far as I am aware, all web browsers now in existence, will
 > interpret standard HTML 3.2, without any problems

True. However, 99% of those browsers will ALSO interpret HTML 4.0 
transitional and usually HTML 4.0 strict just as well - the point of 
HTML is backward-and-forward-compatability. Even XHTML 1.0 should only 
break ancient or excessively crap browsers, and I use it for all new 
development.

Craig Ringer

_______________________________________________
plug mailing list
plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug


More information about the plug mailing list