[thelist] [CODE] bloated image src names

Michael Mell mike at nthwave.net
Tue Nov 12 18:55:58 CST 2002


On Tuesday, November 12, 2002, at 09:39  PM, Benjer wrote:
> I often keep my images tidied into separate folders:
> <img src="images/menu_nav/food_nav/main_subnav_prawns.gif"
> but when you have lots of images this does BLOAT the code somewhat.

How many times have we evolters been going about our daily business
only to read that someone else is dealing with the very same issue on
the same day? It happens about monthly for me.

Yesterday I let one of my client's new html-ers  know that:
~ **rigourous** consistency is your best friend. Pick your method, and
stick with it.

~ _all_ images go in the /images directory, the only exception being
unique cases
	this keeps the byte-heavy assets in one location, the lite html
everywhere else -- easier to move the lite stuff around the network

~ if an image is specific to only one directory, it goes in a similarly
named /images/subDir
	eg. an image only used in /aboutUs goes in /images/aboutUs

~ don't repeat the name of the dir in the file name:
	/images/aboutUsButton.gif should be /images/aboutUs/button.gif

~ if you choose to ignore the item above, begin the file name with the
class name
	/images/headersAboutUs.gif
	*not* /images/aboutUsHeader.gif
	this lets all the headers sort together

~ never use descriptors in the file name that might change
	orangeButton.gif might turn blue tomorrow

~ the first letter of each file and folder name is lower case

~ use initial caps instead of underscores.
	saves on bloat!

~ use full words in the file name when possible -- no indecipherable
abbreviations

(I also had to tell him to never leave duplicate files laying around,
but that's another story.)

I am wary of defending these guidelines. If you don't like them, that's
OK-for-me.

>
> <img src="images/menu_nav/food_nav/main_subnav_prawns.gif"
by the above guidlines should be
<img src="images/nav/food/prawns.gif"

m





More information about the thelist mailing list