Jump to content

Why use a framework?


Brandonmxb

Recommended Posts

Why would someone use a PHP framework? I've read about it and I always hear: it saves you time. But when I program, I've never used a framework (that wasn't mine). When I code, the code is 100% mine.

 

Why use one? When would you use one? What limits does it have?

Link to post
Share on other sites

It all depends on the project, and your preference. A framework can be good with multiple developers as the documentation and consistency with coding, etc can be a benefit. Especially with opensource software, as anyone can look up on it. With your framework, you would have to take the time to document it, and although you know it well, no one else would, and if you decided to give up on a project that has a bit of people on it, they would be at a loss for the most part. If it was using a framework that is known, well people could easily look up items online in their forums etc for more information about it.

 

There are other reasons, but it is more or less down to your personal decision and perhaps the client you are working for.

Link to post
Share on other sites

A framework provides streamlined code, in most cases, for common functions etc. So you don't have to "re-invent" the wheel so to speak and have modules type systems to make it easily plugin. Like for instance, Zend Framework has a Doctrine library that is already built to integrate it with Doctrine, so you just have to include that library class for it to work. It also has validation library, mail library, form library, etc.

 

And yes, it is basically including the libraries that you want to use, and it more or less can streamline it. Once you learn a framework they are dead useful,  but they are not for every project, as frameworks tend to be heavy,

Link to post
Share on other sites
but they are not for every project, as frameworks tend to be heavy,

 

While I believe frameworks are not for every project, I don't agree on this reason. Most frameworks only use what you want it to use and therefore have a pretty small footprint.

Link to post
Share on other sites

Most frameworks only use what you want it to use and therefore have a pretty small footprint.

 

Not really what I was getting at, they can have a small footprint, but most of the time you are cloning the whole repository of a framework and tend to have all those files. You can remove them, but most people don't. More or less what I was getting at.

Link to post
Share on other sites

A framework is a library of re-usable bassline functions (methods) that can be genericaly invoked with a simplistic line of code, ultimately minimizing the development process. As a stand alone developer you would store re-usable code for futore work to speed up development (the faster the development the more money there is to be made!!)

Link to post
Share on other sites
  • 3 weeks later...

Well, why use one. As others have already stated, it saves your time. Big time. Some years ago, while being a newb, I was in the very same position, thinking about wheather I really need to learn to work with a framework. My advice would be: just start learning one and see the advantage for your self. I started with Zend framework (probably not the easiest one for starters) and it's just so useful. Whether I work withing the MVC architecture or just use it as a library for a random project, it always saves me time. Also as a side effect, it makes you a better PHP programmer since you get to work with code written by some great PHP developers.

Link to post
Share on other sites

A framework isn't what it sounds like you think it is. You can use a framework regardless of CSS with CSSUI or MMUI. The framework is simply a way to package up your design/templates/images/etc. It is an independent function. You can take a virtual snapshot of your website when you save a framework.

CSSUI gives you a little more flexibility mostly over MMUI. Otherwise, it isn't that much different and the framework works regardless. The options/flexibility are basically at the component level.

 

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.