18 August 2004

I am a organising junkie

Working as just part of the whole

Something that I have come to realise over the last six weeks working at the cabin is that working as a team on projects brings a whole new bunch of management problems with it. Don't get me wrong, the benefits out number the problems with ease, but there are things that need addressing when working in a team if the team is to be truly efficient. People think is different ways, this is a fact. But when you are working together as a team, you really need to find ways of thinking on the same wave length. When everyone is moving in different directions, it only pulls things apart.

Just one aspect of this that I would like to talk about now, is the organising of style sheets. This should be something that the greater bunch of my readers will feel at home discussing, and that is why I will start off with this. Don't be surprised though if I start talking about other stuff in the future, such as sharing asp.net projects. ASP.net is the newest learning curve that I am trying to take. And yes Andy, I do still think that one person can have a programmer mind and a creative mind.

The Style Sheets of Chaos

When you have multiple people working on one CSS style sheet, it can become a bit of a mess. Everyone has their own way of organising their code. Some people have no way of organising their code. Some people have an amazing way of disorganisation other people's code. Basically, it can all become rather messy. You can spend ten minutes looking for the class that is throwing the whole thing out. Redundant classes bloat the file larger than it needs be. Chaos sets in, and bugs come with chaos.

Something that I have decided to try at Netring is come up with a set order for classes to appear within styles sheets, with a list of categories that all the different classes can fall under. This is only really my first draft, and I suspect that we will redraft it a few times in the future, but this is what I have come up with so far.

  • /* Structural and Body Styles */
  • /* Copy and Content Styles */
  • /* Headings */
  • /* Images */
  • /* Lists */
  • /* Forms */
  • /* Tables */
  • /* Extras and Miscellaneous */

(Note that the CSS comment syntax is used for ease of copy and pasting into a new CSS style sheet)

The idea is to split up the style sheet into these sections, and most sections are split by the type of HTML element that the styles effect, except a few.

‘Structural and Body Styles' is for the structural DIV tags and any other element which is used to structure the document to relate to the CSS. For example, Using a DIV for containing the whole page, or a main chunk of content. Using a span to clear other structural DIV tags. This section is also used for any 'body' styles such as a font-family or colour.

‘Copy and Content Styles' is for those annoying little styles such as a span with the class of ‘highlight' that you might use within your copy to highlight certain text, for errors or important messages to the user. The ‘Extras and Miscellaneous' section at the end for anything I might have missed.

Putting the tail on the donkey

So, let's try this out. Lets take some classed and see where they would fit into this organisation of styles. The first CSS class that we need to place is this:

#mainNavigation ul{
	margin:0;
	padding:0;
	list-style-type:none;
	} 

Quite clearly (if you know your CSS) this class effects an Unordered List. So, it would obviously fall under the ‘Lists' category. Ok, how about this:

#mainContent form fieldset label{ 
	width:150px; 
	float:left; 
	clear:left; 
	font-size:90%; 
	} 

The above class affects a label, which is part of a form. So, you've guessed it; place this class under ‘Forms'

Finding the tail on the donkey

So, that we have a basic understanding of how we would place CSS classes into this organised style sheet, what if we find ourselves on the other side of the process, and we need to find the class that is affecting something on a page we are working on. For example, you want to find the class that is replacing the H1 tag in the header with an image. Well, since it is a H1 tag it should have been placed by in the ‘Headings' section.

It's not hard is it? In fact it is stupidly simple, and I am sure that most other developers have some sort of pattern to their style sheets too. But I am going to try and get all the developers at Netring to use the same pattern. Why? It will improve consistency amongst our products and work. It will improve productivity, and efficiency.

Why all the fuss?

Well if your style sheet is not that long, then I would understand why this might seem like a drastic overkill. However, I still try to code my smaller style sheets in the same way now, just out of habit. But when you have a style sheet that is over 1000 lines in code, this sort of structured style sheet can really help.

For example, an ecommerce site that we have just finished, health leads, is running on a transitional version of our Retailplus.bz system. It is half way between an old table based system, with nasty convoluted code, and a new shiny clean easy to update CSS based system. The next version of Retailplus.bz will be highly based upon the changes we have made while putting the site together for health leads. If you check out the style sheet, you will see that it is not small. And it will potentially get bigger when we finish off the system at a later date.

Other Methods

So that I am not shooting myself in the foot, I have to say that I am sure there are other methods for organising style sheets. And some CSS editing software such as topstyle allows you to find classes with ease, using a side bar that lists all the classes.

Some people might order their style sheet with the order things appear on the page. But some times things move around the page so I didn't like this. Some people organise things based on the structure of the document; header classes, the navigation classes, then mainContent classes, finishing with all the footer classes. This might work just as well as the method I use, but how I feel it has holes.

Summary

In summary, I have written a bit about how teams need to try and think as one mind, and stay on the same wave length as each other. I have mentioned that style sheets can suffer when team mates don't try to share each others wave length, and I have demonstrated what I am putting in place at Netring to try and over come this problem with style sheets.

I hope that you found this interesting, and that if you didn't you had the sense to ignore me. ;)

Comments ( 2 )

  1. Eric

    I think about this only a little, as I pretty much still work by myself. But the problems with organization come in when you want to change a font size in a structural div sidebar. Why move the font-size to a typography section, when I can just stick it along with the sidebar.

    So, I continually find that some typography belongs in a typography section, and some belongs along with the div.

    The only thing I do consistently is a huge nav section, including all nav typography, since the nav is what I usually spend the most time on.

    I'll definately be paying more attention to this in the next few weeks, though!
    19 August 2004 at 01:12
  2. online video poker

    online video poker

    <h1> Please visit the sites about<A HREF="http://www.teriandersonandassoc.com/online-texas-hold-em.html"> online texas hold em </A> online texas hold em <A HREF="http://www.teriandersonandassoc.com/online-texas-hold-em.html"> http://www.teriandersonandassoc.com/online-texas-hold-em.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/texas-holdem-software.html"> texas holdem software </A> texas holdem software <A HREF="http://www.teriandersonandassoc.com/texas-holdem-software.html"> http://www.teriandersonandassoc.com/texas-holdem-software.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/online-poker.html"> online poker </A> online poker <A HREF="http://www.teriandersonandassoc.com/online-poker.html"> http://www.teriandersonandassoc.com/online-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-online.html"> texas hold em online </A> texas hold em online <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-online.html"> http://www.teriandersonandassoc.com/texas-hold-em-online.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-online-poker.html"> free online poker </A> free online poker <A HREF="http://www.teriandersonandassoc.com/free-online-poker.html"> http://www.teriandersonandassoc.com/free-online-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/winning-poker-hands.html"> winning poker hands </A> winning poker hands <A HREF="http://www.teriandersonandassoc.com/winning-poker-hands.html"> http://www.teriandersonandassoc.com/winning-poker-hands.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/card-poker.html"> card poker </A> card poker <A HREF="http://www.teriandersonandassoc.com/card-poker.html"> http://www.teriandersonandassoc.com/card-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/video-poker-games.html"> video poker games </A> video poker games <A HREF="http://www.teriandersonandassoc.com/video-poker-games.html"> http://www.teriandersonandassoc.com/video-poker-games.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-players.html"> poker players </A> poker players <A HREF="http://www.teriandersonandassoc.com/poker-players.html"> http://www.teriandersonandassoc.com/poker-players.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/online-video-poker-game.html"> online video poker game </A> online video poker game <A HREF="http://www.teriandersonandassoc.com/online-video-poker-game.html"> http://www.teriandersonandassoc.com/online-video-poker-game.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/official-poker-rules.html"> official poker rules </A> official poker rules <A HREF="http://www.teriandersonandassoc.com/official-poker-rules.html"> http://www.teriandersonandassoc.com/official-poker-rules.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-forum.html"> poker forum </A> poker forum <A HREF="http://www.teriandersonandassoc.com/poker-forum.html"> http://www.teriandersonandassoc.com/poker-forum.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-texas-hold-em-online-play.html"> free texas hold em online play </A> free texas hold em online play <A HREF="http://www.teriandersonandassoc.com/free-texas-hold-em-online-play.html"> http://www.teriandersonandassoc.com/free-texas-hold-em-online-play.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/strategies-for-texas-hold-em.html"> strategies for texas hold em </A> strategies for texas hold em <A HREF="http://www.teriandersonandassoc.com/strategies-for-texas-hold-em.html"> http://www.teriandersonandassoc.com/strategies-for-texas-hold-em.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-strategy.html"> texas hold em strategy </A> texas hold em strategy <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-strategy.html"> http://www.teriandersonandassoc.com/texas-hold-em-strategy.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-poker-tournaments.html"> free poker tournaments </A> free poker tournaments <A HREF="http://www.teriandersonandassoc.com/free-poker-tournaments.html"> http://www.teriandersonandassoc.com/free-poker-tournaments.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-poker.html"> free poker </A> free poker <A HREF="http://www.teriandersonandassoc.com/free-poker.html"> http://www.teriandersonandassoc.com/free-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/online-poker-tools.html"> online poker tools </A> online poker tools <A HREF="http://www.teriandersonandassoc.com/online-poker-tools.html"> http://www.teriandersonandassoc.com/online-poker-tools.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/cowboy-poker.html"> cowboy poker </A> cowboy poker <A HREF="http://www.teriandersonandassoc.com/cowboy-poker.html"> http://www.teriandersonandassoc.com/cowboy-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-rule.html"> poker rule </A> poker rule <A HREF="http://www.teriandersonandassoc.com/poker-rule.html"> http://www.teriandersonandassoc.com/poker-rule.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/online-video-poker.html"> online video poker </A> online video poker <A HREF="http://www.teriandersonandassoc.com/online-video-poker.html"> http://www.teriandersonandassoc.com/online-video-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/online-poker-game.html"> online poker game </A> online poker game <A HREF="http://www.teriandersonandassoc.com/online-poker-game.html"> http://www.teriandersonandassoc.com/online-poker-game.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-rooms.html"> poker rooms </A> poker rooms <A HREF="http://www.teriandersonandassoc.com/poker-rooms.html"> http://www.teriandersonandassoc.com/poker-rooms.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/rules-for-texas-hold-em-card-game.html"> rules for texas hold em card game </A> rules for texas hold em card game <A HREF="http://www.teriandersonandassoc.com/rules-for-texas-hold-em-card-game.html"> http://www.teriandersonandassoc.com/rules-for-texas-hold-em-card-game.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/holdem.html"> holdem </A> holdem <A HREF="http://www.teriandersonandassoc.com/holdem.html"> http://www.teriandersonandassoc.com/holdem.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/rules-for-poker-games.html"> rules for poker games </A> rules for poker games <A HREF="http://www.teriandersonandassoc.com/rules-for-poker-games.html"> http://www.teriandersonandassoc.com/rules-for-poker-games.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-rules-for-poker.html"> free rules for poker </A> free rules for poker <A HREF="http://www.teriandersonandassoc.com/free-rules-for-poker.html"> http://www.teriandersonandassoc.com/free-rules-for-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-hands.html"> poker hands </A> poker hands <A HREF="http://www.teriandersonandassoc.com/poker-hands.html"> http://www.teriandersonandassoc.com/poker-hands.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-rules.html"> poker rules </A> poker rules <A HREF="http://www.teriandersonandassoc.com/poker-rules.html"> http://www.teriandersonandassoc.com/poker-rules.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/world-poker-tour.html"> world poker tour </A> world poker tour <A HREF="http://www.teriandersonandassoc.com/world-poker-tour.html"> http://www.teriandersonandassoc.com/world-poker-tour.html</A> <br/> - Tons of interesdting stuff!!! </h1>
    18 May 2005 at 19:10

Sorry, commenting has been disabled for a while. I am getting a stupid amount of comment spam, and need to find a new way of doing things.

I will not publish your email address, but I may use it to get in contact with you.

HTML tags and entities display as source; they do not render. To create a live link, simply type the URL (including http://).

Topics

  • I am more than willing to admit the big gaps in my knowledge on many topics, including web development. This is a topic I use to get help from the community, and my imaginary audience.
    Ask the Audience
  • Even though looking pretty is not the most important layer to a succesful web site (I don't think there is a Most Important), it does help!
    Graphic Design
  • Have you got a sense of?
    Humor
  • The glam, the sadness, the joy, the madness.
    Life of Findel
  • What ever doesn't fit
    Misc
  • I have a crappy camera, but I do try. A good artist always blames his tools.
    Photography
  • Here I chat about projects I am working on, going to work on, or finished. Some of them I will be happy to let you in on, others I will be ashamed of.
    Project Watch
  • Site news and updates
    Site Info
  • Keepin' an eye on the wwwubb
    Watching The Web
  • This topic will be used for talking about all manner of project management issues relating to Wed Development (Wubb Development). Where we may talk about how to code in the Wubb Development topic, we will be more likely to talk about giving quotes, or planning projects, in this topic.
    Working with Wubbs
  • All things Web Development - Web standards, Hacks, Graphics, and more.
    Wubb Development