php best practices [closed]
i came across this page on php structure at 开发者_C百科here. i tho it was good but i wanna know what others think about this and is there any improvement that can be implemented??
This website looks very outdated and the information is disputeable.
Register globals is a thing of the past.
Short opening tags are absolutely fine if you have control over your server.
Having only one single configuration file can be very annoying too.
In a lot of MVC structures its exactly the other way round.
In most web application it has proven to be useful to have a single point of entry (a bootstrap file) and an object oriented structure with common naming conventions. Global functions are not really up2date any more when using such a structure.
Static helper classes are used a lot.
I would say if you choose the object oriented style the default object oriented paradigms apply. Try to have essential functionalities close together. Have your code organised, reasonable and understandable. Eliminate dependencies across your program. Try not to have redundant code so you can change behaviour of your application at single points.
Focus on performance.
精彩评论