skip to content rich footer

stevenclark.com.au

subscibe to the StevenClark.com.au rss feed

Archive for the 'ruby' Category

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?

skip to top of page

Currently Reading

Mental Models by Indi Young (cover)Developing software from the user's perspective as opposed the organisational one is a critical area we need to work on as designers. I'm reading Mental Models by Indi Young, a book about understanding users' reasons for doing things and one system for understanding and designing for those reasons.

It's important to understand that when people visit your website they bring with them their own world view, motivations, experience and expectations. And, by working with those factors, we can improve our game significantly by providing them with what they want and need.