I don’t usually write this kind of blog post – but for once I think I have something useful to say. Today someone came into the symfony user channel, and asked if they should learn a framework. It’s an interesting question, to which I think the answer is unquestionably ‘yes’.
With other programming languages designed for the web, there’s typically a framework that works hand in hand. For Ruby, there’s Rails, Java has JSP/JSF, Struts and more, and of course C# and VB have .NET. Until recently, there’s not really been a PHP framework, and people have generally written from the ground up.
I imagine people will always write from the ground up with PHP, some people do it to learn, some I suspect think there’s nothing out there that can do what they want, where as others perhaps do it just to prove themselves, or to gain fame. Good luck to them all, some of them are probably going to do a good job, but alas – I imagine most are wasting their time.
There’s two sides to this argument, firstly from a business side, and from a developers side. Some businesses might see open source frameworks as a potential security issue. This is a long standing discussion which I won’t go into, but the security history of a framework is certainly something you should consider. When considering this though, check the security history of web applications written without a framework. There’s certainly a lot of applications out there, both open and closed source which have been written on top of their own designs that have been exploited time and time again.
Frameworks are built on top of the knowledge of tens, hundreds, or maybe even thousands of developers. Should a business have full faith in their IT staff to implement a secure solution, or is it best to rely on a larger pool of knowledge that’s stood the test of time? I think the answer here is obvious.
Aside from security concerns, businesses will enjoy an improved time to market. Frameworks are written to allow applications to be developed quickly and easily, with maintainable code. It doesn’t guarantee that code written under it will be of high quality though, so don’t assume that because you’re developers are using a framework, that the code they are writing is magically of equal quality.
My last point for businesses is that it will make it easier for you to find new staff and to replace old ones. It will be far easier for a new staff member to familiarise themselves with your application if they already know the framework within which it has been built.
I think there’s great reasons for developers to learn frameworks too; many of the reasons are the same as above. A lot of developers assume they know all about web security, and maybe they do – but we all make mistakes. Frameworks generally help protect developers from mistakes. Symfony, for example, has cross site scripting protection build directly in and it will insist that all form elements are validated before use. If won’t prevent security issues occurring in your application, but it certainly helps mitigate the chances.
Community support is another plus, if you need help with your application or with learning the framework, I think most frameworks have helpful friendly community members that will help with issues, even issues that go beyond how to use the framework itself. I know this is one area where Symfony excels.
Frameworks also often supply tools that help you get the job done quicker, allowing you to do more work, and ultimately earn more money. Again taking Symfony as an example, it has an admin generator that will help you build admin interfaces. There’s other features that help short cut development time.
I’ve spoken to a number of recruiters in the past, and all that I’ve spoken to about it agree that knowing a framework will help you get work. Some suggest that it doesn’t matter what framework you learn, providing you have good experience with one of the more common ones. A lot of the frameworks share similar goals , and achieve them in similar ways, so understanding one framework will help ease the learning curve of another. I’ve had many calls in the past offering jobs because of my involvement in Symfony, even from companies offering to relocate me to the other side of the globe.
There’s no doubt at all in my mind that there’s value in learning a framework, I only hope this post has helped a few undecided people see the light that I see.