I'm aware of the benefits of using a PHP framework (not first hand though, just by reading SO, etc.) But what I don't hear about is the amount of "unlearning" a framework requires. When using a framework, you hand control to the new framework and you have to "unlearn" many things and re-learn them the new way as your new framework requires. Is this true, and which framework is most flexible when it comes to this unlearning aspect?
Not really, it just depends on what/how you've learned something.
It also depends on the particular framework, some add useful functions and tips, while others suggest (or force) you to use different forms of development, filestructures, and functions.
In php, for example, you still can do pre_replace('[A-Za-z]',$user.name), would still work, but is_alphabetical($user.name) would do the same thing.
You still can use the same functions, but some frameworks require you to rework your program's structure, while others just provide helpers, functions, and database classes to use.
I've heard that http://codeigniter.com/ is the most augmenting framework, flexible when it comes to program structure, while http://cakephp.org/ is much more opinionated.
It's not like ruby on rails or django where you would learn a total new language, you still have and can use php, but it's best to stick with good programming principles with the framework, instead of work around them with php.
I think this is why zend and symphony are so good: you can use what you want/need. So you do not have to un-learn anything..
(although after you start you keep adding more and more elements in your app-logic)
That might be true in case you're already using a framework and consider switching to another one. Frameworks tend to differ in the way common tasks are realized.
If you're not using a framework yet, you will "unlearn" only things that are cumbersome and complicated to implement manually. It is supposed to simplify your programming so go ahead and give it a try.
I'd say it's less unlearning and more learning to do things in a different way. A framework like Zend is more flexible in that it allows you to do things in almost any way you like and just use bits and pieces of the framework when you want to. A framework like Cake OTOH is more rigid and will force you more to learn to do things The Cake Way™; but The Old Ways will probably still work in most cases, albeit being sub-optimal.
As the saying goes, “There's still PHP in CakePHP” (and in Zend, and CodeIgniter). Meaning, any PHP code will run, there aren't too many cases were the framework is blocking you from doing specific things. Switching from PHP to another language would require a lot more unlearning.
When you start to learn a framework you'll gradually pick up different, more efficient ways of doing things, you won't have to forget everything you know right away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With