The Importance of Frameworks

I have been reluctant to publish this one. Mostly because I know it rubs some people the wrong way and it incites debate. But here goes...

The Importance of Frameworks

Frameworks


The short version of this article is this: Software development frameworks (frameworks) are very important. Some developers have given frameworks a bad name, particularly JavaScript, with a new bad framework popping up every 2 hours. You can choose not to use one but it is better that you do.

If you stop reading here take that away with you and think really hard about it. But I prefer that you read on and find out why frameworks are super important and why you are better off using one.

Structure

Well, obviously. It's in the name. Frameworks provide a familiar structure to software systems. That is not to say without a framework you cannot have structure. All software systems have structure. Some have good structure and some have very bad structure but they all have structure. What frameworks do is provide familiarity.

A developer who has never left Mongolia can jump into a project with a developer in Mozambique and be productive immediately. Not because they know each other or have worked together before. Simply because they are using a familiar/popular framework.

I have had cases where I have had a shorter ramp up time on an open source project than in my day job simply because the open source project uses a structure I have seen before and in my day job some wise guy decided to invent a new framework.

Security

This one may not be so obvious. It may in fact seem like the opposite. If you crawl the internet you will find troves of vulnerabilities for software frameworks. You'd be forgiven for thinking you are more secure if you just don't use these frameworks. However, what you may be missing is the fact that you can find these vulnerabilities on the internet because they have been found and most likely fixed or are getting fixed. If you don't use a framework then you are left to fight this battle alone and believe me, you will lose.

Go check at https://www.cvedetails.com/ how many vulnerabilities have been found and fixed in the code of your favourite software.

Battle testing

This is one of the most important reasons for using a popular framework. The reason why most companies have so much legacy code is because that code base has been battle tested and survived. Popular frameworks give you this battle testing for free. If a new feature of the Java Spring Framework comes out today, in a week it will have seen more use than what your in-house framework could see in months. If there are edge case bugs they will surface early and be fixed quickly.

Performance and Efficiency

This is a big one. This one is probably the most quoted against using a framework. You will hear things like "Ooh, the Django ORM is so slow though" and "Rails objects take up so much memory". I am not saying that those statements are false. In an effort to be general, framework code can be inefficient. However, this is not reason enough to not use it. This actually ties back to what I wrote about in my first post. People's reasons for choosing one technology over the other often have nothing to do with Engineering.

Good frameworks are written in a modular style that allows you to plug in custom software where you see fit. You find Django's ORM slow? Then stop using it and roll out your own. Instagram did. Don't throw out the whole framework and re-invent the wheel.

So what?

Some frameworks are really bad, they do not deserve your attention at all. Some call themselves frameworks when they are actually libraries. This can make it hard to choose a framework to use.

Some frameworks are overly opinionated to the point of stifling creativity. Some frameworks try to do too much and cater to a lot of use cases to the point of not being useful for any use case.

But, you still should use a framework. Perhaps I am not being helpful by not pointing out how to select a good framework. Let the Engineer in you guide you through that task. Having a framework will give you a few things. It will allow new people to your project to be almost immediately productive. It will give you free penetration testing. It will give you free battle testing and bug fixes. And if it is a good framework it will give you structure but allow you to customise to your needs. It will allow you to easily re-use software that other people have already written.

Echo

We all like to feel important and smart. So, when given an opportunity we will invent a new framework that our colleagues will be forced to use and we will feel like DHH. This is bad. It makes it hard for new Engineers to get productive. It wastes a lot of time writing software that someone else has already written.