10 Principles of the PHP Masters

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

10 Principles of the PHP Masters

Post by Chalks »

This article was on digg today:
http://nettuts.com/articles/10-principl ... p-masters/

I think I agree with most of the points, and I can't really think of anything important to add. Since I consider many of you PHP Masters, do you guys have anything to add or say about this list?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: 10 Principles of the PHP Masters

Post by josh »

saw this on digg
8. Don't use a PHP Framework - Rasmus Lerdorf

Contrary to Josh's belief that one should use a PHP framework, Rasmus Lerdorf, the Godfather of PHP himself, believes that frameworks aren't that great. Why? Because they perform much slower than simple PHP.
PHP performs much slower then assembly, should I use assembly for my sites from now on? smacking my head
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: 10 Principles of the PHP Masters

Post by Christopher »

I can't say that the list is all "principles"? Some of them are just tips.

#1 and #9 are the same idea of using PHP for what it's good for and using other languages and applications for a complete solution. Similarly in PHP we use standard databases or technologies like LDAP to solve problems where other languages write custom sub-systems.

Not sure what to say about #2 or #8. Scalability is an art that requires a deep understand of exactly how the pieces of your architecture do their jobs. Specific tips are of little general help. And Mr. Lerdorf is in a separate universe at Yahoo than most PHP programmers, so take his advice with a grain of salt. They use custom compilations and extensions to achieve much of their performance.

#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. ;)

#4 is good general advice.

#5 and #10 are just tips ... you could build a list of many more that two useful tips.

And #7 is much better advice for PHP programmers than it is given credit in this article. I think having Do/Don't in the list is funny, but does a disservice to the PHP community.

I can think of a number of other topics I would cover before some of these: such as becoming familiar with using the online PHP manual, or understanding the "share nothing" architecture of PHP which helps in understanding sessions, connections, etc. Unit testing and tools is not on the list. Probably an understand of design patterns and their PHP implementations would be good. And I would move security to the top. I am sure there are more...
(#10850)
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: 10 Principles of the PHP Masters

Post by onion2k »

jshpro2 wrote:
8. Don't use a PHP Framework - Rasmus Lerdorf

Contrary to Josh's belief that one should use a PHP framework, Rasmus Lerdorf, the Godfather of PHP himself, believes that frameworks aren't that great. Why? Because they perform much slower than simple PHP.
PHP performs much slower then assembly, should I use assembly for my sites from now on? smacking my head
That isn't what Rasmus is saying. He's not saying "Do everything you can to make things as fast as possible". He's saying "Frameworks add too much overhead to be useful and don't actually add very much to the development process".

I kind of agree with him. You don't need a framework for 99% of tasks. Building a small website using a technology designed to aid in building massive websites is very wasteful. If you're building a little photo gallery or a CV website it just doesn't call for a framework. If you're building Facebook then a framework is may be a good idea... but then the overhead of the framework itself becomes an issue. It's a tricky software design problem.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: 10 Principles of the PHP Masters

Post by josh »

Oh I agree if its a simple gallery script a framework is pointless
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: 10 Principles of the PHP Masters

Post by onion2k »

jshpro2 wrote:Oh I agree if its a simple gallery script a framework is pointless
Which clearly raises the question of where is a framework not pointless?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: 10 Principles of the PHP Masters

Post by josh »

Well youd have to define the difference between a couple objects and a framework? Technically if I wrote a very limited framework would it still be considered a framework? Can I have just a bunch of objects and not call it a framework? lol
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: 10 Principles of the PHP Masters

Post by panic! »

jshpro2 wrote:saw this on digg
8. Don't use a PHP Framework - Rasmus Lerdorf

Contrary to Josh's belief that one should use a PHP framework, Rasmus Lerdorf, the Godfather of PHP himself, believes that frameworks aren't that great. Why? Because they perform much slower than simple PHP.
PHP performs much slower then assembly, should I use assembly for my sites from now on? smacking my head

That isn't what he's saying at all, that's a ridiculous argument. Frameworks ARE good for smaller sites and I use one myself, but I don't think anyone would argue a non-framework based site will perform better than a framework based site.

Also Rasmus Lerdorf does know a thing or two about PHP remember..
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: 10 Principles of the PHP Masters

Post by onion2k »

panic! wrote:Frameworks ARE good for smaller sites
Why?
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: 10 Principles of the PHP Masters

Post by panic! »

Scalability.

Read the sentence after. Pound for pound Non-frameworked sites scale better than framework based sites.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: 10 Principles of the PHP Masters

Post by panic! »

by the way when I say small and scale I'm referring to popularity not content.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: 10 Principles of the PHP Masters

Post by onion2k »

You're suggesting that a few simple functions, the bare minimum for your needs, is going to perform worse than something like Cake or Zend? That doesn't seem very likely for a small website. Quite the opposite in fact. Frameworks add a big overhead that only becomes worthwhile for a larger application that's doing a lot in my experience.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: 10 Principles of the PHP Masters

Post by panic! »

when did I say that?
I said NON-FRAMEWORKED SITES, i.e: sites without a framework (not using a framework) will scale (ie perform better when traffic increases) BETTER than FRAMEWORKED sites (those using ZEND, CAKE etc).

To reiterate: sites without a framework will perform better than sites USING a framework.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: 10 Principles of the PHP Masters

Post by onion2k »

I'm totally confused.

First you said:
Frameworks ARE good for smaller sites
Then I asked you why. You said:
Scalability

Read the sentence after. Pound for pound Non-frameworked sites scale better than framework based sites.
That's an explanation about why frameworks aren't good for small sites.

Why are frameworks good for small sites?
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: 10 Principles of the PHP Masters

Post by panic! »

development time...that's why people use frameworks,.

If you still don't understand: I'll explain again.

Frameworks are good.

I like frameworks.

They speed up development time.

That's why people use them.

They are good for small sites.

Because they speed up development time.

Clients do like it when sites are developed quickly because it costs them less money.

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.
Post Reply