Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am wondering if it is necessary to have a framework or if it is a must-have if I plan to make a large website. Large website could mean a lot of things: in other words, multiple dynamic web pages (40-50 dynamic pages, mysql content) and a lot of visitors (+- a million hits per month). The site will be hosted in a dedicated server environment.

I know that it could simplify coding for a developer team, that it includes libraries and a lot of advantages. But I just feel that I don't need that. I think that learning how it works, managing it and installing it would take more time and I could use that time to code.

I write PHP the simplest way I could (with performance in mind) and I try to reuse my code/functions/classes most of the time and I make sure that if another developer joins the team, that he won't be lost in the code.

I am also planning to use MemCached or another Cache for PHP.

As I said, the site will be hosted in a dedicated server environment but will be entirely managed by the hosting company. I am pretty sure the control panel for me to control the basic stuff will be Cpanel.

For a developer like me that only knows PHP, Javascript, HTML, CSS, MYSQL and really basic server management, I feel that it seems to complicated to have a framework. Am I wrong? Is it worth the time to learn all about it?

Thank you for your opinions and suggestions.

share|improve this question

migrated from stackoverflow.com Apr 2 '11 at 17:05

This question came from our site for professional and enthusiast programmers.

7  
No one needs a framework. At least not if it's for the sake of having one. Look at your project requirements. Then find out if there is a framework or a PEAR package that could help with solving that requirement. Pick the best one for the problem. That's the only sane approach. –  Gordon Apr 2 '11 at 15:02
    
Thank you all for your suggestions and comments. I really appreciate. –  Martin Apr 2 '11 at 15:27
    
If you haven't already invented a framework by doing tons of minor refactorings then you're doing something wrong. –  davidk01 Apr 2 '11 at 19:12
    
@davidk01 I think you're wrong. What if I have multiple projects and each with almost no overlap, what's wrong with not having a framework? (unless you mean framework as in what the app is running on). –  dkuntz2 Apr 18 '11 at 3:03
    
@DKuntz2: I don't think that's possible in web dev. Everybody deals with cookies, sessions, databases, etc. After a few projects everyone develops enough utilities in various libraries for dealing with the boilerplate and if you put it together in the right way then you get a framework. Unless of course you're completely oblivious to common recurring patterns in which case you can blissfully reinvent the wheel on every project. –  davidk01 Apr 18 '11 at 4:18

5 Answers 5

Frameworks help reduce coding time and make it easier for someone else who may follow in your footsteps to work on your code.

However, like most things, anything generic has overhead. If you write well thought out and planned code, where you have your libraries and keep it all tidy, I'd argue that if you're going to add to your problems trying to learn and get the best out of a framework, this will just make you feel more stressed about getting it right.

As an example, I wrote a PHP based system at work, but they are very MS based, and so, I thought, fine, I'll take a look at some asp.net .. I can c# well enough, how bad can it be? Well, was I wrong. In part because our place still uses SQL 2000 and the current framework I found and was beginning to get on with, doesnt support SQL 2000, so there was that out the window, its previous version which does support it was far more clunky and I drew the conclusion that while I could migrate it, and do a good job, would it be easier for the non coders who may have to make alterations later? no. in fact almost certainly not.

I'd vote you stick with what you know, sure, investigate some frameworks, you may find one that thinks like you do and before you know it you'll be "Heck, I can rewrite all that stuff in an afternoon in this" .. until then.. be confident.

share|improve this answer

Being realistic, in this day and age not using a framework of some kind (even if it's your own framework you've constructed over time) seems wilfully naive, as you'll inevitably spend a large chunk of time re-inventing the wheel on all but the most trivial of projects unless it's a small project that doesn't involve solving a problem that an existing framework has already efficiently solved.

As such, I'd personally say that you should take the time to get to grips with something like Zend Framework, CodeIgniter, etc. as the time it takes you to learn and become familiar with the framework will more than likely be less than the time you spend custom implementing what's provided by such a framework yourself.

In short: don't re-invent the wheel, choose a nice one that you like and spend your time travelling somewhere.

share|improve this answer
    
Do you have any examples of easy functionality that a framework provides, which others would have to replicate? –  kavisiegel Apr 2 '11 at 14:56
    
@kavisiegel As a (pretty random) example off the top of my head, Zend has OpenID, OAuth and a PDF compositor/creator. –  middaparka Apr 2 '11 at 15:01
    
As a follow up to your answer, might I ask how does a framework work with custom CMS's? Could I create my custom CMS through this framework? –  Bryan Apr 2 '11 at 15:02
1  
@Bryan Yes, you could easily create a custom CMS using Zend Framework (amongst others) as the "base" library. –  middaparka Apr 2 '11 at 15:04
1  
I completely disagree with this answer and all of the comments. –  Gordon Apr 2 '11 at 15:06

You'll end up with a framework whether you start with one or not. Eventually the time taken to write your own iteratively will exceed the time taken to learn one from outside, but at least then you'll have learnt something about the world.

Take a lesson from nature - every complex system has a framework, whether it's the bones in your body or the rules of accounting in the economy. The "framework pattern" is fundamental (and emergent) for any sufficiently complex system.

Or alternatively, don't have a framework, then find yourself copy-pasting a lot, then find your development times get slower and slower until you refactor everything into a framework...

share|improve this answer

Usage of a framework depends entirely on what your needs are.

For many tasks, frameworks of all kinds can make things easier. I agree with some of the other comments, that re-inventing the wheel is bad.

However, I have seen many hack-jobs where people have tried to force using a framework that doesn't quite meet their needs, and they end up with a bloated, slow application that doesn't even meet the criteria they started with.

I think the answer is somewhere in the middle. If you have a basic and simple project, you probably don't need a framework, but that depends entirely on your needs. Just don't go overboard and assume you need the "most complete" framework available for everything.

share|improve this answer

If you have to write a MVC PHP app, then go ahead. If you just want using a framework to operate some array, mail, socket function, even it really save your time,it doesn't.

share|improve this answer
    
I want to agree with this, but I can't. If your app is some trivial one-off thing that you know 100% will never grow beyond that then by all means just hack it together. If you think the app will expand or need to be modified, then always use a framework so you can do things the right way from the start; anything less is dooming the app to be garbage for its lifetime because after the initial development you will likely never have the time to go back and fix the design errors. So +1 for sound advice, -1 for strong disagreement = 0. –  Wayne M Apr 18 '11 at 12:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.