Should you learn a framework?

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.

7 thoughts on “Should you learn a framework?”

  1. I’m totally agree with you. But I also thing that learning other framework is in some kind like learning new programing language. And is always good to see some other kind of opinion or development principle.

  2. Knowing at least one framework in the programming language you’re familiar with, is always good.

    *You don’t want to write code from scratch*
    The main reason you should know about frameworks is to avoid reinventing the wheel. A framework try to solve some issues in a way, with some advantages and limitations. *Well written frameworks often teach you good programming habits*.

    *Most medium size/big projects use frameworks*

    Another reason why you should know at least a framework in your favorite programming language is that most people are using at least a framework per project.
    Many job offers suggest that the company is “a top company” using many technologies. You often see job offers with many frameworks required, lots of acronyms, excellent communication, etc. For those kind of job offers, putting some frameworks and keywords, help you a lot. The companies often put all the frameworks they have used/are using, even if the job you’ll have won’t require any of them …

    If you know well the core libraries of your programming language, learning a framework is easy. If you’re not a junior developer, good employers and recruiters know that you’ll be able to learn it quickly.

  3. OK, so I’m sold. How do I make the “right” selection of which framework for PHP? Do I go with Zend? What should I look for in deciding?

  4. Personally, I’d advise learning Zend Framework at least. Because of it’s nature, you’ll be able to use at least parts of it in existing projects. On top of that, I also suggest learning a more complete framework (one that has a set methodology, Zend allows a more pluggable component set) – my suggestion is Symfony. However, my advise is generally that you should invest a little time looking at a couple, and use which ever feels right for you. I don’t believe there is one framework that shines above them all.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.