What are the advantages/disadvantages of using a PHP framework over just writing direct PHP code?
A:
As noted by Tomas and Ngu, the your question is duplicate.
What I'd recommend, that you first read what web framework is. http://en.wikipedia.org/wiki/Web_application_framework
vartec
2009-03-11 15:26:33
A:
A framework gives you standard solutions to typical problems, e.g. for an online shop that can cover the functionality for a customer login (including session handling), a shopping cart, placing orders...
The big advantage is that
- You don't need to reinvent the wheel, the code is already there
- The code (usually) works, it is already tested
- Specifically for user authentication, you will most probably have fewer security leaks as if you invented something from scratch yourself
The bis disadvantage is that
- If you want to extend the functionality, you have to understand OPC (other peoples code)
- If the framework contains a security hole and an exploit is available, your site is immediately vulnerable, but you may not have the knowledge to fix it yourself. So you need to keep a constant lookout on security bulletins, updates, fixes etc.
Treb
2009-03-11 15:27:07
A:
A framework is a library. You have an investment of time to learn how to use a library, but once you know how it works, you should get back your investment many times.
A PHP web framework applies this principle to all the common things you do when you produce a (usually database driven) website with PHP.