Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

First of all let me explain who I am: I am a PHP Developer working for a company developing their CMS which handles online stores, data feeds and other content like blogs. I have been programming for 6 years and 4 of those have been in PHP. (I used to be a C# developer).

My question is regarding PHP frameworks. I see so many jobs asking for zend, cakephp and other MVC types of frameworks. However, even as an experienced developer I have never used a PHP framework. Should I start learning? If so where do I even start as there are so many.

I am about to re-write so much of my work's CMS and I'm wondering whether I could help myself a lot by using a framework. What do people think? Considering I will be re-writing a lot of the online store stuff... I am experienced in OO and I have used the .NET framework in the past.

Thanks in advance for the replies.

share|improve this question

closed as not constructive by GrandmasterB, gnat, ChrisF Nov 23 '12 at 14:06

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

6 Answers 6

In general, a framework is a tool which helps you to avoid reinventing the wheel, thus being more productive. In a particular case of PHP, a framework is also a way to abstract and hide some stupidities and inconsistency of PHP itself, while having a side effect to encourage some people to adhere to best practices in a context where the language itself encourages rather poorly written, poorly architectured code.

So yes, a PHP framework is definitely a thing you should learn if you want to be qualified as an experienced PHP programmer, while the choice of using it or not is up to you for every project you work on.

where do I even start as there are so many?

Learn two or three popular ones. Once you know those quite well, it wouldn't be difficult:

  • To know which one should fit a particular need for a given project,

  • To quickly discover less popular ones and see in which situations would they be more valuable compared to the ones you already know.

share|improve this answer
    
Thanks very much for the thorough answer. Very much appreciated. As someone who is re-building an online shopping cms, what framework would be good to look into? –  30secondstosam Nov 22 '12 at 23:10
    
@30secondstosam: I'm only familiar to CodeIgniter and much less to Zend and Symfony, so my personal opinion (which is "CodeIgniter is the best") on the best framework for rebuilding shopping CMS would be useless. –  MainMa Nov 22 '12 at 23:23
    
One small question for you MainMa: What is your position regarding the inclusion of a few of these framework in the PHP language itself ? –  Radu Murzea Nov 23 '12 at 8:57

It seems to me that the choice to use PHP will lead to you either using someone else's framework or building one.

"Framework hell" is a very real problem (or set of related problems) that are not unique to PHP, and there are no "silver bullet" frameworks. In short, all frameworks are 90% solutions in the end; Early progress in developing with a framework will almost always be faster than without. Getting the last 10% of the way is going to be either (a) really hard or (b) consist mostly of giving in and letting the framework win, and decide some elements or limitations of your design.

I say all of the above without saying that any framework is great, or bad. Such a question is unanswerable. Try a framework on a small project or a small chunk of your big project, and see if it fits. Be ready to kick it to the curb if you determine it doesn't work for you.

There are enough frameworks for PHP that you could probably evaluate them forever. But sooner or later you'll find one that's close enough. Close enough is enough for Rock and Roll, and many PHP websites.

share|improve this answer

What web frameworks do is wrapping all the request-response-cookie-session stuff into an API. So you get an easy interface to work with.

Some have more battery included and provide librairies to handle forms , databases , validation ,etc ...

My opinion :

  • if you have a lot of legacy code : chose a micro-framework that will help you organize php code : slim , lavarelle , silex , ...

silex is great since it'll help you learn Symfony at the same time.

If you have time , learn big stuffs like ZF or Symfony.

A big frameworks usually means a complete stack. For instance learning symfony means learning Doctrine, Twig , Assetic, using Composer ,monolog,... so people hiring you know you know all that stuff.

share|improve this answer

Frameworks are great for reducing ramp-up time. Using a well known package and following industry-wide conventions is the difference between a developer new to the project making meaningful contributions within hours vs. days, or even weeks.

share|improve this answer

Whether you should 'learn frameworks' or not... no one here can tell you what you will need to know in the future. I've been coding in PHP for over 10 years, and have never needed to use a 3rd party framework. The types of projects I work on just dont call for it. A lot of projects fall into that category.

That said, its important that you understand what the frameworks are doing. Whether you do that by learning existing frameworks, or creating your own... thats what you should really be after. Dont assume you'll be working in PHP or C#, for example, 10 years from now. Understanding the concepts behind the frameworks will be what moves you forward. Knowing the specifics of XYZ framework wont help you unless you expect to be locked into your current technology stack.

share|improve this answer
    
VERY disappointed you closed this. Clearly it wasn't a bad question otherwise people wouldn't have bothered answering. But so many did. And they gave me very productive replies, unlike yours. –  30secondstosam Nov 23 '12 at 18:55
    
I'm very disappointed you didnt read the site's FAQ that specifically lists these types of 'what should I learn next' questions as off topic. Yours was borderline, since it was more specific to frameworks, and could have gone either way, which is why I also answered it. But consider your question was basically 'should I learn something?', to which no one is going to say 'no, dont learn something'. A pretty pointless question. –  GrandmasterB Nov 23 '12 at 19:24

As someone who was recently in the same position, I would definitely encourage you to go with a framework. When I started with my current company a few years ago I didn't really see the point to using one - after all I was the only developer at a fairly small firm. Fast forward a few years and now I'm in charge of a team of developers, and we have a small army of websites, web apps, client projects, APIs, social apps and CMSes supporting offices in four countries. Having one or two frameworks that everyone can work from as a base makes us far more productive, and makes it easier to recruit people when we need them. It also allows us to more easily jump from one project to another when deadlines shrink or something else comes up.

My advice is to spend some time trying out a few frameworks. Try to make the same relatively simple site that has basic versions of the PHP functionality you need. Once you get through this with a few templates you will start to get a feel for which ones suit your needs and personality as a coder.

share|improve this answer
1  
thank you very much for your empathetic response. Very productive! I am in exactly the same position. Lone developer. And have been told if the company expands, I will be their manager! –  30secondstosam Nov 23 '12 at 18:57
    
Then best of luck to you! Growing with a company as they do has been a great experience for me. There are a lot of things I don't enjoy about being a manager now (I wish I had more time to write code!), but I have a new thing I find rewarding now, which is watching younger developers smile when they find a solution to something that seemed impossible a week ago. –  Kenzo Nov 30 '12 at 16:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.