4 ms·
I think there's a few huge positives about using a framework that outweight the cons. He's right about singletons and other anti-pattern oversights and he's rig
by chaffneue 16y ago
I think there's a few huge positives about using a framework that outweight the cons. He's right about singletons and other anti-pattern oversights and he's right about bloat and performance hits over inline mysql_query(), but here are the reasons I won't be going back to php direct for any project I expect to scale.
* My home rolled framework has no docs. I will have no idea what my mindset was 3 years from now and I'll have nothing to look up but a few one liner method descriptions. No thanks.
* As Cal Henderson said in his I hate Django talk, 90% of the framework is right and speedy to develop on - hacking around the stuff that's wrong takes time, but few people even get there in their projects.
* PHP sucks (You're still okay, php). PHP's docs suck. Save yourself the time and pain of learning poor functional design tips on php.net, almost any framework now will help you to separate concerns of your project. Best practices are not PHP's strong point - Have a look at almost any web designer's "well made" code and you'll see that PHP simply doesn't teach SoC.
* You usually get XSS, SQL injection and CSRF protection in a framework. nuff said.
* Unless database mapping is what you know and do for a living, the database abstraction layer that you build will not be as good as the ones that already exist. It's a rule.
I used to be a stubborn framework hater, but after using a framework for a few projects, I'll never be back unless there's some impossible performance or disk space consideration. Pick one and learn to love it.
- soulclap 16y agoPHP's docs suck? Seriously? I think the php.net docs outshines the available official documentation for all other languages I've worked with, especially because of the user comments on all the functions. Sure, some of them are outdated but they've saved me from not-so-obvious pitfalls or provided a nice starting point for helper functions more than a few times. Don't want to front or anything, just wondering why you don't like the docs. I agree there could be better documentation for the classes that PHP and the SPL provides though.