What's in your...
What's in your walle... errrm, utilities library?
This might seem like a silly question, but it's amazing how few developers and designers maintain re-usable code libraries.
If you use Dreamweaver, Visual Studio, Eclipse or any of the 101 editors out there, they all do 'boilerplate' pages for you. So why don't more designers and developers use their own default libraries?
So why is this a good idea? Simply put, it saves time, code size and errors. For example if you parse a regular expression in one page or script, then copy and paste the snippet into another page, this will [probably] work fine. The thing is, you've got 2 almost identical functions or expressions that could easily be added to a class file or a utilities script.
Why do programmers write duplicate code? Well, some have limited experience, some are probably a little lazy, some are really under time pressure and some have just always done it that way.
In the deep mists of time [about 15 years ago] when java was still an island in the ocean somewhere, most programming languages were very proprietary and often procedural in nature. This meant that the program generally got called, started at line 1 and ended at the last line. This all changed significantly with the introduction of object oriented languages. Amongst other things, it made programming a lot more flexible.
Ok, I know a lot of guys and girls do this. Especially in multi-user environments. There are still plenty that don't. Have you tried to change the VAT in an app that had 'vat = value * 0.175' writen about 30 times? Yes, this [hard coding the rate] is a really poor way of doing it, irrespective of repetition. 30 minutes, a value in a config file and a few public static fields in my utilities class and the next VAT change takes 5 minutes.
Not only will a change take a fraction of the time, saving my client money [they'll probably get this changed for free, it's that easy to do], when you are debugging and testing, you know the VAT is correct everywhere or not. And any other developers that follow me on this will thank me for it. I curse the chaps who left me with this and 1001 other duplicated code snippet nightmares.
And this doesn't need to be reserved for php,asp or java. You can create javascript libraries of your own [just look at jquery, prototype et al. Just great big re-usable chunks of loveliness] as well as universal CSS libraries that include things you use in every project like clear, centred pages and a host of other things.
So, guys and girls, remember to use those utility libraries. It'll save you a lot of time in the future.
Post your comment
Comments
No one has commented on this page yet.
RSS feed for comments on this page | RSS feed for all comments
Tag Cloud
.net accessibility add ons adwords ajax asp asp.net b2b base blog blogs bookmark bots browse browser browsers c# calendar categories clients client side cloud computing cms collaborative config content management content management system cross browser cross browser issues css design designing dev development development tips ecommerce entity framework epdq facebook favourites froogle galleriffic gallery google hackers how-to ie ie6 ie8 intellectual property internet explorer ip javascript jquery json keywords killer apps layout managing expectations markup mashup merchant center microsoft mvc n2 cms networking new business new ideas nop nopcommerce nop gallery objectivity oen source office applications open source page rankings partnerships payment gateway payment gateways ppc products prototype qtip robots search engines seo slimbox social media social networking soft software source source code spam spiders taxonomy thin client tips tools tricks twitter useful viusal studio vulnerability wai wave web web2.0 web design web development web site creation web sites web tools xml youtube
Browse by Date
Subscribe via RSS
Follow us on...
N-WebDesign news
- Visual Studio 2010 & .NET 4.0
- 22/10/2009
- Windows Seven
- 20/10/2009
- Web Design Portfolio
- 19/10/2009
- You can now follow us on Twitter
- 02/10/2009
- Visit our Facebook page
- 22/09/2009









