ronlg | web/ui developer

RSS

Less is More

I’m going to jump right in and start off with an example of what I mean by “less is more”. 

<p>
    <strong>
    Hello World! Less is more!
    </strong>
</p>

 Let’s take a look at those 5 lines of simple code. We have bold text wrapped in a paragraph tag. Here is how we can have less code do more things.

<p id=”LessIsMore”>
    Hello World! Less is more!
</p> 

You’re right, It isn’t bold anymore, but it will be with CSS. So in your CSS file, assuming that you have one being used, you want to do the following:

p#LessIsMore { font-weight: bold; }

Now all paragraph text with the ID of ‘LessIsMore’ will be bold. Calm down, I know that doesn’t look like anything too genius, but it does serve a great purpose. You now have the ability to only modify your stylesheet instead of touching every instance you want to be bold. With smaller websites, you might not find this to be an issue but when you’re working on sites that have hundreds of pages and countless lines of code that can be tweaked, you want to reduce the amount of time it takes to modify the simplest things. 

Also, look at it from an SEO point of view. The less code that the search engine spiders have to sort through, the more visible the content on the site becomes. It’s like trying to find a needle in a haystack. Over the years, spiders have gotten smarter at doing this, but the easier you can make it, the better. Another thing a lot of people don’t realize is load time. Every single character of code you’re producing plays a role in the load time of the site. Not only that, but it costs money too - yes, bandwidth costs money. I won’t get into this, but keep it in your thoughts for the future. 

Most end users don’t really understand or try to understand the importance of this and quite frankly, it doesn’t really matter if they do or not. It is our job as developers to provide the best User Experience as possible. Whether it be in the UI design, functionality or how quick the site loads. 

There is an old saying of, “Work smart, not hard.” In fact, I just said that to someone about 5 minutes ago. If you can approach your work in a smarter way, the less work you will have to do in the long run; you hope.

Please keep in mind, there is always an exception to the rule.