ziqmacom Posted July 27, 2011 Share Posted July 27, 2011 i am intermediate php programmer and i want to know Which way is the best way to write a php application? frameworks?(zend Framework , cakephp , symfony , . . ) or write my own php framework? sorry for bad english Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/ Share on other sites More sharing options...
zeeman48 Posted July 28, 2011 Share Posted July 28, 2011 There is no best way, really. It's all up to you. Some practices are probably better than others (in terms of how you write and document your code, handle databasing, user systems, etc.) but there is no one "magic bullet" method that, upon adoption, will automatically make your code inherently better than code written any other way. Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/#findComment-1248277 Share on other sites More sharing options...
gizmola Posted July 28, 2011 Share Posted July 28, 2011 There is no best way, really. It's all up to you. Some practices are probably better than others (in terms of how you write and document your code, handle databasing, user systems, etc.) but there is no one "magic bullet" method that, upon adoption, will automatically make your code inherently better than code written any other way. If you don't know any better than you are certainly better off going with one of the top php frameworks. At present I feel it's a tossup between zend framework and symfony. There is a bit of transition going on with symfony as they are knee deep in a ground up rewrite for version 2.0. It's best to learn the rules, and then break them when you understand why. Of course if you're talking about a couple of form pages a framework is overkill, but for an intermediate developer who wants to learn about best practices frameworks are the way to go. Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/#findComment-1248309 Share on other sites More sharing options...
ziqmacom Posted July 28, 2011 Author Share Posted July 28, 2011 thanks for reply i write my own MVC framework and i know the MVC frameworks what they do. i know OOP , inheritance , MVC pattern. and i want to know what is next level or pratice? Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/#findComment-1248339 Share on other sites More sharing options...
gizmola Posted July 28, 2011 Share Posted July 28, 2011 There are a lot of different ways to accomplish MVC. There are also many other design patterns beyond MVC. There are entire philosophies that can be brought into play, for example, "Dependency Injection". The best frameworks and libraries tend to use established design patterns. Several that I know of (including Symfony 2) are highly focused on Dependency Injection. Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/#findComment-1248354 Share on other sites More sharing options...
Andy-H Posted July 28, 2011 Share Posted July 28, 2011 I don't see the obsession with frameworks, I mean, I understand that you don't need to know how the underlying code works, you just need to know how to work or manipulate the implementation. And of course you could read through all the framework code and get an understanding of it, but personally, I'd rather write the code myself, that way I know exactly how everything works. At work I use a mixture of OOP and procedural code, like I use a mysql class that extends an abstract_db class, and a usercontrols class for generic user management/login/registering and I wrote them all myself, but I prefer to write procedural code in all honesty. Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/#findComment-1248765 Share on other sites More sharing options...
Ninjakreborn Posted July 29, 2011 Share Posted July 29, 2011 I generally use my own, or Codeignitor. I have been hearing too much about Symfony lately...I might play with it this weekend. Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/#findComment-1248860 Share on other sites More sharing options...
gizmola Posted July 29, 2011 Share Posted July 29, 2011 I don't see the obsession with frameworks, I mean, I understand that you don't need to know how the underlying code works, you just need to know how to work or manipulate the implementation. And of course you could read through all the framework code and get an understanding of it, but personally, I'd rather write the code myself, that way I know exactly how everything works. At work I use a mixture of OOP and procedural code, like I use a mysql class that extends an abstract_db class, and a usercontrols class for generic user management/login/registering and I wrote them all myself, but I prefer to write procedural code in all honesty. The obsession with frameworks is the same as the obsession with trying to not reinvent the wheel. It's really that simple. Quote Link to comment https://forums.phpfreaks.com/topic/243024-best-way-to-write-php-application/#findComment-1249192 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.