Page 2 of 3

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 11:31 am
by onion2k
Hmm.. I don't really agree that frameworks speed up development on small sites. A brochure site that consists of a few static pages, maybe a contact form, a gallery, and a new system is too small to make a framework useful. The added level of complexity that a framework brings, coupled with the reduced performance, just makes it pointless. On a larger site a framework is very handy but on a small site ... I don't think there's a place for one.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 12:29 pm
by Christopher
A couple of things because I said above that recommending not using frameworks does a disservice to the PHP community. I think my first question to jshpro2 and onion2k is if they have ever used a framework for anything? They are giving a strong recommendation against and I wonder if it is from experience? They are essentially saying that frameworks are not good at all (or 99%).

Second, I wonder about the logic of their argument -- which is that for small sites frameworks hurt performance. First, is performance really a key concern of small sites like they describe, given modern hosting? I think not. And is the statement that frameworks perform poorly real or just anecdotal? Given the good practices that frameworks promote, might they actually perform better than the poorly designed sites we often see. I have not seen the performance hit described.

What about the consistency that a framework provides for a developer from site to site? What about all of the interesting functionality they provide that programmers might not be able to build on their own? What about the good security practices that frameworks promote that programmers often miss?

I am not saying that you need a framework if are just adding a contact form to a HTML site. But on the other hand, using a framework can make it really easy to build a small "CV" site that is secure and expandable. I bet that you could build such a site as quickly with a framework and would be using better practices. And I seriously doubt that anyone would notice any performance difference.

Finally, the article and this whole conversation talks about "frameworks" as if they are some monolithic "thing." It does not talk about the variety in style, size, and complexity of PHP frameworks. A developer can choose a framework that suits the type of sites she/he develops and leverage the code reuse, consistency and good practices that you get from a widely used and vetted code base. I think trying out several frameworks and using a framework is one of the best pieces of advice you can give a PHP programmer.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 12:49 pm
by arjan.top
panic! wrote: But on more popular sites where you are anticipating high traffic it is better not to use them.
Because Non-frameworked sites scale better than frameworked sites.
Clients don't like it when their sites die.
yahoo is using symfony framework for yahoo! bookmarks with couple million users, so what is high traffic?

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 12:55 pm
by jayshields
I think this conversation (argument) is a bit pointless (because it won't ever reach a conclusion), because every situation has different requirements, some which may be suited to frameworks, and some which may not. Also, another thing to consider is the different types of frameworks. I'm no framework expert, but from what I gather CodeIgniter is vastly different from most other frameworks.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 1:12 pm
by alex.barylski
Which clearly raises the question of where is a framework not pointless?
If the problem can be elegantly solved using a transation script approach...do it...otherwise use a framework. If performance is that big of a factor optimize using C or similar compiled languages???

Thats my general rule of thumb :P

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 1:16 pm
by Christopher
jayshields wrote:I think this conversation (argument) is a bit pointless (because it won't ever reach a conclusion), because every situation has different requirements, some which may be suited to frameworks, and some which may not. Also, another thing to consider is the different types of frameworks. I'm no framework expert, but from what I gather CodeIgniter is vastly different from most other frameworks.
I don't think it is pointless because it is information that is useful and of interest to many PHP programmers. I agree with what you said, and was reacting to the statements above that seemed to say that you should never use frameworks because they always produce unacceptably slow websites. I think that statement is false. I also think it ignores the large number of important benefits that frameworks can provide.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 1:39 pm
by Mordred
arborint wrote:#3 and #6 should go at the top of the list under Security. I would rather have people read a good Mordred rant than either of these suggestions though. ;)
Wow, I'm flattered :)

Perhaps it's not the right time to mention that I write my posts with markoff chains based on the Bible, with random keywords replaced from the PHP manual. Leviticus is particularly good for this: "and the sons of Aaron shall escape all values before placing them on the SQL altar"

---
If we view these as tips for novices, it's mostly good advice. If it's supposed to be what makes the masters masters, that's not really it. I think we have such a bad reception of this list, because it's a mix of the two, with a sprinkle of useless things (I don't think caching and scalability issues affect that many of web coders, apart from the select few who work on huge sites) and controvercial advice (use frameworks and also don't).

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 4:46 pm
by panic!
arborint wrote:A couple of things because I said above that recommending not using frameworks does a disservice to the PHP community. I think my first question to jshpro2 and onion2k is if they have ever used a framework for anything? They are giving a strong recommendation against and I wonder if it is from experience? They are essentially saying that frameworks are not good at all (or 99%).
I agree, Frameworks are great; otherwise why would anyone use them? It's not like most of them don't have a steep learning curve.

Mozilla,MIT and Yale use cake in some way. IBM advocate cake as well.

Speaking from personal experience and I've been writing PHP as a full-time career (i.e: it pays my rent, bills, buys cars and holidays) for nearly 4 years (nearly a year as a lead) and I'm only 22, I've worked on sites for some big international brands too, I've never bought any of this up in the past so I'm not boasting I'm just putting some weight behind my opinion.

Anyway I digress... frameworks are much, much faster than anything else for putting sites together really quickly if you know a good framework well, I couldn't imagine working on a site without Model View Controller of some form now days. Maybe that will change and a different development philosophy will emerge and I will switch. But I know I can go into any MVC framework based project and figure out what's what and where things are.

Anyway that's my opinion.

Frameworks are great, I love them but they don't scale so well on bigger sites.

onion2k wrote:Hmm.. I don't really agree that frameworks speed up development on small sites. A brochure site that consists of a few static pages, maybe a contact form, a gallery, and a new system is too small to make a framework useful
If you don't know what you're doing; sure. But activerecord (or whatever), templating, Model VIew Controller make it very fast, organised, other developers can come in and know exactly where everything is going to be. It pays dividends to be well structured, stick to conventions with the scope to expand the site if you need to.
onion2k wrote:The added level of complexity that a framework brings
/quote]

I actually personally disagree and think frameworks simplify the development process again; if you understand OO and MVC you will be able to look at a project and understand it straight away, if you don't: you can look up the documentation online. Where as if it's some bespoke system you're at the mercy of someone who could well be a very bad programmer who things having SQL and HTML in the same file is a really cool, modern idea.
onion2k wrote: coupled with the reduced performance
Performance on the kind of site you're talking about would be minimal and probably not noticeable at all.


Don't see this post as me attacking you; it's merely my opinions and what I'm basing them on. I'm sure you have perfectly valid cases for your opinions too.

Again I will say: Sites without frameworks scale better than sites with.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 6:17 pm
by onion2k
panic! wrote:If you don't know what you're doing; sure.
Hmm.. well, you do have 4 years professional experience with 1 year as a lead, so I guess you're qualified to say that.

I only have 11 years experience with 9 of them as a lead/head of production... Oh, and a first class honours degree in a related subject. :twisted:

I completely understand what you're saying. I just don't agree with it. It's quicker to develop very small systems like contact forms without a framework. That's not to say you shouldn't use libraries of course. I wouldn't dream of writing a contact form without SwiftMailer for example. All I'm saying is that the complexity of a framework slows you down for very minor tasks. You should use the right tool for the job. Sometimes that won't be your chosen flavour of framework.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 7:41 pm
by Christopher
onion2k wrote:You should use the right tool for the job. Sometimes that won't be your chosen flavour of framework.
No one could disagree with that! ;)
onion2k wrote:All I'm saying is that the complexity of a framework slows you down for very minor tasks.
Which leads to the inverse of your earlier question: What is the definition of "very minor tasks" where a framework would be more work? I said earlier if it is only one or two dynamic pages on a static site, then straight PHP scripts would be a good choice. But if the site will grow (and most do) then starting with a framework will give you solid foundation in my opinion.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 7:51 pm
by Luke
What I don't get about these arguments is that no matter what, you ALWAYS end up with a framework when you've been building websites for more than a year. If you don't have library after library of code saved up from past projects, in my opinion you're wasting a lot of time.

Re: 10 Principles of the PHP Masters

Posted: Wed Sep 10, 2008 10:27 pm
by josh
I'm not arguing against frameworks arboint, I'm arguing for them, lol

And yeah rasmus knows a thing or two about PHP, my highschool english teacher knew a thing or two about English but she didn't write any best selling books. How do you measure your success, execution time, delivery time? *financial freedom* ( having work less and less hours each month )? I use the last benchmark

Re: 10 Principles of the PHP Masters

Posted: Thu Sep 11, 2008 2:24 am
by panic!
onion2k wrote:
panic! wrote:If you don't know what you're doing; sure.
I only have 11 years experience with 9 of them as a lead/head of production... Oh, and a first class honours degree in a related subject. :twisted:
Well then I respect your opinion but I disagree still. Maybe I'm just younger and more trendy and hip ;).
arborint wrote:But if the site will grow (and most do) then starting with a framework will give you solid foundation in my opinion.
I totally agree; you should always give any project scope to agree, you never, ever can predict what someone is going to turn around and want to do.
The Ninja Space Goat wrote:What I don't get about these arguments is that no matter what, you ALWAYS end up with a framework when you've been building websites for more than a year. If you don't have library after library of code saved up from past projects, in my opinion you're wasting a lot of time.
Again I agree.

Re: 10 Principles of the PHP Masters

Posted: Thu Sep 11, 2008 4:36 am
by onion2k
panic! wrote:Well then I respect your opinion but I disagree still. Maybe I'm just younger and more trendy and hip ;).
:lol:

That's probably true actually. :(

Re: 10 Principles of the PHP Masters

Posted: Thu Sep 11, 2008 4:38 am
by onion2k
jshpro2 wrote:And yeah rasmus knows a thing or two about PHP, my highschool english teacher knew a thing or two about English but she didn't write any best selling books. How do you measure your success, execution time, delivery time? *financial freedom* ( having work less and less hours each month )? I use the last benchmark
I'd wager a fair sum that Rasmus is pretty well paid. He probably has enough Yahoo stock options to retire by now.