meyerweb.com

Skip to: site navigation/presentation
Skip to: Thoughts From Eric

Keep Your Classes Clean

A picture of three bottles of the general-purpose cleaner 'Simple Green'.  The first contains a dark green liquid, as you might except given its name.  The second contains yellow (lemon-scented) liquid, yet is still called 'Simple Green'.  The third is a white bottle with a purple label; again, it has the name 'Simple Green' prominently displayed.

See, that’s why presentational class names are such a bad idea.

11 Responses»

    • #1
    • Comment
    • Wed 23 Feb 2005
    • 2159
    Mark Kawakami wrote in to say...

    I definitely agree with the principle, but I think I should point out that Simple Green is so named not so just for the green color of the basic product, but for the environmentally friendly nature of the products.

    Also, not to be picky, but isn’t the classname on the image “border”?

    • #2
    • Comment
    • Wed 23 Feb 2005
    • 2201
    Joey wrote in to say...

    Haha… we use that in Bio!

    • #3
    • Trackback
    • Wed 23 Feb 2005
    • 2222
    Received from backstage rogers

    Geek jokes

    I love ‘em.

    • #4
    • Comment
    • Thu 24 Feb 2005
    • 0038
    Eric Meyer wrote in to say...

    Ah, Mr. Kawakami… indeed the class name is border. You have looked beyond the surface and discovered the truth buried within the truth. Well done, Grasshopper.

    • #5
    • Comment
    • Thu 24 Feb 2005
    • 0059
    Fletch wrote in to say...

    Hah hah Eric got busted!

    • #6
    • Comment
    • Thu 24 Feb 2005
    • 1111
    Roy Schestowitz wrote in to say...

    I have seen this type of stuff several times before. It is also very common for products like chewing-gum and mints to do this.

    Thanks for the chuckle.

    • #7
    • Comment
    • Thu 24 Feb 2005
    • 2144
    Joe D'Andrea wrote in to say...

    A sobering point indeed. Presentational class names are clearly a lose-lose situation and are best avoided like the plague.

    Why, even if Sunshine Makers decides to embrace the color motif, it’s still doomed from the start. Simple Green … Curious (Yellow) … Purple Rain … Soylent Green (!) … I mean would you just look at that list – it’s a total catastrophe!

    (“Dada marches on …”)

    • #8
    • Comment
    • Wed 2 Mar 2005
    • 0048
    Kurtis Kroon wrote in to say...

    Some of us have enough trouble getting our sites to look half as good as this one … even with all the colors turned off (Firefox preference) — and now we have to worry about keeping our classes clean? Oh, well … I suppose I should think of it as ‘job-security’ n’est-ce pas?.

    Thanks for the excellent advice: your site always keeps me honest, even if it’s only with myself. Also, I love the Gatekeeper function, though I wonder if it has produced any snippy comments. (Umm … orange?)

    • #9
    • Comment
    • Mon 4 Apr 2005
    • 0352
    patrick h. lauke wrote in to say...

    hah…can’t believe i missed this the first time around…

    • #10
    • Pingback
    • Tue 4 Oct 2005
    • 0752
    Received from ļāūņš ļāčīš » Blog Archive » Around the web in 80 days #6

    [...] ā pēc iespējas lētāk uz sava tēkrekla dabūt govi. Saites, kuras sāk novecot. Eric’s Archived [...]

    • #11
    • Pingback
    • Sat 12 Nov 2005
    • 2210
    Received from ara pehlivanian » Blog Archive » Sidebar Semantic Shenanigans

    [...] o find all kinds of auxiliary information. Now we’re all aware of the importance of keeping our classes clean, meaning that they shouldn’t contain presen [...]

Leave a Comment

Line and paragraph breaks automatic, e-mail address required but never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Remember to encode character entities if you're posting markup examples! Management reserves the right to edit or remove any comment—especially those that are abusive, irrelevant to the topic at hand, or made by anonymous posters—although honestly, most edits are a matter of fixing mangled markup. Thus the note about encoding your entities. If you're satisfied with what you've written, then go ahead...


February 2005
SMTWTFS
January March
 12345
6789101112
13141516171819
20212223242526
2728  

Sidestep

Feeds

Extras