View Full Version : The maintainability of PHP code.
DerMensch
09-26-2008, 06:21 AM
I didn't know where to put a thread of this nature, which is why I put it here :) . Feel free to move it to a more appropriate location.
Hi. I had a conversation with someone I know that has more PHP experience than I do. In his opinion, PHP is not one of the better programming languages for the web. The reason is that when site/project becomes too big, it becomes unmaintainable and PHP makes it a pain to change things. In his opinion, Python does a much better job in terms of serving as a development languages for web-pages.
I'd like to hear your opinions and experiences on this issue. Have you ever had to write a massive project in PHP and then had to make changes to it? How well did that go? What about when you had to make changes to someone else's code? Was it a total nightmare?
PHP can be made maintainable, but the usual problem is that PHP don't force you to do so as meny other server side languages do.
This makes it extremely easy language to start with, so web is full of PHP developers who know nothing about real program developement thus making it unmaintainable in a long run.
DerMensch
09-26-2008, 04:09 PM
PHP can be made maintainable, but the usual problem is that PHP don't force you to do so as meny other server side languages do.
This makes it extremely easy language to start with, so web is full of PHP developers who know nothing about real program developement thus making it unmaintainable in a long run.
Any good guidelines or standards out there that I can use?
Amen to that, Vege.
I used to think ASP.NET would provide a better environment in this sense, because it's OOP (well, PHP has OOP too, but that's a pain in the ass if you ask me). After all, though, OOP isn't but modularity taken to a higher degree. Just follow the spirit of modularity; wrap your code with a clear interface, reuse, create dependencies - for example if you ahve to do the same thing in several places put the code in one function, so that by changing one line you affect all the client code.
I think there is no "naturally mantainable" language. It's the developper who has to put his effort into making the code mantainable.
paul_norman_81
09-27-2008, 07:01 AM
Any good PHP framework will promote good working practices. Some will force them, and some will not. I personally like Zend which has all of the features, but no forceful methods. Symfony, CodeIgniter or Cake are other good choices if you want to have a more rigid framework to work with - personally I find they take too much of the skill away from the coder...
Horus_Kol
09-27-2008, 08:54 PM
The maintainability of any programming/scripting language is only as good as the discipline of the person writing the code... I've yet to see any language that breaks this rule.
The biggest issue of maintainability is how easy it is for someone new to join a project and understand the code and programme as laid out in front of them - so using a framework is certainly a good idea - especially one that decouples data, programme, and interface.
Using a standard/open framework like Symfony or Cake ensures that people outside of your group can come in and work on it with relatively little time spent on figuring where stuff is...
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.