Kevin Ulrich joins DFWIMA Board

Wednesday, June 25, 2008


Kevin Ulrich was elected to serve on the Dallas Fort Worth Interactive Marketing Association (DFWIMA) board. Ulrich's position heads up the web site and operations committee. Click here to visit the DFWIMA site or read the press announcement on MarketWatch.com, TradingMarkets.com or redOrbit.com.

Posted By: Kevin Ulrich

CATEGORIES: News About Kevin Ulrich,
TAGS: Kevin Ulrich, DFWIMA, Board Member,



Naming Conventions To Follow When Developing A Website

Friday, April 11, 2008


 

Many newer developers when they start out building webpages and using css they tend to name things according to whatever comes to their head when they create the style, thus many amateur developer's stylesheets have font styles named style1, style2, fontred, fontblue etc., while this practice may work fine and makes sense to the person who wrote the guide, it makes no sense to anyone else and is not the best way when it comes to maintenance. Say for example you named some style headerblue and at the last moment the client decided they wanted that header to be red. You now have two choices, either rename the style to now be style red throughout the site or leave it alone and now you have sloppy code that doesn't make sense to the next person who has to edit your files. Remember when building any site or coding anything to try and think, "Is someone else going to understand what I was thinking when I wrote this code? Are they going to be able to quickly understand and alter the code that I was working on?" 

 

When managing people and developing standards I personally would prefer to not tell someone exactly how do something, because then it just becomes memorization and they never really learned how to think and plan, so I came up with some examples of how to name styles which can leave the developer with some freedom so they learn habit and build their own system of naming which will also make sense to other people.

 

Avoid using colors, numbers and positioning in your naming convention, use more descriptive naming. This is better to do because colors and positioning could change.  Using numbers is just bad form because someone looking at your style sheet has no idea what exactly the difference is between style1, style2 and style3. If you named these items copy-main, copy-legal, copy-headline, link-legal, link-main for example it would be easier for the next person to have a clue where this style should go. For container DIVs I try to name them based on the area of the page it is located and/or it's primary function and I like to capitalize these names, e.g. SITE, HEADER, FOOTER, MAIN, PRIMARY, SECONDARY, TERTIARY, MENU, LOGO, CONTENT, DETAIL, SEARCH. This methodology gives a better description of where that style should be used on the site. I think following a policy of "what it is" and "where it goes" helps myself and others remember what I may have intended the style to accomplish. Arbitrary numbers and names that really give no meaning to the style really don't help anyone, not even yourself. It is also good to follow an organized policy when naming your files. Some developers like to organize their folders to a level that is unnecessary and actually make it harder for the search spiders to index the site. You have to have levels of organization depending on the size of the site. A ten page who we are what we do B-2-B site doesn't need to be divvied up into subdirectories, all the page files can go in the root and of course you should keep your scripts and images separate, but for the most part the main page files can still be organized by having a consistent file naming convention. With file names I try and a similar approach when naming files, “what it is” and then “what it does”.  If you see the file names of this site, I followed this way of thinking. You might have found you are viewing this article on the ArticleDetail.aspx page, and you may have gotten to it via the ArticleSearch.aspx or ArticleList.aspx. You see by putting what it corresponds to in the first part of the name, you get all the files that do similar things listed together in the directory in alphabetical order.  Someone else might have named the files SearchArticle.aspx or ListArticle.aspx, but by doing this the similar files don’t get grouped together. I realize you could put them into folders, and again it all depends on how larger the site is, how important search is and what level of organization it really needs to be in.

 

In summary some good practices to follow when developing a style guide are:

  • Avoid using colors, numbers and positioning in your naming convention.
  • Use descriptive naming.
  • Follow a policy of "what it is" and "where it goes" when constructing style names.
  • Be consistent, it doesn’t really matter if you use hyphens, underscores or camel case, just try and follow some sort of structure to what you are naming.
  • Be organized and think before you name something.


Posted By: Kevin Ulrich

CATEGORIES: General Web Development,
TAGS:


<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

ARTICLES

General Web Development (1)
News About Kevin Ulrich (1)

RSS Feed