[Javascript] Code optimization

Mike Dougherty mdougherty at pbp.com
Tue Aug 15 07:56:54 CDT 2006


This thread might already be dead, but let me beat the horse a little more...

What would be the point of sacrificing good semantic markup to save a few bytes?

I acknowledge that tag soup should be fixed, then cleaned of extraneous markup.  I think div-itis 
and class-itis are potential pitfalls that prevent new-to-css development from realizing the full 
extensibility of semantic markup, descendant selectors and the power of the 'Cascading' part of 
CSS.

If the goal is to download the lightest possible html file, then valid structural markup is the 
way to go.  Using a minimum of tag attributes, (only id and few classes) unobtrusive javascript 
event registration (no 'onclick' in the html) and CSS descendant selectors for styling (removes 
all the presentation clues from the html) - the html is left with many less bytes to download. 
 The CSS gets cached, Script files get cached and the user experience is usually improved from 
this optimization.   (Even if user experience is was merely even, the cleaner markup and code is 
usually easier for future developers to maintain)

Ok, that's enough idealistic theory before 9:00 am.  :)

On Tue, 15 Aug 2006 03:43:06 +0000
  "Troy III Ajnej" <trojani2000 at hotmail.com> wrote:
> Good point! -But as you see he is trying to get rid of as much html code as 



More information about the Javascript mailing list