The Square Wheel

Once upon a time, developers wrote all of their code from scratch. Just for the sake of "staying in control", and having not to bother around mysterious code implemented by someone else (in the wrong way, of course. Eithers' way is always wrong).

Then advanced "content management systems" raised, more and more articulated, able to provide more and more functionalities just adding and tuning a butch of external modules, which number grown more and more to cover more and more requirements. At that time, the idea of "avoiding to reinvent the wheel" began to make sense: why the hell implement again and again authentication, roles management, input validation, filesystem management and so on, when an instance of - just saying - Drupal, properly loaded with some of the many available plugins, did all of those and much more?

That had a cost in term of efficency, and on the other side requirements become more and more complex. In the ethernal fight between "tools flexibility" and "customers' ability to require that exact functionality which is not managed by any existing module", the latter wins. Always. But, after all, a CMS already manages most of the stuff, right? It's still not worth to reinvent authentication, roles management, input validation, filesystem management, right? Let's just implement the needed extra components and everything will work, right?

I give you a news: frameworks began to include that same set of functionalities everyone once implemented by themself, and began to introduce a modularized approach to include more and more stuffs, while still being frameworks, platform just made not to be "customized" but to build upon them exactly what expected.

composer create-project laravel/laravel --prefer-dist

Authentication is handled out of the box. And the ability to force it on specific parts of your application. And cross-site request forgery protection is included. Validation of every single incoming input is a function away, if you want.

composer require bican/roles

Bang!: roles management. And permissions for every single content or type of content, for a single user or for a group.

php artisan make:controller FoobarController

Ops: a RESTful controller, already inited to implement GET, POST, DELETE, ready to be used into the application or as an API for external components.

Did I mentioned abstraction for filesystem access, including remote storages? And the ability to build logical relationships between contents using a single line in the ORM model? Of course, mail sending (with attachments, and multi-parts) is managed. To be able to also receive them, you have to make the effort to digit another command and install another module.

CMS are of course a very useful starting point for many projects. Most of them, I have to say. But, as soon as a more advanced one is going to start, with many kind of interactions between many kind of contents and many kind of users, perhaps the objection about "wheel reinvention" is no longer so valid and acceptable Especially when you are asked for a square wheel.

(Edit: yes, I ranted against Laravel 5. I took just a week to be used again on it. As always, drastic modifications forcing us to change our minds are never instantly welcome, even when beneficial)

Show Comments