PHP/MySQL - Coding from Scratch vs. Using a Framework?

Do you code from scratch or use a framework?


  • Total voters
    2

Porthos

Newbie
Joined
Jun 23, 2012
Messages
38
Reaction score
2
I have always coded from scratch, and am interested in hearing everyone's opinions on the subject of using a Framework to begin developing your applications.

-Does it really save time to use a framework?
-How long does it take to learn any specific framework? Hours? Days? Months?
-Which framework is the best? The easiest to learn? The most efficient?
-Would you rather code from scratch?

Personally, I never took interest in frameworks as coding from scratch has always served me well.
However recently, I have been hearing a lot of buzz about how much faster you can supposedly get your projects finished.
Truth?
 
Nice poll.

I will have to start implementing the poll function in my later posts.
 
Last edited:
I would definitely recommend using a framework. Even though it might take more time for your first project because of the time involved with learning it, it will payoff with future projects. Benefits of a framework include easy file organization, security, support, and something new to have in your skill-set for future freelance work. Some popular frameworks off the top of my head include Codeigniter, cakePHP, and Zend.
 
-Does it really save time to use a framework?
Yes. Frameworks normally have utilities already set up, along with a directory structure to follow. Coming up with your own would normally take severel revisions before it becomes coherent enough. They also are normally MVC based which makes it easier to understand the flow of data and modify to your needs.

-How long does it take to learn any specific framework? Hours? Days? Months?
Zend Framework, the largest, would probably take a year and that's scraping the surface. They have their own certifications. May as well call it PHP itself. You'll use it, but you'll never learn all of it because you don't need all of it.

-Which framework is the best? The easiest to learn? The most efficient?
There is no "best" framework in a general sense. Best can be the easiest to learn, the most efficient, the most mods, the easier templating system, the better implemention of objects... pick your poison. Zend is usually used for large projects, and it has a huge amount of plugins/mods. CodeIgniter is probably the easiest to learn but is lacking in the mods department. When you get to authentication, you will be picking a poison. None of them have everything you would want in an authentication. Yii is a powerful one, but it takes longer to learn than CodeIgniter. The mods I find for auth are better and there's around 1-2k mods IIRC. Cakephp is another but I've not looked into it extensively.
Personally, I'd go with Yii. I just like it more.

-Would you rather code from scratch?
Depends on the project. If I'm making 1 or 2 pages, yes. Anything that requires authentication, security or extra functionality that needs to be similar across everything then I'll go with a framework. Keep in mind a framework is just that. You will be coding something yourself. Be it a change or something entirely new.
 
Depends. Zend for example has a good number of good features but it does have a lot of features that are completely useless and it does make bulky. It really narrows it down to what you are going to do. For a more general purpose project-framework. for something that is too specific-from scratch...
 
frameworks, I don't want to reinvent the wheel each time
 
Another "it depends" answer...

Frameworks will take a little while to learn, and they'll seem a bit overwhelming at first. Codeigniter is awesome as soon as you get it though.

The cool thing about them is that as you learn more of the framework's in-built functions, you'll start to get faster and faster at coding - it's the only real way to improve once you've learned all the PHP basics.

However, if you're doing something basic, like a project that'll only take 1 or 2 days from start to finish, I probably wouldn't bother.
 
I prefer framework to save some time and spend more time on productivity :)
 
CodeIgniter.

I develop so much faster since I started using it. Also it's really easy to just copy/paste from former projects without changing much code.
 
I used to use CodeIgniter extensively; but have now found that for what I need to do, a framework is normally overkill.

Most sites I build run in a very similar fashion, so I simply replicate my old site, and work from my hand-written code. Keeping everything nicely commented and tidy and simple, in my opinion, can save a lot of time compared to running with a framework.

An exception is large projects, I would use CodeIgniter on any project that was going to take more than 2 weeks solid coding.
 
It depends how large the project is. If it's a large project I usually use a framework, sometimes custom, sometimes "out-of-the-box".
 
As stated above, I guess it depends on your needs. If you build one to two sites a year the payoff for the learning curve probably won't be worth it, especially if you have your own repository of past projects you can build from. But if you're looking to get serious, as well as build a skillset that can be something else to throw on the ole' resume, then definitely pick a framework and get studying.

While a framework helps a lot, I think the most overlooked development practice that will save you tons of time is finding and learning a proper IDE. I still know "php programmers" I went to college with attempting to build full scale projects with notepad++, which is fine for quickie edits but c'mon. It's like trying to build a damn house with hand tools.
 
I prefer to use a framework, depending on the project's complexity.
 
I've gotten simple jobs done faster by hacking a framework, but I've also gotten full projects done faster by coding from scratch.

Obviously programming from scratch is going to be a longer process if you are dealing with a large scope. But using a framework would make more sense only if we're assuming you've had training in it (or some experience at least).
 
Depends what you're doing. Are you coding a PHP bot? Or are you running a website? Most of the frameworks are geared towards running a website.

CodeIgniter is great, as are the forks.. My favorite being FuelPHP.
 
I don't really get into frameworks due to the simplicity of the stuff I do. I also find that the bases of frameworks are so huge that I just get overwhelmed. If I ever have a large scale project I am sure a framework would come in handy.
 
I always code from scratch. I find using a PHP Framework is like having to learn a whole new programming language and most frameworks aren't ideal for redistributed code (ie: some servers might have codeigniter installed and some don't).
 
I don't generally use frameworks because:

1) I'm mainly coding bots so they're not so relevant.
2) Some frameworks don't maintain backwards compatibility, and if they change the interface you can be left with a bunch of broken apps.

I have my own personal framework that I've made for writing bots and so I can be confident that I'm not going to break anything. Sometimes I will rip a function or method out of a framework and incorporate it into my own framework, but I try to avoid having to include someone else's entire framework.
 
I think it is always a wise choice to chose platforms to get your system designed. If you do not have enough idea about that language then you can not do that easily. So to make it simple you should use platforms.
 
Back
Top