[thelist] The Excercise of Elegance

Erika Meyer erika at seastorm.com
Mon May 8 15:56:41 2000


>What are some of the things that you do in order to make your code 
>more elegant, that is, briefer, more concise and clearer?

First, if you want your code to be clear to someone else, comment it well.

For clean fast code: HTML4(.01)+CSS1.  Be able to accept defaults on 
non-CSS monitors.  Try to keep CSS in an external stylesheet.

If you have to use table for layout (who doesn't?) Try to keep them 
as simple as possible.

I try to keep a consistent pattern to where I start or end a chunk of 
something... & use carriage returns to space it out.

Chunk & group CSS also.  I try to keep class designations in a chunk 
so when I think, "ah, the 11px sans-serif #003366 font would go well 
here..." I can pull it out of my little class library...

Instead of Javascript Rollovers try CSS hovers.
(& say "too bad for Netscape.")

Use the validator.

Erika

erika@seastorm.com
http://www.seastorm.com