Etin Obaseki
“A boy becomes a man in the same way a seed becomes a tree. The seed has to die for the tree to grow and the boy has to leave for the man to show.” — Me
3 min read
Discipline Turns Art Into Science: Why Frameworks Are Important

Nosa always said he never liked PHP.

Even though it was the language of his first real web project, he always constantly complained about something or the other.

He said "PHP's really flexible, but it allows you write bad code".

A few months later, he had replaced PHP with Ruby on Rails as his web lingua franca.

Of course, bad code can be written everywhere and by anyone, but, your environment contributes a lot to the standards you'll hold yourself to.

PHP allows you do whatever you like. You can duplicate code unnecessarily, create several unnecessary files and have very messed up URLs.

Of course if you're very skilled, you can write PHP that puts Rails to shame in terms of code organisation, routing, DRY(Don't Repeat Yourself) Programming, Version Control of third party code and all the other things that make Rails great.

But, the odds are you're not Taylor Orwell (The Creator of Laravel) so you probably can't do all that.

And even if you can, is there really any point to reinventing the wheel every time you want to do something simple?

So, how do we apply these beautiful paradigms without reinventing the wheel?

Drum Roll....
Frameworks!!!

A Framework provides an abstraction of a Programming Language.
It groups regularly performed tasks together and makes them faster to perform.
It provides boilerplate code for you so that you don't have to write the most basic and obvious things every time you start a new project.
All this, it does so that you can focus on the parts of your application that are truly unique.

A friend of mine argued that frameworks stifled creative freedom by restricting you to do things only in certain ways .

I disagree completely.

While Web Programming is, in fact, an Art and requires plenty of creativity, it also requires plenty of scientific discipline for it to be successful and sustainable.

Science is "systematic study of... structure and behaviour... through observation and experiment".

A lot of people would define Art as "expressing oneself freely". This definition often assumes that Art is the opposite of Science.

Again, I disagree completely.

At it's highest level, Art becomes a Science. It begins to have the same precision as Quantum Physics. I'll illustrate.

A master of an Art does not merely express himself, his mastery enables to express himself within the structure of his art. He is much more productive and is able to more easily identify flaws in his work because he is following a structure.

The most obvious real life example is Leonardo Da Vinci. The artist responsible for the Mona Lisa as well as the scientific mind behind the world's first design of the helicopter.

The same measure applies to web developers. In a bid to express themselves, they abandon all structure and discipline. Leading to an unmaintainable monstrosity of code that doesn't make sense even to the original developer.

I've had a few jobs with such monsters. I still have nightmares sometimes.

So, whatever language you've decided to use, make sure to employ sensible design patterns to ensure that your code is maintainable by you and anyone else who needs to do it.

6
350 Views
0 Contributions