Blog

Ben Barden - Life of a web developer

Why reinvent the wheel?

Posted by Ben on February 14, 2009 23:08 | 885 Hits | Permalink

I'm a coder, because I enjoy coding. Honestly - I love it! So when faced with a problem, it's hard to resist diving straight into it and writing some new code.

Sometimes though, this just isn't practical.

The WYSIWYG editor

When I first decided to include a WYSIWYG editor in Injader, I started by searching the web for clues on how to do it. I didn't know the first thing about building an editor, so I wanted to learn how to do it.

A few searches later, and I had enough info to get started - so I built a very simple editor. It did the job, but there were numerous problems. Keyboard shortcuts didn't work. There was no right-click menu. Inserting things at a specific position in the editor was very confusing, especially when you factor in different browsers.

Digging into some of these problems, I started to realise that building a WYSIWYG editor is not an easy task, and the code just ends up with loads of hacks for different browsers.

In the end, I replaced my clunky editor with TinyMCE, which does everything I want and a lot more besides. It's brilliant, and allows me to focus on the rest of the system.

Why reinvent the wheel?

The forum dilemma

Many social networking sites choose to build their own forum as part of the site. Flickr, last.fm and BlogCatalog spring to mind.

How hard can it be to build a forum? Who needs all those features, anyway? Perhaps we don't need them all every single day, but some of the features in a "proper", standalone forum can make life so much easier for members and admins alike.

With CMF Ads, I took the opposite approach from most other sites. I installed vbulletin and built the rest of the site from that. Not only did I use an existing forum platform, I also avoided coding yet another login system.

In the end, this worked beautifully. I didn't have to provide a sub-standard forum, nor did I have to try and integrate vbulletin with an existing site. One login ID is good for the whole site. The members like it, and it reduces support queries - I think we've had just one query relating to a login problem, and it was a forgotten password. That means we can spend more time improving the system and promoting it to potential members.

The downsides of reuse

Although both of these examples have worked out very well, there are some drawbacks with using third party services instead of coding things yourself:

  1. Integrating a third party service with an existing system can be a high risk change. (but it depends what you're integrating)
  2. Some third party products will cost you money. Writing your own code will take time. Time is money - it's up to you to decide which is more expendible.
  3. If there are issues with the third party code, you may be at the mercy of the third party if you are not allowed to modify the code yourself, or you are unable to (due to not knowing the language or not having access to the source).
  4. Because the code is likely to be generic, written for the majority of customers, you may find that your site has more specific needs than the third party code is able to meet.

Weigh up all the options

Sometimes a third party product may work out well, but it shouldn't be used as a "quick fix". Ensure the product is fit for purpose, or you may be wasting your time and money.

Writing your own code is good if you have very specific requirements. If you can build from an existing system, that may give you a good head start.

Image by frozenminds.

Want to read more posts like this? Subscribe Subscribe!

< A new beginning | Blog | Entrepreneurs: how committed are you? >

Comments on Why reinvent the wheel?

Tags: code reuse, tinymce, vbulletin

* Required Fields. Email will not be shown.
Help

Copyright © 2010 Ben Barden - Life of a web developer | Powered by Injader