Jump to content

best way to write php application


ziqmacom

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.