Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
PHP Programming

PHP Usage in the Enterprise 325

acostin writes "Some open survey results were published about PHP usage in the enterprise on the InterAKT site. An alternative survey on the PHP open source mouvement can be found on Zend site. See how we've evaluated the PHP market size($$$), what people think about PHP as an alternative to Java and .NET, and what should be done in order to have your large clients adopt open source solutions."
This discussion has been archived. No new comments can be posted.

PHP Usage in the Enterprise

Comments Filter:
  • Yahoo (Score:5, Informative)

    by AmVidia HQ ( 572086 ) <gfung@meTOKYO.com minus city> on Saturday September 20, 2003 @02:10AM (#7010543) Homepage
    is the prime enterprise use example (although they still use legacy, prepritary web programming based on C, all their new developments are run on PHP and BSD, correct me if i'm wrong)

    I worked in a small shop, the web app isn't mission critical stuff like banking, but it wasn't "brainless dump data from Mysql". I was lucky that my boss was totally not picky about languages, as long as it gets the job done. But if I have anyone I work with that doubts the power and simplicity of PHP, Yahoo would be my example.

    And so far, developing on the so called LAMP platform, I love PHP and would use it for any and all web development. It can be used as a quick hack (an argument always used against PHP btw, that it's only good for a quick hack and not for professional use), OR you can code it like a pro with objects et al. I was not impressed by Mysql however, it is by no means stable (this is v 4.0.13), but that's another topic.

    My sig is my personal pet project using PHP
  • Coolest language (Score:4, Informative)

    by linuxperformer ( 642564 ) on Saturday September 20, 2003 @02:33AM (#7010586)
    PHP is the coolest language for Web development today. It provides the features of Perl but designed to be a Web development language. PHP is my primary choice if the applications doesn't demand complicated business abstractions (Java scores in such situations). Using an accelerator like ionCube [ioncube.com] will be icing-on-the-cake.
  • by Anonymous Coward on Saturday September 20, 2003 @02:39AM (#7010596)

    No class attributes, only instance attributes

    Not a big deal. Just constants or globals that are prefixed with the class name (seriously, it works fine in practice).

    No namespaces (and they were dropped from PHP 5).

    See above.

    OOP sucks.

    Yes, parts of PHP do stink, I'd love to never see a "&" again, though I think I've mostly figured it out. Also inheritance and constructors is a bit ugly. That will be fixed in PHP5.

    No exception handling.

    This is a big problem. Actually the only "real" problem on your list, imo. What I usually do is just die() right then and there.

    Type handling is a nightmare, sure, they make it real easy for the newbies to use numbers-in-strings as numbers, but when you're not a newbie, you begin to run into issues where it's expecting you to be stupid and as a result ends up being stupid itself, and causing you to write disgusting checks just to make sure things are sane.

    I actually like the way it converts strings and numbers. Just be sure not to test them as booleans and you won't run into too many problems. Since your data is usually coming from outside, you better have pages of disgusting checks to begin with!

    Also, if anyone knows of any projects (with source available) written in PHP that are designed well, I would be interested to hear of them.

    PEAR (pear.php.net) is a nice library for PHP. I enjoyed looking through the source code for inspiration. Sure, it's not Python (or Ruby, my fav) but it's readable and uses good practices for php.

    Also, there is a site with patterns in PHP, google for it.

    Also also, there is PHPUnit framework for unit testing. Not exactly JUnit (no exception handling!!) but I have been using it with "test-first" development, and churning out very nice PHP code.

    I used to hate PHP because of the lax security, but I think it has a lot of potential as a "lite" language that can handle big projects. My boss loves it because he understands it, I like it because of the objects.

  • Re:Hack-away (Score:2, Informative)

    by acostin ( 229653 ) on Saturday September 20, 2003 @03:24AM (#7010690) Homepage
    I know that you're somewhat joking, but I would have liked the market share questions from InterAKT to have included not just .NET, J2EE, or ColdFusion, but have also included other languages like Perl and Python (although Python is indeed the base language for Zope).

    We have indeed included comparision with Perl and Python (Zope) here [interakt.ro]
    It's in the "Why you've lost" section of the survey, as seen through the eyes of the PHP developer :)
  • Re:PHP is ok but... (Score:2, Informative)

    by acostin ( 229653 ) on Saturday September 20, 2003 @03:46AM (#7010732) Homepage
    As for maintainability,

    I have seen huge cumbersome application servers built around PHP that are a nightmare to maintain without having intimate familiarity with the code of the application server

    We have met the same problem indeed with PHP application, caused by the mix of application logic and presentation layer... PHP is good and very easy to setup and create a site, but maintaining a large PHP application can be *nightmare*.

    As we've met the same problems, we try to offer a free platform for a PHP MVC platform - Krysalis [interakt.ro]. Krysalis - it's a platform (inspired from Cocoon2) to allow content publishing using XML as the data representation mode and XSL to add the presentation layer on it. It also includes a MVC (Model View Controller) implementation to allow you to fit how web requests are served from your site.

    Krysalis includes some features for authentication, validation and dynamic XML generation, and also includes a lot of (what our marketing department likes to call) "enterprise level" code techniques - that is taglib code reuse (in the application logic and presentation layer), etc.
    As far as I know, we have closed to Struts in terms of taglibs and controller definitions, and we are continuing this way

    Another interesting features integrated in the Krysalis core are the caching mechanisms. Being a pretty abstract architecture where flexibility is a must and everything is defined using XML, we needed a very powerful way to transform those XML definitions into pure executable PHP code. We have started with PEAR cache but it was not up to the task, so we've come with our own cache implementation, that keeps the generated PHP code on the disk in a require (this way the generated file can be also compiled when using a PHP Accelerator).

    We have very large applications built on Krysalis (CMS systems or Intranets), and they are very easy to maintain even if they were hard to architect and create - as they use for 10 installation a single core and the differences in the applications are handled through smart Controller techniques - so we have a very powerful and usable way of separating the application logic from the presentation layer.

  • Smarty + PHP5 (Score:5, Informative)

    by TheInternet ( 35082 ) on Saturday September 20, 2003 @04:32AM (#7010807) Homepage Journal
    I have seen huge cumbersome application servers built around PHP that are a nightmare to maintain

    This problem doesn't discriminate by language. :) Perhaps it's more common in PHP because the barrier to entry is lower.

    My guess is that PHP needs a better OO design (and no, PHP5 is not it, yet)

    I think you could argue PHP5's OO design is good enough, or just as easily argue that it's not. I'm curious, though, what your main complaints wants with it are.

    better seperation of logic and presentation for larger systems

    I was looking for this for quite a while and then found Smarty [php.net]. At first, it seemed so simple that I disregarded it as being glorified search-and-replace templates. The temptation is to think "I can just do that by echo variables inline." But truth is, there's much more to it than that. After giving it a fair shake, I've discovered that it's an incredible useful, clever design. It's much more functional than it seems on the surface. It made PHP substantially more useful to me.

    Between PHP5 and Smarty, I think there's a pretty good basic core toolset to work with. I actually think Java tries too hard in certain areas -- too many features, too much syntax, too heavy-handed typing system, too much complication. But no question it has its merits.

    - Scott
  • by Tablizer ( 95088 ) on Saturday September 20, 2003 @05:33AM (#7010938) Journal
    One thing you should keep in mind about programs from MS is that although they are crap, they offer someone you can speak to on the phone 24/7 as opposed to us geeks chopping things up or....

    If you are willing to pay big money (just like with the wallet-sucking MS and Oracle "gold" support contracts), I am pretty sure you can find 24/7 support for open-source. Besides, MS support has never had a reputation for quality and fast turnaround. Anybody suggest some support vendors for PHP?

    Seems like every other month some new and improved programming language comes along and becomes the standard or some future standard. From a business point of view, I would rather go with what is established as opposed to what is promising.

    PHP predates ASP I believe, and certainly predates .NET.
  • by joaorf ( 695907 ) on Saturday September 20, 2003 @05:38AM (#7010940)
    It completely lacks exception handling

    That's not true, as you may see here [php.net].

  • PHP !~ .NET or JAVA (Score:1, Informative)

    by boatboy ( 549643 ) on Saturday September 20, 2003 @09:36AM (#7011455) Homepage
    PHP is more analagous to ASP or JSP, not .NET or JAVA. It is a scripting language, like ASP (VBScript) and JSP (JScript). .NET and JAVA are compiled, even in ASP.NET. Sure, there's cross over- you could do classes in ASP, and can in later PHPs- but the whole thing is interpreted and run at each request.
  • Re:J2EE is not slow (Score:5, Informative)

    by abulafia ( 7826 ) on Saturday September 20, 2003 @10:06AM (#7011577)
    tell me currently one far better system to program web-application with.

    Perl, baby.

    I don't want to turn things religious, so here are concrete reasons why we use perl in almost all cases (we're a small development/business consulting firm):

    - Rapid development
    We can bang out the shell of a new web application in an afternoon, including (depending on what the app actually is) session handling, security model, shopping cart, workflow, revision history, etc. This includes the interface.

    - Speed
    mod_perl rocks. In the rare case when something is actually slow in perl, we either (depending on what's appropriate) write a database extension in a procedural language (if the issue is speed, usually C), or a perl XS extension. But this rarely happens.

    - CPAN
    The mistake I make the most when coding is rewriting something that is already on CPAN. Enough said.

    - Text processing
    I know of no other language that supports text processing more naturally than Perl. The way regexes are an inherent part of the language rather than a bolted-on extension makes me want to chew my arm off when I am using them in another language. And what is web programming, other than overglorified text processing?

    - HTML::Mason
    The nicest web application framework I've ever worked with. The development model and application flow is incredibly well thought out. The little "gotchas" wherein one has to do something strange are orders of magnitude fewer than every other framework I've worked with.


    - Business doesn't afford Perl the same respect that it does Java.
    True, to some extent. We do Java work as well, and have converted some customers to Perl when they approach large transitions, once they see the cost savings and the fact that there's no real downside. And small business is extremely receptive, especially to the cost factor.

    - Many people don't like Perl.
    Religious issue. Sure, it is possible to write unmaintainable perl. [insert I can do that in any language here.] My personal opinion, when looking at a lot of PHP out there, is that the slightly lower barrier to entry causes a lot of truly horrible PHP to be distributed - the ugly code factor is as easy to get in PHP as it is in Perl. And don't get me started on some of the JSP I've seen... I can't speak for other shops, but we keep a clean separation between library code and interface code, and come back to projects we did years ago when someone wants a change with little difficulty.

    - Market share
    Perl isn't the front runner. So what? It has a strong, vibrant and helpful community, there's plenty of documentation, and it sure as hell isn't dying. If other people don't get the faith, that's a market advantage for me...

    - Doesn't enforce large development environment practices
    Correct. It certainly does support them, but they are not enforced to the extent they are in other languages. For some, this is a downside. For me, this just means the language scales from a two minute script to save repetitive labor up through massive projects. If a coder can't follow architectural practices defined by the company, that's not the language's fault. And PHP certainly doesn't, either.

    In any case, this rant went longer than I intended. I say, use whatever you like. Different minds work in different ways. Remember that paper (I forget who wrote it) about the huge market advantage web programming in Lisp gave his company?

  • Re:J2EE is not slow (Score:2, Informative)

    by aytekin ( 266652 ) on Saturday September 20, 2003 @11:04AM (#7011821)
    Remember that paper (I forget who wrote it) about the huge market advantage web programming in Lisp gave his company?

    You mean Beating the Averages by Paul Graham [paulgraham.com].

  • by brianlmoon ( 322719 ) on Saturday September 20, 2003 @11:10PM (#7015223) Homepage
    > Also, if anyone knows of any projects
    > (with source available) written in PHP
    > that are designed well, I would be
    > interested to hear of them.


Neutrinos have bad breadth.