tags:

views:

58

answers:

4

I'm considering learning a PHP framework for rapid development. I've a solid background in PHP and Jquery including AJAX. I'm felling that there should be some major flexibility that I lose if I use frameworks, just like using CMS's. Is it true? Or can I build virtually anything AJAX driven using frameworks? Like including notifications...(just like facebook)

A: 

You can build virtually anything with a decent framework by just extending it. You don't want to build a large project(like Facebook) using raw code... that would take a really long time, would be very buggy, and is just bad design.

Inigoesdr
And of course if you do it right it will be ultra fast (well much faster than using a framework), easier to maintain and you will not be dependent on framework limitations :)
bisko
I disagree on the easier to maintain. Nothing that size that is hand-spun is easy to maintain. Just ask Omniture who is still dealing with php3 because of hand spun dependencies they are STILL trying to iron out. Can you be more specific as to the limitations one would incur when using a framework? I have been using CakePHP for large projects for more than 3 years. The only limitations I have found are those that prevent you from writing bad code (for the most part). Will you elaborate?
cdburgess
+1  A: 

Personally I think you could write your own framework.

  1. this is 'fun' to do (read; you'll learn a lot from it);
  2. the you spent on learning a framework built by someone else you now spent on creating your own, directly learning all the ins and outs

I mean, if you think of it, for basic operations. What do you really expect from a framework?

  1. Some access/security checking/processing;
  2. Have Models and Controllers for your database;
  3. Have a Base-class for handling your properties;
  4. Have some other classes that you might find handy (ObjectList, DB-Layer, Exception-reporting, BaseController etc);
  5. Some sort of renderer (or just use an index file to do such things).

Okay, if you write your own framework you could end up buggy. But don't you kinda take the same risk when starting to learn a new framework? Having all the posibillities of using it's functionallity in a poor or even wrong way due to it's complexity?

Ben Fransen
I agree 100% to this. After messing around with code-igniter and trying to wrap my head around the API, I threw my hands up and asked 'why couldn't I just write my own' So I did just that, and sure it was rocky at first but I had a lot of fun doing so and I learnt A LOT not only about my programming skill set but programming with MVC in mind.As well, any pre-existing MVC out there had to be created from nothing, or created from an existing idea. Don't reinvent the wheel - just remodel the wheel! Good luck!
cdnicoll
Re-Model the wheel, I like that one ;) haha!
Ben Fransen
Yeah, you could end up with an octagon wheel with one section of the octagon missing, but you will definitely learn. lol
cdburgess
Thanks for your response. Writing a framework is pretty out of reach for me. I'm not versed in the procedural PHP, let alone the OOP one(I know C++ well). Please tell me where I can learn the things you mentioned. They're almost jargons for me -{ObjectList, DB-Layer, Exception-reporting, BaseController etc}. What is the best way to become advanced programmer. People here on stackoverflow know a lot!!
Alexander Suraphel
Okay. The MVC designpattern is pretty common-used for applicationbuilding. Try google that to get familiar with it. And becoming an 'advanced' programmer just happens to people who spend to much time writing code, re-writing code, optimizing code and re-optimizing code in a never-ending loop ;) I'm more of the 'if it works solid and fast enough I'm satisfied'-kinda programmer :) Don't spent ages in optimizing unless it's really important (like when you're building a radardefensesystem or something ;))
Ben Fransen
A: 

There are plenty of pre-made blog softwares out there, but in order to learn PHP, I used CodeIgniter to make my own blog. If you work on it, you can make anything, but also don't reinvent the wheel. If there is something already made, there is no shame in using it.

Rocket
A: 

It really depends on what you are trying to accomplish. The problem with writing your own framework for a project like this is that you are the only one who knows where everything is. So you get the task of not only writing the framework, but documenting it, and then putting all of the functionality in on top of that. Not to mention trying to ramp up any new member of the development team.

Why A Framework

A framework already has many developers (and others) behind it. Why not leverage the framework? There is a large community of people behind most frameworks. And if you pick the right framework, you will also get plenty of excellent documentation. In addition, there are third party plugins, components, addons that the community develops as well. All of which will be easy to understand because they will (mostly) follow the standards of the framework.

In addition to the community and leveraging the man hours used to create an open source framework, it allows you to focus on the bits of your application that are most important: the functions the pertain specifically to the application. Why waste time writing all of the mundane parts: ie. database connections, apis, email senders, templating, etc. Use what is out there and go to market much faster.

My Suggestion

I use CakePHP. It is OOP and very structured. They may be a small learning curve as with every framework. But the implementation makes development very fast. There are some high profile sites that use it and it works great. (https://addons.mozilla.org/)

cdburgess
My choice goes to symfony!
Rui Gonçalves
Cool! Please share why. It could be useful for everyone to know why.
cdburgess