SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Evangelist
    Join Date
    May 2006
    Location
    Austin
    Posts
    401
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Opinions PHP Framework vs. Coding

    I wanted to get some input on using a PHP framework vs. standard php coding for a project that I am undertaking.

    Basically, this is for a large internal web based application. The application itself is fairly light, but will have many functions in relation to a large customer oriented database (CRM, Messeging, Ordering, etc.). Initially I though straight php would be the best route. This requires several very complex classes, and I am finding that I am going to need to integrate a fair amount of Javascript / AJAX into the application which brought me to using a framework. CakePHP initially comes to mind with the addition of the Ajax, and after finding that the Ajax I need to use is a complete pain to integrate with.

    I haven't used a framework in the past because they seem unnecessarily heavy in code and I'm confident that I can easily write scripts that will outperform most frameworks. Additionally, knowing exactly what is going on in a script is something that I find comforting.

    I already have a decent amount of code started including a login system and some basic viewing / editing / management classes, but I'm at the point where I need to decide to move on, or switch to the framework.

    Anyway, would like some opinions from those who have used frameworks in the past, Cake PHP w/Ajax would be really great, and why this would be good or not good to switch to.

    Thanks
    Merchant Equipment Store - Merchant Services, POS, Equipment, and supplies.
    Merchant Account Blog | Ecommerce Blog

  2. #2
    SitePoint Member Aedus's Avatar
    Join Date
    Nov 2007
    Location
    Abu Dhabi, UAE
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally, I have just started really using pre-build libraries (mostly in the form of PEAR packages). But I've only worked on personal projects in the past.

    If you are doing customer work, time is money.

    Frameworks, libraries, and packages are not only ready to use (with a little bit of learning curve) but they also offer additional benefits. Documentation for one, anyone else that picks up the project with you, or later, will have an easier time in most cases. Testing, all respectable projects are going to be well tested and error free in their stable releases. Support, almost everything has a community of users and developers now-a-days, that can seriously reduce the learning curve needed to use their framework.

    Disclosure: I have never used CakePHP

  3. #3
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Knowing exactly what is happening in a script using a framework can be even easier in many cases. Frameworks are good for large projects, which is what you seem to be describing. However you mentioned that you will doing a lot of AJAX, which really a separate issue. Even if you don't use a framework, and just use re-usable classes, there are packages such as SAJAX and XAJAX that are designed to make using AJAX with PHP easier and faster.
    Visit my blog
    PHP && Life
    for technology articles and musings.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2008
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Frameworks save you from implementing items that are quire common and allow you more time to work on the other parts.

    Use a framework to save time.

  5. #5
    SitePoint Evangelist
    Join Date
    May 2006
    Location
    Austin
    Posts
    401
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hammer65 View Post
    Knowing exactly what is happening in a script using a framework can be even easier in many cases. Frameworks are good for large projects, which is what you seem to be describing. However you mentioned that you will doing a lot of AJAX, which really a separate issue. Even if you don't use a framework, and just use re-usable classes, there are packages such as SAJAX and XAJAX that are designed to make using AJAX with PHP easier and faster.
    Both of those packages look like they would fit what I'm doing very well. Not sure which route is better at this point. Frameworks definitely have a lot of benefits like built-in re-usability, and would probably save a lot of time in not having to code out all of the little stuff. But, re-learning how to do things that are second nature is a pain.
    Merchant Equipment Store - Merchant Services, POS, Equipment, and supplies.
    Merchant Account Blog | Ecommerce Blog

  6. #6
    SitePoint Evangelist
    Join Date
    May 2006
    Location
    Austin
    Posts
    401
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think symfony is a better match after comparing what's out there. I've been playing with it for a while here. Installation was no problem.

    What's the typical learning curve to be able to properly use a framework. So much says it's completely natural if you are a php developer, but there is nothing natural to it, at least not in the configuration aspect.
    Merchant Equipment Store - Merchant Services, POS, Equipment, and supplies.
    Merchant Account Blog | Ecommerce Blog

  7. #7
    SitePoint Guru Skyblaze's Avatar
    Join Date
    Jul 2005
    Location
    Italy
    Posts
    734
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i use only a framework to develop even for a static site made of few pages (using caching). I use symfony 'cause i think it is awesome!

  8. #8
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would only use a framework when you got large projects, but with smaller projects i use pure php + my ready made classes.

  9. #9
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would reccomend using a framework, life will be much easier and you won't get frustrated over small errors.
    Have a good day.

  10. #10
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    Baltimore, MD
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since I began using CakePHP the time I spend developing websites and web apps has gone through the floor, and I don't make stupid mistakes and create hard-to-find bugs that eat up time after development or, heaven forbid, after delivery. I have no idea how I ever lived before I began using frameworks.

    Things that used to take days to do -- and were sloppy and buggy even then -- are done cleanly and quickly and in hours. It's really just the greatest thing in the world.

  11. #11
    SitePoint Evangelist
    Join Date
    May 2006
    Location
    Austin
    Posts
    401
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It looks like Frameworks are one of those, once you start, you don't ever go back.

    I guess the biggest hurdle is the learning curve. Unfortunately this seems like one of those walk before you run situations, where coding a large, multi-function application isn't something that you can jump right into. Anyway, thanks for the input so far.
    Merchant Equipment Store - Merchant Services, POS, Equipment, and supplies.
    Merchant Account Blog | Ecommerce Blog

  12. #12
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    Baltimore, MD
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got started by refactoring an existing complex site into CakePHP. It worked really well because the code and functionality was already done, so I wasn't working from scratch. I just studied the framework's documentation and tutorials to figure out what I needed to do to get my app working like it was supposed to. When I finished that, I was more than ready to start coding from scratch.

  13. #13
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    hamburg, germany
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jestep View Post
    I haven't used a framework in the past because they seem unnecessarily heavy in code and I'm confident that I can easily write scripts that will outperform most frameworks. Additionally, knowing exactly what is going on in a script is something that I find comforting.

    I already have a decent amount of code started including a login system and some basic viewing / editing / management classes, but I'm at the point where I need to decide to move on, or switch to the framework.
    then you have to use zend framework as you may pick&use the relevant components only, which are very high quality.

    e.g. you may use the controller and auth-components only and reuse all your business-logic classes.
    as for the ajax-thing: personally i have created a "ServiceController" which re-dispatches to Service-Classes which are service-controllers for the ajax-calls. thats about 50 lines of code and you have a stable service-impl for all sorts of stateless ajax-calls...

    i would always use zend-framework as it's really a bunch of highest quality components which you may mix like you want.
    and you're free to use any jscript library of your choice, i would recommend jquery ...

  14. #14
    SitePoint Member
    Join Date
    Mar 2007
    Location
    Adelaide
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would either use Symfony or ZF for such a task, having used CakePHP for a large AJAX based CRM type application (not by choice) definetely wouldn't touch it again, lots of limitations, working with Arrays rather than objects from the models is horid - using it feels amateurish, anyway if you are familiar with really good OOP concepts you will be able to tell if a framework consists of well designed code or not for yourself but I highly recommend delving into it a bit before deciding on one because when you're trapped in the wrong one it just becomes a major headache.

    Again having a decent OOP background helps spot decent JS frameworks too - jQuery, Prototype and ExtJS (very good for backend application like CRM type web apps btw) are all good, Dojo has a lot of components but it has taken quite a long time to mature into something near a stable API.

    Remember that just because a framework may seem to be the most popular or hyped it doesn't mean it's the best, take the time (about a week each to really try them out) and experience each of the top frameworks and you should be able to find out what works truly well and what doesn't.

  15. #15
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Chicago
    Posts
    542
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jestep View Post
    It looks like Frameworks are one of those, once you start, you don't ever go back.
    Yeah, I see what you mean. It seems like more and more I'd rather trust a framework that's been worked on and revised by several people because it makes my own code feel sloppy in comparison.

    On the other hand I need to dive more into OO with PHP and learn by doing some of my own dirty work.

  16. #16
    SitePoint Addict Jasper Bekkers's Avatar
    Join Date
    May 2007
    Location
    The Netherlands
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Skyblaze View Post
    i use only a framework to develop even for a static site made of few pages (using caching). I use symfony 'cause i think it is awesome!
    That doesn't really fit into the "use the right tool for the right job"-equation. I'd suggest taking a week apart just to research frameworks and see which satisfy the most of your requirements (of of which might be ease of use), and create a top-3 and create a small prototype with each of the frameworks. At the end of the week, decide what to go for and don't look back.
    Design patterns: trying to do Smalltalk in Java.
    I blog too, you know.

  17. #17
    SitePoint Enthusiast BeeStar's Avatar
    Join Date
    Apr 2008
    Location
    the Netherlands
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I started a small web application project, I needed to have a first working, stable, production ripe application within two months. I only had the evenings to program and as a father of two small children I had plenty of other activities too. ;-) Speed in programming and getting the thing ready was therefore crucial.

    I decided to use a framework, to save programming time on the database layer, the setup of the MVC structure, etc. I wanted a framework that took all the groundwork away from me, and let me have a lot of freedom at the same time.

    After researching for a while, I decided to use CodeIgniter (version 1.4 at the time). I watched the video's and I immediately grabbed the concept. In the end, it saved me 30-50% developing time and yes, the application was in production on time. It had a very plain graphical lay-out and only the minimal set of features, but hey, it was stable and used immediately after release.

    What surprised me was the incredible speed. The database was running on the same server as Apache and PHP, so that helped, but the pages had an average generating time on the server of about 0.05 seconds (average SQL queries per page: 6). Because I had split the functionality of the app across a few controllers, only the part of the application that was needed was loaded. CodeIgniter makes this easy.

    As said before in this thread, there is no way I am going back to the roll-it-all-myself-era. :-)


    Disclaimer: I am not related to CodeIgniter or EllisLab in any way.


    Bee


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •