1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'PHP & Perl' started by Porthos, Jul 21, 2012.

?

Do you code from scratch or use a framework?

  1. I code from scratch.

    0 vote(s)
    0.0%
  2. I use a framework.

    0 vote(s)
    0.0%
  1. Porthos

    Porthos Newbie

    Joined:
    Jun 23, 2012
    Messages:
    38
    Likes Received:
    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?
     
  2. mezzie911

    mezzie911 Junior Member

    Joined:
    Jan 10, 2012
    Messages:
    183
    Likes Received:
    28
    Location:
    A-Z BA-BY
    Nice poll.

    I will have to start implementing the poll function in my later posts.
     
    Last edited: Jul 21, 2012
  3. Instant

    Instant Newbie

    Joined:
    Aug 25, 2009
    Messages:
    28
    Likes Received:
    10
    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.
     
  4. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    -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.
     
    • Thanks Thanks x 1
  5. loki_

    loki_ Registered Member

    Joined:
    May 20, 2012
    Messages:
    63
    Likes Received:
    8
    Location:
    #!/bin/bash/
    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...
     
  6. mazgalici

    mazgalici Supreme Member

    Joined:
    Jan 2, 2009
    Messages:
    1,489
    Likes Received:
    881
    Home Page:
    frameworks, I don't want to reinvent the wheel each time
     
  7. james406

    james406 Junior Member

    Joined:
    Feb 22, 2012
    Messages:
    124
    Likes Received:
    65
    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.
     
  8. extremeboy

    extremeboy Jr. VIP Jr. VIP

    Joined:
    Jul 8, 2010
    Messages:
    2,993
    Likes Received:
    648
    Occupation:
    World Best RANK Tracker SERPCloud.com
    Home Page:
    I prefer framework to save some time and spend more time on productivity :)
     
  9. hehejo

    hehejo Newbie

    Joined:
    Dec 6, 2009
    Messages:
    4
    Likes Received:
    0
    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.
     
  10. codo3500

    codo3500 Regular Member

    Joined:
    Dec 19, 2010
    Messages:
    335
    Likes Received:
    169
    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.
     
  11. t0.sh

    t0.sh Registered Member

    Joined:
    Jun 6, 2012
    Messages:
    55
    Likes Received:
    24
    Location:
    UVB-76
    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".
     
  12. jonbenwaa

    jonbenwaa Newbie

    Joined:
    Jul 6, 2012
    Messages:
    12
    Likes Received:
    5
    Occupation:
    web dev
    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.
     
  13. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,155
    • Thanks Thanks x 4
  14. Namun

    Namun Junior Member

    Joined:
    Sep 13, 2008
    Messages:
    136
    Likes Received:
    175
    I prefer to use a framework, depending on the project's complexity.
     
  15. Tensegrity

    Tensegrity Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 22, 2009
    Messages:
    1,824
    Likes Received:
    969
    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).
     
  16. devnull

    devnull Registered Member

    Joined:
    Aug 25, 2010
    Messages:
    55
    Likes Received:
    8
    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.
     
  17. nbbrad

    nbbrad Newbie

    Joined:
    Jun 25, 2012
    Messages:
    4
    Likes Received:
    1
    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.
     
  18. ub3rst4r

    ub3rst4r Junior Member

    Joined:
    May 12, 2012
    Messages:
    126
    Likes Received:
    49
    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).
     
  19. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,041
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    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.
     
  20. Blackberry_11

    Blackberry_11 Regular Member

    Joined:
    Apr 17, 2011
    Messages:
    266
    Likes Received:
    19
    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.