Development Costs, Frameworks Vs Straight PHP
I'm looking to get several sites developed and am wondering whether it will be cheaper overall to get them developed in a framework or in straight PHP.
I have ideas for several types of social sites with the following parts: Wikis, tagging, voting, and commenting, very simple blogging. I would like to re-use the components across these开发者_开发百科 sites.
I made a decent start on one site but I'm really not moving fast enough. And as an untrained, mostly spaghetti code PHP programmer I'm afraid my code wont be taken seriously if I want to open the source up to outside contributions.
I understand MVCs are useful for rapid development but I'm wondering whether the reduced cost of development due to this is outweighed by the increased cost of hiring someone with framework knowledge.
I'm also concerned about the framework code going out of date, i.e. not being compatible with the latest framework version. I'm guessing the reduced maintenance costs outweigh the cost of upgrading? I have been looking at Symfony 2 as it claims to be as fast or faster than others.
Many Thanks
Here are a couple of things you have probably not thought about :
- Using a framework, your code will be structured a certain way (it'll follow the guidelines of the framework) ; this means it'll be easier for a new employee (who has already worked with the framework) to understand how the code is structured.
- Frameworks don't only mean MVC : they generally comes with a great library of solid components, well tested, well thought ; that's many wheels you will not have to re-invent
- Not being compatible with the new version of a Framework can be a problem, yes -- but do you think your code will be easier to maintain without a Framework ?
- A couples of days to re-works part of your code so it works with a new version of your Framework might be a good investment.
- If your code is properly structured (Model code in classes that don't depend (much) on the Framework, typically), updating will not be so hard
- Considering the number of fully-hand-made PHP 4 applications that are still arround, it seems a Framework is not what prevent people from upgrading...
On the other hand :
- If you do spaghetti code without a framework, it probably means you don't have that much experience -- which means you'll need a bit of time before being efficient with a new Framework (you'll need to learn it -- and, typically, this can require a couple of weeks / months)
If you don't choose to go with a framework the person that you hire will have to learn your conventions which will take longer for them to actually start producing results at a good rate. Essentially you will be making your own framework and you can bet on no one having any experience with it. With a framework, you at least have some common ground. You should still probably interview them solely on the basics of the language but when they start working they can go online and ask others questions about a specific way to do something in the framework. If you make your framework they might have to ask you for the conventions you want to use.
Frameworks are useful for getting off the ground. Remember that you can "give up" using the framework at some point simply by starting to diverge from the conventions used by the framework. You could simply take the framework code and make it your own. I'm ignoring any kind of licensing by assuming that this is going to be a web app.
It sounds like you either have or will get a php developer. Any decent php programmer should be able to learn any php framework in a few weeks.
Some frameworks are better at backwards compatibility than others. You'll have to compare in your research.
Yii is the fastest php framework I have seen.
Here is why you should go the framework route:
If you don't, you're going to find yourself reinventing a lot of wheels. Frameworks provide you with mature, stable libraries that will likely take care of most of the tasks you need to perform.
Finding developers with an understanding of the framework you choose is going to be much easier than finding someone and bringing them up to speed with your custom code base.
Frameworks have become so common place that you'd be hard pressed to find developers without experience with them. If there is any more cost associated with framework-experienced devs, it's minimal.
Some frameworks have easy ways to upgrade the code base - Symfony is one of them.
One note: do not use Symfony 2. It is not production ready yet. Instead go with Symfony 1.4, or if you're looking for a framework with an easier learning curve, CakePHP, CodeIgniter, or Kohana.
精彩评论