The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Does PHP work well for fairly complex business logic?

If I am developing a fairly completed app - like an ERP or something - is PHP the wrong language to choose?

I am concerned about maintainability.
Monday, October 08, 2007
I think PHP is a mature language and there are a lot of complex applications out there that makes use of it. For example the CMS system, Drupal uses it. Some of the web hosting reseller management systems use it. I think in terms of maintainability it all boils down on how the application is written and not in the language/scripting tool used.
Phillip Flores Send private email
Monday, October 08, 2007
Hi Walterbyrd,

I'm not an expert PHP programmer but as far as I know PHP (since version 5) is a very good programming language.

Any software project can be developed poorly in any language just as any software project can be developed well in "most" languages.

If you plan, structure, document and have good testing procedures I believe PHP is good choice.

Look at some of the large open source PHP products to see how they structure their projects. 

Your experience and the requirements of the project probably need to be taken into consideration when requesting feedback on the suitability of a technology.
Ray Smith Send private email
Monday, October 08, 2007
If it's poorly designed, it doesn't matter the language.

If it's well-designed PHP, then you shouldn't have a problem at all.  Check out the frameworks and see what you think.  I use the Zend Framework personally.
KC Send private email
Monday, October 08, 2007
This is an interesting blog on the creator of CD Baby's experience with PHP.

His PHP code was such a mess (100k+ lines), he thought Rails was the answer so spent 2 years (working with a highly regarded Rails expert) trying to get Rails to do what he needed it to do and then realized if he just designed his code better in PHP (12k lines) it did everything he needed.

So, moral of the story, as long as you architect appropriately, most languages can handle everything.... except perhaps Rails... ;)

Tuesday, October 09, 2007 and use PHP together with Oracle. Google for PHP and Zendcore.

They seem to be quite satisfied with their choice.
Kasperl Send private email
Tuesday, October 09, 2007
I've worked with some very large PHP codebases (many millions of lines) for very high-traffic/large installations.  It gets the job done (5 is a big leap over 4) well enough.  As with any programming language the quality of the product depends more on the diligent craftsmanship of the engineers working on it than the language itself.  A good MVC framework(1), a good ORM or similar reasonable data layer(2), conscientious use of documentation and unit testing(3), a sane build system (4), and you'll probably have a good code base for the typical business CRUD/reporting(5) app.

If you mean something specific like a rules engine when you say complex business logic, I'm not aware of any php versions of same but the community moves pretty quickly and I haven't directly touched php in about 18 months.  (I've been doing more java and perl.)

some examples, haven't tried them all personally:
(1) many candidates, e.g. cake or symfony (sp?)
(2) propel, creole, pear db, PDO...
(3) phpdoc, phpunit
(4) phing (ant clone)
(5) jpgraph, spreadsheet_excel_writer classes in pear, various pdf libs
son of anon
Tuesday, October 09, 2007
There's no reason why PHP can't do this kind of thing as well as any language, but the fact that you're asking whether PHP is any good for this task suggests that you don't have a lot of PHP experience.  If that's the case, you might be better off using a language you _do_ have a lot of experience with.
Tuesday, October 09, 2007
There is only one question you should ask. Is it easy to unit test?
PeterR Send private email
Friday, October 12, 2007
You mean that the ease of unit testing is the only characteristic of software that matters? Seriously? WTF. It's easy to unit test asm but that would be my last choice for web programming.

So much ignorant zealotry around here lately.
Friday, October 12, 2007
Easy to unit test is the only question to determining the programming language?  Are you sure about this?

Wouldn't the ability to unit test depend on how the software was designed, not the language used?

Saturday, October 13, 2007
" and use PHP together with Oracle. Google for PHP and Zendcore."

Facebook, Digg, Yahoo, Flickr, Gaia Online, Wikipedia, etc.
KC Send private email
Sunday, October 14, 2007
Ray Smith said to document and plan your application first and it'll be robust. I agree. One thing to remember about PHP and some other 'scripting' languages like Perl is the use of default variables or default values. Since they are not explicitly declared, they can be overlooked and make your code hard to understand. Explicitly putting in variables is a form of documentation inside the code.
Wednesday, October 17, 2007
Monday, October 22, 2007

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz