[thelist] PAGE OPTIMIZATION: source readability v. download weight

.jeff jeff at members.evolt.org
Wed Jun 12 15:42:00 CDT 2002


jonathan,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Jonathan_A_McPherson at rl.gov
>
> > I would do . . .
> >
> > if (this == this) {
> >     do me;
> > } else {
> >     do me;
> > }
> >
> > it's cleaner
>
> Not only is it cleaner, it's also the style used by K&R,
> the authors of C (which has since been used as a basis
> for C++, Java(Script), C#, etc). It's considered
> standard.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

it's considered standard by *some*.  right now we're talking about
javascript which is not c, was not authored by k&r, etc.

i personally find the style above to be very difficult to read, especially
if it's many levels deep.  it's practically impossible to match up opening
and closing curly braces.  so, i prefer this style instead:

if (this == this)
{
    do me;
}
else
{
    do me;
}

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> I prefer it, too.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

the only statement in all of that that really matters, but doesn't really
have any bearing on what's right for everyone else.  at the end of the day,
all that matters is what's easiest for you.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> And so does Linus Torvalds!
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

who cares.  javascript wasn't created by linus.

;p

hmmm, i wonder what brendan eich's preference is.

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/





More information about the thelist mailing list