skip to content rich footer

stevenclark.com.au

subscibe to the StevenClark.com.au rss feed

Archive for November, 2007

A Framework Question for Code Purists

Monday, November 26th, 2007

I’ve got a small question for code purists who suggest frameworks in themselves are bad because wheels need reinventing by every coder who came after us.

My question: why is it different using a framework of prewritten code? As opposed to a Content Management System (CMS) or ecommerce solution of pre-written code?

I ask this because somewhere in that argument is the perceived ideal of the coder generating pure unadulterated markup, styling and behaviour without using anything that came before. In my humble opinion this is exactly what you do when you pick up content management, blogging software and any number of web solutions out there. So why is it so different to picking up a library or framework and getting on with the job? Even a code purist must admit they couldn’t build the e-commerce site without that pile of pre-written code on the server. It all comes from somewhere. Even a lot of code you generate yourself is either inspired directly by, or includes legacy portions of, the code of your peers and teachers.

Here’s an example. Say I’m a new programmer learning Java and I need to do a gritty little thing like work out the circumference of a circle of given radius. Not only that but I need to take that circumference and output it as a rounded figure to the nearest centimetre. Do I really need to know the math involved in figuring the circumference from the radius? Or how to round a number? No. Why that is a no is because a fundamental part of programming is the use of functions to complete otherwise mundane tasks. And that reuse of code makes for less errors than if everyone jumped in and had to write the math part themselves. Functions speed up the process of development, make programs more compact and readable, and they improve the quality of the code by drawing on one source consistently to achieve the same functionality.

Which brings us back to libraries and frameworks. In essence they sit on top of the language – for example Rails sits on top of Ruby – where functions can be called to achieve tasks which might be repeatable across projects. There’s nothing new about that paradigm at all. Its exactly what happens, in a general sense, when I implement a shopping cart with someone’s prewritten code. So why is this all such a bother to code purists?

Social Networking

Keep an eye out for me on Twitter

About the Author

Steven Clark Steven Clark - the stand up guy on this site

My name is Steven Clark (aka nortypig) and my passions are business, web development, photography and writing. My current CV [PDF 619KB] is available for download. I have an MBA (Journalism and Media Studies) and a Bachelor of Computing from the University of Tasmania.

Photography

My photography is at Steven Clark Studio and my regular photo blog presents an ongoing stream of latest images at Walk a Mile in my Shoes and I'm working on a long-term photography project called the King Island Project.

Recently Reviewed Books

Site Supporters

Hosted by Brett Drinkwater at Tashosting who is always there at the other end of my every inconvenient question and technical crisis. Brett's local community support for us over the last five years is greatly appreciated.

skip to top of page

Currently Reading

Ansel Adams: The Camera

As the first of three parts of Ansel Adams Photography Series, Ansel Adams: The Camera begins by discussing the idea of visualisation in relation to photography. Ansel Adams is a master of his craft; this series has sat on my backburner for some time. Book 2 in this series is The Negative and it's followed up by The Print. In them Ansel outlines his philosophy of photography rather than trying to lay down a set of rules. This first instalment is a technical book that explains the good old fashion film camera.