

 Discussing PHP Frameworks: What, When, Why and Which? - vp
http://www.noupe.com/php/discussing-php-frameworks.html

======
cesare
If you're a decent enough programmer (web development is really easy compared
to other fields) and you really want versatility, coding from scratch without
using a framework is still the best decision.

This is not necessarily true for non web apps. I love Cocoa for instance and
the MVC pattern is great for most kinds of apps. But not for the web, IMHO.
It's overkill.

There are too many unnecessary abstractions from the protocols. The LAMP stack
already gives you everything you need. For instance, PHP with mod_php already
is a template processor. There's no need to build another one on top of it.
Unless you don't know what you're doing, which is bad anyway.

I still prefer to parse the query string myself, to define my SQL queries (and
most of the times a single query can replace 4-5 queries generated from a
framework so apps are much faster) and to keep the data as clean and separated
from the code as I can (data is always much more important than code and it's
much better if it is code agnostic).

With web frameworks there's a lot of magic and it's faster to have a web app
up and running. But it's a pain as soon as you want to modify the default
behaviors. At least in my experience.

~~~
sanswork
I think you are thinking too small. For most small sites I agree that
frameworks are overkill but once you get past that they become nearly
essential to maintaining your code.

Running a web app with even over 10KLOC without some sort of framework in
place sounds like a receipt for disaster. Also frameworks do not mean you have
to have code generate all your queries or stick another templating language
over php.

If you've never had to write or maintain a complex web application than I can
understand your position but once you do I'm certain you'll change your mind.

Also saying web development is easy compared to other fields shows a lack of
understanding of the complexity of large web based applications. I've worked
in a number of fields and I now focus on web development and for the most part
they were all about the same complexity.

~~~
cesare
I totally disagree. And I've made complex web apps since when CGIs in C where
the only way to have dynamic generated content.

In fact I think it is the contrary: for small sites (and small budgets)
frameworks can be ok. For big websites custom code is a must.

The idea that using a framework makes code easier to maintain is the complete
opposite of my experience.

Big (serious) projects require a lot of custom logic which you should write
yourself anyway. And it is a lot more painful since you have to stick to the
framework logic if you don't want to break things as soon as you update the
framework version or if you don't want to make the code unmaintainable.

I have made my own libraries which are designed in a modular fashion (not OO)
that I constantly improve and reuse. Code is clean and you can easily
understand the flow of each section.

A MVC framework is not the only way to have clean (modular) code.

Your reasoning would apply if you aren't good at designing software
architecture, which is a recipe for disaster especially on big projects.

~~~
sanswork
I'm not saying MVC is the only way. I've not even mentioned MVC. What I gather
though is that when you hear someone mention frameworks you assume they are
referring to the railish frameworks of recent. A framework to me is a set of
libraries and a structure to better layout and facilitate the development of
your application.

It also doesn't have to be a premade/3rd party one as you've demonstrated by
essentially creating your own framework and just calling it by a different
name(collection of libraries).

A recipe for disaster in my opinion would be a large project with no code
structure/layout guidelines.

~~~
cesare
In this case, of course, I agree.

The term framework is almost exclusively used for object oriented designs.
That's what I was arguing against.

Of course one should make, use and keep improving his own libraries.

And there's nothing wrong in using other people code either. Provided that it
is built in a modular standalone fashion and so it can be easily included /
replaced / updated / removed without breaking things.

------
Zak
This article could omit the words "PHP" and "web" until it starts listing the
specific frameworks and still be valid.

I'm inclined to agree with the posts opposing the use of a generic framework
for a very scalable or complex application; they're usually not for that. What
frameworks ARE for is small to medium applications with low budgets.

I do some contract work on projects with budgets in the $500-2000 range. For
projects like that, frameworks like Rails or Django save a lot of time over
writing it in scratch (even in Lisp, which I've done a couple times).

~~~
cesare
Exactly.

------
apinstein
It's amazing how all-over the place these comments are on frameworks! Maybe
it's because frameworks vary so much in their goals, weight and architecture.

There are really 2 kinds of performance; latency and throughput. Latency is
how fast a single request is served; throughput how many requests you can
serve concurrently. A good framework has a noticeable but negligible effect on
latency (which also goes down all the time as the framework improves and
hardware gets faster), yet also makes scalability _easier_ by helping you
abstract out the parts that make it scalable. If the framework you're using
makes it hard to scale horizontally, that's a failure of _that_ framework, not
of the concept of frameworks.

I also disagree on the size of web sites that frameworks are useful on. I see
a lot of comments like "ok for small/medium sites but bad for large sites".
Why would frameworks suddenly get bad on a large site? For performance
reasons? Architectural reasons? If either of these happen to you then you've
simply chosen the wrong framework.

The argument that "an organizational system and set of useful libraries for
programming web-related tasks" all of the sudden stop working once a site
reaches a certain size is bogus. It might be true for a framework, but it
won't be true for all of them.

I ended up writing a php framework (<http://phocoa.com>) in order to write
_less_ code. Frameworks give you leverage. They only box you in or cause
scalability problems if they're architected poorly. I have really enjoyed the
experience of building a framework as well as using it. I have been writing
web apps, mobile apps, and desktop apps of all kinds for nearly 15 years and
so I have had broad exposure to a variety of development stacks, from nothing
to rich frameworks. Of course it's just my personal opinion, but in my
experience a well-written framework is always better than doing it yourself,
and a poorly-written one is almost always worse than doing it yourself.

------
billclerico
We use Kohana, which is a lightweight php5 port of codeigniter. we like it a
lot

~~~
Keyframe
I'm currently looking at kohana - I use Zend FW now (been doing a long time
without any of the established frameworks, only my own set of tools). Can you
elaborate a bit why Kohana instead of Zend? Even if I end up using Kohana,
there are several things in Zend I will keep - PDF for example.

~~~
billclerico
I don't have any experience with Zend, but I've heard its just a very heavy
weight install.

Kohana is super light and easily extended, though you lose a lot of the fluffy
libraries.

------
jacquesm
the list he gives is very very short, here is a longer one:

<http://www.phpframeworks.com/>

------
asnyder
There's also NOLOH (<http://www.noloh.com>), which allows you to create
sophisticated web sites and web applications easily and intuitively in a
single development language.

Disclaimer: I'm a co-founder of NOLOH.

~~~
frwdr
Wow, that's creepy. I've just been building exactly the same thing - i even
used the same keywords.

~~~
asnyder
NOLOH's been around since 2005 and has multiple patents pending. Perhaps you
would like to talk sometime, we're always looking for talented developers to
join our team.

~~~
frwdr
That's very interesting. I never understood why more people haven't made the
connection between objects in the front end and PHP objects in the backend,
and how it's only natural to unify those into one language instead of messing
with seperate html, css, js etc. Anyhow good luck to you guys, it's the way to
go, i want to keep working on more features and then maybe i'll give you a
shout if i feel i've got something new worth contributing :)

------
metachris
A small mistake: this site is writing "Codelgniter" (with L) instead of
"CodeIgniter" (with I).

------
garnet7
No drupal?

