views:

102

answers:

5

ive seen many third party mvcs or frameworks such as codeignitor , cakephp, and so on. what i want to know is what are their purposes? ive created my own framework call it an mvc or framework (in my opinion their all the same). in my framework i have all the classes in one folder called classes and all functions in another. its all organized and when a new project comes in i am able to complete it fast. i have looked at the applications that i mentioned and it seems to have huge articles and tutorials to study. what is the purpose? why not study the main language such as php, javascript/ajax or jquery, and so on then build something that you know the ins and outs of so that any project comes your way you know what to do. ive known some people who use cakephp and for every project they get stuck and need to figure out what to do. another guy i knew worked with joomla and every basic company website that came his way he would reverse engineer joomla to make it work with the site. are people using these applications because they lack knowledge in the languages? or sometimes have no choice but to make a site while lacking language and put something together.

ps: i dont want to say which is better or argue, i want to understand and see if im missing anything.

+3  A: 

Standardized frameworks make it easy to adapt and reuse blocks of code. By using a framework such as Zend, Cake, Joomla, etc. you can find repositories of pre-made scripts and components that easily plug into your existing site.

Not only that but frameworks will (in most cases) handle a lot of complicated, repetitive tasks that are standard across most websites. Frameworks will in most cases scaffold CRUD classes against your database automatically and support a clean separation of logic and view.

Frameworks aren't for everyone and I would actually recommend that newcomers to programming or PHP learn the basic syntax and object structure. Doing so will give you a stronger understanding of how your framework behaves and make it easier for you to modify/override the existing structure. Every framework is different, and some are better suited than others for particular tasks. You should do research and testing to see which one fits your needs.

Jarrod
A: 

If you want to setup a project quickly, without having to know too much about everything underneath, using one of these frameworks can be very useful. You know, to some extent at least, that they're pretty well built and reliable, and it saves you a lot of time opposed to creating everything yourself. Most of them are also easily extendable to add functionality you might need.

But you're right, it's always a good thing to learn about all the basics. That way it's a lot easier to know what these frameworks exactly do, and more importantly, why and how. And knowing that makes it easier to choose the right framework for you and extend it in a proper and efficient way.

But in the end you'll learn from both approaches, the difference being that with an existing framework you can get start working with a site (almost) right away.

Alec
so i guess it all comes down to people either not having the time or patience in creating their own. that is what i've done in creating my own framework and it does spare alot of time.
michael
It all depends on what you'll be using it for. If you write very specific apps it will probably save you a lot of time to know all the basics and write the framework yourself. That way it's a lot easier to manage and maintain, assuming you wrote something decent, that is. And that's the catch. It will take a lot of time and know-how before you can write something that's as well built as these bigger frameworks. If you have that time, and it's needed, that great; if not though but you still need a good basis and want to learn more as you go, existing frameworks are a great option too.
Alec
+1  A: 

One other benefit that hasn't been mentioned yet is that using a standard framework gives some shared knowledge between developers. If you build a project with your home-grown "framework" and then someone else has to maintain it in the future, they have to totally learn your methods from scratch. However, if you had used CakePHP, and they already have experience with CakePHP, they're going to have a pretty good base to start with. That can make a huge difference in the amount of time it takes them to get comfortable with a new system.

Chad Birch
makes sense but do alot of developing companies use these pre-created frameworks? or have their employees create their own?
michael
It depends. If you're creating one website for a customer, you can use an open-source framework. However, if you're developing a web application that you will sell to many customers as a product in itself, it's illegal to use source from 3rd-party open source software. I'm not a lawyer though, but if I said anything inaccurate please correct me.
Lotus Notes
@Byron - its not illegal to use open source code in a paid project. it depends on the software license you get with the framework. most just require that you keep their copyright at the top of their classes.
Tom Schlick
Depending on the license of the project its totally legal to make commercial products based on open source. I would be careful around things that are GPL'ed. But BSD or MIT licenses are quite liberal.
Mark Story
A: 

I too use my own home-built framework that took many months to develop, but for every project I still weigh the pros and cons of using a 3rd party framework. The decision usually comes down to the specifics of what I want to achieve. For example, in database-centric applications, I use my own framework because the ORM solutions of most of the well-known frameworks are just downright terrible and inefficient, but for something simple like a Blog, Codeigniter might be my choice (just because I hate Wordpress, which isn't even a framework but I have to mention here how horrible it is).

But keep in mind that while you know the ins and outs of your own framework, if anyone else has to maintain your project later on it will be difficult especially if you don't document. Big frameworks like CakePHP, Kohana, Symfony, etc. are fairly well known and it's easy to find others who have experience with them. Plus if you need help, all you have to do is post on their forums and chances are you'll have a good answer.

Lotus Notes
If you are happy with your framework, and a little wary of dropping it for someone else's, then that implies yours has something unique to it. So why not open source it and encourage others to use it and help you improve it?
Kurucu
A: 

Another point is the maintenance of a home-built framework. More often than not this comes second to developing new sites or maintaining old ones, whereas a standard framework has a team of developers behind it. Any security issues in the framework are addressed and patched more rapidly and you can usually just upgrade the framework and keep your code intact.

Brian Hogg