ramblings on PHP, SQL, the web, politics, ultimate frisbee and what else is on in my life
back

Good design is no excuse for wasting time

Symfony 1.x I would put into a category of frameworks focused on RAD, aka rapid application development. There are many other frameworks I would put into this category like CakePHP, Yii, CodeIgniter. All of these frameworks have their roots in the pre 5.3 days of PHP. I say this mostly because there has been a considerable shift in development methodology since then towards more decoupling and application of design patterns. As such these older RAD frameworks to me cut corners to be able to focus on the use cases they wanted to focus on. Now this is a quite legitimate approach, we all know that in order to make a solution truly generic it takes a considerable increase in effort and complexity. So focusing on 80% of what web developers need to do on a daily basis makes sense. This is mostly achieved by providing either base classes or the ability to use configuration files and conventions to reduce the amount of code needed to achieve functionality. However these frameworks tend to become quite painful when dealing with those other 20%. At that point they can actually become a hinderance and so you start to loose some of the benefits you gained for the 80% you worked on before. With Symfony2 we took a different approach. I would not call it a rapid application development framework. All it really does is add some more high level abstractions but it stays short of providing an out of the box solution. You still need to write the code and that code tend to be very explicit.

So for those people who were happy focusing on the 80% use case Symfony2 is a step back. Suddenly the same features take longer to implement, take longer to modify later on and on top of that the learning curve is steeper. I think the people that most appreciate Symfony2 today are therefore people that keep themselves busy with projects that mostly deal with the 20%. These people are in fact more productive with Symfony2 than they were with any of the RAD options I mentioned above. For these people the learning curve was also not that steep, because the type of work they were doing already required a deeper understanding of architecture and design patterns.

Now even those mostly dealing in the realm of 20% will spend at least some of their time with repetitive tasks like whipping up a few CRUD forms, ie. exactly the type of stuff the RAD frameworks cover pretty well. Furthermore just because Symfony2 is verbose at its core, doesn't mean that one cannot add RAD layers on top. The nice thing with a RAD layer on top of such a powerful framework like Symfony2 is that if you reach the end of what the conventions cover you can drop down one layer and keep going without hitting a brick wall as one tends to hit with a RAD framework like symfony 1.x. There have been some initiatives in this direction. For example FOSRestBundle provides a solution to generate routes from Controller method names. SensioFrameworkExtraBundle provides similar capabilities powered by Annotations and helps with mapping request data into model instances. SonataAdminBundle can do a lot of the heavy lifting when dealing with CRUD forms. KnpRadBundle is one of the few approaches that tries to really provide a comprehensive solution for RAD development. In general I was hoping that now almost 2 years after the first stable release we would be much further. That the solutions would be much better polished, mature, well documented and widely in use. So lets stop wasting time and lets get to work on providing a proper RAD tools chain!

Comments



Re: Good design is no excuse for wasting time

Thanks for mentionning the KnpRadBundle.

The bundle is actively maintained so feel free to try it, and of course propose or ask for new rad feature!

Here's the official documentation: http://rad.knplabs.com

Cheers!

Re: Good design is no excuse for wasting time

I agree with this post. Personally i never worked seriously with a real RAD framework, more the sort of crap frameworks so symfony2 really came as a relevation.

Regarding RAD, i think the CMF initiative is also bringing some really cool shortcuts. For not-too-special cases, you can build a site by defining content types and templates for them, then the user creates those instances and routes and the rest happens automatically. With the twig functions, the template can even do some navigation jobs.

Re: Good design is no excuse for wasting time

I also agree.

The problem is that Sf devs are just a fraction of php devs, and for any framework-on-top-of-the-framework, you get even less developers => less qa / documentation / evolution.
This is the joy and bane of all platforms which allow plugins - as long as any plugin does not get accepted as "the" official plugin to do something, the many competing options will evolve slowly.

I work with eZPublish, which is a CMS as well as an SDK, and there are 2000 plugins from the community, but those which have gone beyond version 1.0 are probably less than a hundred. This makes it extremely productive to use the CMS when you have a lot of experience with it and are comfortable with doing lots of configuration / manipulation / integration, and frustrating when you are a newcomer.

We recently moved the CMS to use Sf2 for the good reason that we could take advantage of the bigger number of devs working on the framework, and concentrate on the higher-level functionality. But I guess all non-rad-platforms see the same usage/evolutive patterns :-)

Re: Good design is no excuse for wasting time

I completely agree Lukas. As a framework user rather than a framework builder, I do miss the RAD aspects - I'd guess 80% of my code can be boiled down to the same patterns. Having more pluggable RAD components than Symfony 1.X provided would be great - I have a list somewhere which I must dig out and blog. If you want it sooner than I blog drop me an email and I'll send it over.

Re: Good design is no excuse for wasting time

Yep, most of my work now fits into that last 20%, but the other simpler jobs are definitely slower on SF2.

Dbu, maybe CMF will be the way, but I'm not sure how suitable for RAD it is at the moment - it takes a good day or two just to get it installed atm!

Re: Good design is no excuse for wasting time

@Andy well the CMF is definitely no general purpose RAD thing, but highly specific to content management tasks.
Regarding the time it takes to install it, that is about learning curve, not about how fast you can be to use it. The documentation is definitely not there yet, but once you know how to use it, you have set it up pretty fast. I guess even a good RAD tool will take you some time the first time you use it.

Re: Good design is no excuse for wasting time

It's great to stick with KnpRadBundle. I've created a symfony-skeleton that helps to jump into the thing a little faster https://github.com/mhlavac/symfony-skeleton.

It comes with preconfigured FOSUserBundle, oauth, rest and things like that, but i don't have enough time for it lately so it stays as it is :(

I am also working on virtual LAMP https://github.com/mhlavac/lamp-install-script which would allow users to set up their environment with linux. It comes with automatic virtualhost creation and other neat features to make novice developer start faster and easier.

Anyway it's true that sometimes the level of abstraction leads to more code, more time spend on learning and even more time spend on working on projects. I've personally started using symfony because PHPUnit and how easily are service testable when they use service container, but this applies only with bigger projects where unit tests can spare you 90% of your time.

Re: Good design is no excuse for wasting time

You are right but the lack of backward compatibility (migrating projects from sf1 to sf2) + the longer learning curve + the increase of time to do simple jobs, made most of us keep using sf 1.x and search for another framework that has full backwards compatibility.

Re: Good design is no excuse for wasting time

Did you know Over the years, particularly from the nineteen sixties and onwards the t-shirt has become an important mode of self-expression and advertising. Thanks to its prominent position and convenient focus with eyelevel, it has become an extremely effective way of ensuring one’s message, joke, or belief system can be recognised easily.

Before you can post a comment please solve the following captcha.
your name