Page 1 of 3
10 Principles of the PHP Masters
Posted: Tue Sep 09, 2008 7:32 pm
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?
Re: 10 Principles of the PHP Masters
Posted: Tue Sep 09, 2008 11:56 pm
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
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 1:37 am
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...
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 3:16 am
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.
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 5:19 am
by josh
Oh I agree if its a simple gallery script a framework is pointless
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 7:06 am
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?
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 7:26 am
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
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 10:20 am
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..
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 10:23 am
by onion2k
panic! wrote:Frameworks ARE good for smaller sites
Why?
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 10:51 am
by panic!
Scalability.
Read the sentence after. Pound for pound Non-frameworked sites scale better than framework based sites.
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 10:53 am
by panic!
by the way when I say small and scale I'm referring to popularity not content.
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 10:55 am
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.
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 11:02 am
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.
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 11:09 am
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?
Re: 10 Principles of the PHP Masters
Posted: Wed Sep 10, 2008 11:21 am
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.