4 ms·
Learn how to use the Symfony Framework: http://symfony.com/ http://symfony.com/ That is modern PHP done right.
by umsm 13y ago
Learn how to use the Symfony Framework:
http://symfony.com/ http://symfony.com/
That is modern PHP done right.
- asciimo 13y agoI'm not sure that PHP done like Java is "right."
- krapp 13y agoI think the best answer, probably, is that modern PHP done right uses some kind of framework, or at least a PSR-0 autoloader, url routing, proper data security and some kind of templating to separate the logic from the view. It can (and has been) argued that PHP is itself a templating language and that the added abstraction of something like Twig is unnecessary... while that's technically true, scaling that gets you trainwrecks like Wordpress' API, where it's all but impossible to write plugins without mixing html in with the code. You also get nice things like macros, auto-escaping, and caching with a template engine, and you would probably end up having to reimplement a lot of that at some point anyway. Although what Laravel uses (blade) for templating looks pretty close to bare PHP, so there's plenty of room for minimal abstraction. But all of it is light-years ahead of the nightmare that is typical legacy PHP.
- dscrd 13y agoActually, Symfony seems like some kids went to basic OO design courses and took everything there seriously. It also causes the end product to be measurably the slowest in the world. http://www.techempower.com/benchmarks/ http://www.techempower.com/benchmarks/ I think this is the worst symptom: Sure, you can write snappy code that performs fast but when you try to reach a higher abstraction level, all those fundamental design failures catch up and make everything awkward and just bad.