Introducing Jails and the art of building a Framework

There is a lot of fields which a programmer can choose to work and to specialize, once you find what motivates you, is pretty hard not follow your instinct. I was always the framework guy. I realized that creating frameworks is an art.


Why to write one?

I can only speak for myself, in my case is always that feeling that you’re repeating yourself, is a feeling that your code is not elegant enough, etc…Before you even start to write one, of course you have to make some research to be sure you’re not starting with the initial issue which is to not repeat, so is there a solution already?

Life does not have 1 answer for all the problems, programs are not different and you will probably find answers for your problems that doesn’t fit as you want or as you need, but it helps you in some cases. There’s another reason why you need to write a new one: Because you like. Because that’s what makes you feel alive, that’s your thing.

Learning and thinking by yourself

One of the best thing to write a framework is the learning part. We have a lot of different ways to learn something new, and writing a framework gives you a huge list of things to learn, some of them are not related to programming techniques or something technical, you will find yourself questioning things you have never thought about, it’s also a philosophy’s exercise.

Some people ask me why did I started such project when there’s options like Reactjs, Angularjs, Backbone, Ember… Well, I used them on some projects, but as I said before, they are not the answer for all the problems, so you will eventually find a case where you will not be free of repeating yourself, or it’s not modular enough or is not elegant as you’d like. Maybe you should write something that fits like a glove on your project.. You need to write when you are finally understanding about your project and why did you make so many mistakes…

Every project is singular. Also, I belive that to be a React developer, Angular developer or any other framework developer is awesome, you learn a lot with such different paradigms. But maybe sometimes you need to start to think by yourself.

About preaching…

People has different thoughts, there is a kind of developer which gets excited with a new technology or a new framework and it’s enough to make him happy. So he will now spend the time to understand that tool and make your applications even better. That’s really awesome. But there are other kind of developers that takes it very serious, I call them preachers…

The preachers are those programmers which not only selects the best solution, he also becomes the team player, he choose the library/framework and he is absolutely right that everyone should use that. Any other solution does not make any sense to use and they are worthless.

I realize when the subject is programming that, nothing is definitive. That sentence gets even more evident when we look at patterns, architectures and frameworks which were THE BEST solutions at that time but now is completely dead.

Don't write it, because…

When you write something on your own you will be tested. Not everyone has the same vision as you have about your idea, and they will argue. Some arguments are classic:

That framework A is consolidated. No reason to start a new one.

Well… it’s true… But not 100% true. You need to see other hidden parts. If you have a bug on your application using some consolidated framework, you will probably find the answer for some gotcha on stackoverflow.

But it turns out that your framework as any other will not solve all the problems and you have to write something that automates the relationship of the many parts of your application. Well.. that’s not in stackoverflow.. if your architecture is messed up, there’s no straightforward answer for you.

I’ve seen some mistaken architectures using Backbone, which is consolidated and it is one of the best frameworks we have. But the problem is not the framework. Also, A framework does not start already consolidated. It has to start somehow.

You think you can do better?

No. It’s not about to be better or worse, but give another solution, another perspective. It’s about to think in other direction. It’s about to try to be creative. And be creative doesn’t mean to be 100% original, some parts it is wiser to use some very known techniques but applied in a different way.

Jails — Micro-Framework


This is the best part for me, the part that makes me very happy… This is my project, my work… It’s the result of learning through many years of failures. It’s the result of thinking at all I’ve done in the past. It is my understanding about elegance.

It is also a result of learning from other frameworks too. It is Event-Driven, Modular and follows the Atomic Design philosophy. And one of my biggest concern is to keep it simple and with a very low learning curve.

I want to invite you to know more about Jails project. Even that you’re not convinced that it worth the time, maybe it can inspire you to think on something different and to think something on your own.

https://github.com/jails-org/Jails