Slashdot Mirror


PHP Usage in the Enterprise

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."

54 of 325 comments (clear)

  1. Hack-away by mondainx · · Score: 3, Funny

    For those of you that hate M$ and dont want to learn Java, its perfect.

    --

    The early bird gets the worm, but the second mouse gets the cheese!
    1. Re:Hack-away by jacksonyee · · Score: 5, Insightful

      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). There are still a very large amount of websites built in Perl these days, with Slashdot being one of the most famous. Zend's survey does a bit more to explore the languages that programmers "are familiar with," but does little to see how the competition for PHP is doing.

      PHP's great to use for me because it's simple, powerful, and readily available in cheap hosting environments. If Zope, ColdFusion, or J2EE had more availability or less cost, then I would try those as well, but there's something to be said for being able to sign up for a $9/month account and downloading Apache, PHP, and MySQL all without paying for anything other than bandwidth costs. You still can't really compare PHP to the enterprise level of .NET or JSP at this point though, since many features like persistent objects in shared memory really can't be done well in PHP, and I haven't heard anything else about PHP 5 other than further enhancements to the objects and reference systems. PHP-Accelerator gives a great boost to the speed, but I'd really like to see native compilation built into the distribution rather than downloaded separatedly.

      All in all though, PHP's a great language for quick development of small to medium sized websites. As the old caveat reads though, use the right tool for the job.

    2. Re:Hack-away by acostin · · Score: 2, Informative

      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
      It's in the "Why you've lost" section of the survey, as seen through the eyes of the PHP developer :)
      Alexandru

    3. Re:Hack-away by jorleif · · Score: 2, Interesting

      Did you build the entire application in PHP, or only the "presentation layer"? I mean was there any Java in it, for instance in the database layer?

      As a PHP-developer who maintains a fairly large site and intranet I've come to both love and hate PHP. Love it for it's development speed and ease. Hate it for its lack of static analysis, I mean yes the language is dynamically type-checked but that doesn't mean the interpreter couldn't check whether some code calls undefined functions or defined functions with the wrong amount of arguments at parse time so it would catch these errors without one having to test every code-path.

      That and then the scoping absolutely terrible but most people know that already. That said I still believe PHP is a better solution than Java on the whole. Neither is really optimal but both are fairly good.

  2. php in a microsoft shop? by ozric99 · · Score: 4, Interesting
    I work in a large, predominately MS, corp. I'd say that a good 80% of our boxes are running some variant of Windows - obviously there are the mainframes, and a fair few Solaris/legacy boxes dotted around. The PHBs here view php as something "geeky" that isn't suited for business. I'm sure they'd lap it up in a second if it were called MS Visual php Studio, however.

    What problems have people had in trying to migrate their applications to php, and how did you overcome them? How would you sell php to your boss? Bearing in mind most of our applications aren't simple database-driven (and I used that word hesitantly!) ones like Slashdot - hint: banking and insurance sector.

    1. Re:php in a microsoft shop? by hamster+foo · · Score: 2, Insightful

      Regarding the migration. Does it actually provide any benefits? I'm not talking arguments like it being open source or cross platform etc. Does it provide REAL benefits for your situation? If it does, then that's the first step to selling to your boss. If you can justify it to yourself, then most of the reasons should translate into a pretty good reason for him to agree.

      If it saves you time that translates into money saved for him, as well as, more time for his work force to focus on other issues. If it's better suited for your applications, then it should be easy to show that to him in some form of improvement that he can see and that he would appreciate.

      You've gotta think if you walk in and show him how PHP will save him X dollars and allow Y increase in productivity then he's going to pay attention to that. If it won't increase these, then from a business standpoint, there's not a lot of reason for him to change.

      --
      - b
    2. Re:php in a microsoft shop? by NightSpots · · Score: 5, Interesting

      You're absolutely crazy if you want to use PHP for banking and insurance apps.

      It's security record is horrible.
      It's security model is a joke.
      It's object model is worthless compared to real OOP languages.
      It completely lacks exception handling, which makes rolling back partial transactions (etc) impossible in banking scenarios.
      It's developers regularly break POLA on minor version increments.
      It's database support is mediocre at best: third party classes are currently the best (but not only) DB interface PHP has.

      Stick with .NET or J2EE. They're clunky, .NET is expensive, J2EE is slow, but they're both leaps and bounds ahead of PHP.

    3. Re:php in a microsoft shop? by segment · · Score: 4, Insightful

      The PHBs here view php as something "geeky" that isn't suited for business. I'm sure they'd lap it up in a second if it were called MS Visual php Studio, however.

      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 finding a forum, or jumping on irc to fix things up or create something. Microsoft is pretty and CTO's, CEO's, CFP's etc., need to be able to understand a product somewhat. I've used PHP for some time, and from my perspective is, there are too many hands in the pot spoiling the food.

      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. Promising isn't going to speak to a CTO through some task should his IT department walk out. Aside from that, standards already around are accompanied by people who get certified to perform these tasks. Now we know not all certs mean squat, but it's easier to find people who follow standards than those who follow promise.

    4. Re:php in a microsoft shop? by Tablizer · · Score: 2, Informative

      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.

    5. Re:php in a microsoft shop? by joaorf · · Score: 2, Informative
      It completely lacks exception handling


      That's not true, as you may see here.

  3. You would think by gonerill · · Score: 5, Funny

    PHP usage in the enterprise

    that by the 23rd century they would have left PHP behind.

    Or maybe it just shows the durability of opens source software.

  4. Love PHP! by whereiswaldo · · Score: 4, Interesting

    I really enjoy using PHP for web development. I find that you can't beat scripting languages for ease of maintenance, quick turnaround time, and tweakability.

    One of the big reasons I chose PHP was the availability of "LAMP": Linux, Apache, MySQL, PHP. I know these technologies have been around for years and will be around for many more years, so it's an easy sell to management. There's plenty of talk on the newgroups if you ever get stuck and PHP's online documentation with user comments is priceless. I think more documentation should follow this example.

    That aside, the pure performance and reliability of the above is excellent. These technologies were made to work together, and from what I hear the teams even collaborate to make sure their stuff stays working together. It really shows.

    Years ago I worked on ASP/SQL Server solutions and where you had to go with native code for high-performance with ASP, I find that with PHP it is high performance on its own.

    Great job to everyone who has helped put together these technology solutions. A shining example of the high quality that can come out of the collaborative efforts of many.

    1. Re:Love PHP! by prell · · Score: 2, Interesting

      PHP is decent, but its support of more linear, "c-like" code, is disconcerting. The object-oriented features are likewise minimized and somewhat poor. I would quickly use Python or Ruby in place of PHP, given the availability of sufficient support packages (eRuby, HTML templating, etc.). I do not really enjoy writing software in PHP.

      ASP is commendable for its exposure of certain classes to all "ASP-bridged languages," making available such interfaces as those that handle state data (such as sessions), and for its language "agnosticism," given that a bridge is written (from what I understand). I really believe strongly that the open-source community should develop an answer to ASP to allow any language to run in a certain capacity in relation to the web (again, HTML embedding, a standard "web" library to expose features such as state data in a standard way).

      PHP usage in an enterprise environment? It wouldn't be my choice for a substantial web application. Being OSS doesn't automatically make it a better choice.

    2. Re:Love PHP! by GundyRage · · Score: 2, Interesting

      "LAMP": Linux, Apache, MySQL, PHP

      Or in my case "LAMP": Linux, Apache, MONO, PostgreSQL.

      The truth is that it's sweet to have the right tool for the right job. Gotta love those options!

      G
  5. I've used it in the Enterprise by Henry+V+.009 · · Score: 3, Insightful

    PHP is a great tool, especially if you just plan to throw something together in no time flat. Start up MySQL with PHP and Apache and you have a rather full-featured system at an affordable price: $0. On the other hand, I have no idea on reliability figures for that mixture. Still, PHP is great to work with. Easiest interface in the world.

    (P.S. Lots of programmers in the Enterprise. Data and me were always slapping together code for that clunky thing. Cloaked Romulans? Yeah right--just software bugs in the sensory system. "Uh, Captain, they've gone cloaked again." "Damn! Those ships have that capability!?!" Works every time.)

  6. These surveys are lacking by Eponymous+Cowboy · · Score: 4, Insightful

    For both the Zend and InterAKT surveys, there are lots of raw numbers presented, but the interpretation is lacking. The commentaries on the InterAKT results are little more than "as you can see, such-and-such wedge of the pie is the largest," and there is no interpretation whatsoever on the Zend site.

    Of course, this is a cheap and easy way to conduct a survey (multiple-choice), but the results are almost meaningless if they can't be put into context. I would have preferred to have seen a hundred randomly-selected PHP developers interviewed, essay-style, about why they are using PHP, their thoughts on PHP versus other technologies, etc., and then have the results compiled into a journal-quality article supported by graphs and raw numbers. The important information isn't in those graphs; it cannot be enumerated and broken down into clean categories.

    Personally, I develop PHP sites because it's the fastest and simplest way I've found yet to publish dynamic web content. I've tried making sites with Java and .NET, and found both of them to be too far disconnected from the HTML that I'm trying to create. PHP provides an excellent blend of power, speed, simplicity, and directness.

    --
    It's hard for thee to kick against the pricks.
  7. Entrepreneurs by robogun · · Score: 2, Funny

    All I can say, judging by the links in the spam I'm getting lately, is that the spammers have jumped all over PHP. Each and every last goddamn one of them is using it to process their form responses.

  8. huh? by samantha · · Score: 4, Insightful

    What do we think about PHP as compared to Java and .net? What do we think about an grape as compared to a basketball and an egg? These are 3 quite different things. A HTML-generation targeted scripting language compared to a compiled general purpose language as compared to a distributed object and language framework is a pretty disparate set of things to compare.

  9. PHP is ok but... by theolein · · Score: 5, Insightful

    The language as it has been in most of it's 4.x.x iteration has been just about fine. Good for quick slap em together websites and small applications. But...

    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, such as Ampoliros or Ariadne, something which defeats the purpose of using such a large system in the first place. Such things really do work better with a OO by design language such as Java or ASP.Net (I assume, don't know .Net) where you can rely on the functionality of the objects without having to second guess the original developers.

    My guess is that PHP needs a better OO design (and no, PHP5 is not it, yet) and better seperation of logic and presentation for larger systems.

    But for smaller stuff, well it's hard to beat in terms of price and speed.

    1. Re:PHP is ok but... by acostin · · Score: 2, Informative

      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. 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.

      Alexandru

  10. Yahoo by AmVidia+HQ · · Score: 5, Informative

    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

    --
    VIVA1023.com | Political Fashion.
  11. Re:The code is the data! by mackstann · · Score: 5, Insightful

    Yeah..

    To write clean, well structured PHP, you really need to do some good design, use OOP, seperate content/formatting/logic/etc, and basically at that point, you're left with a half-ass OOP implementation, annoying pass by value, messy syntax, no exception handling, etc.

    PHP was meant for making relatively minor webpage hacks, and it shows. This still remains PHP's strong point; building enterprise applications (that are designed well) does NOT.

    Here's my list of bitches about PHP:

    * No class attributes, only instance attributes

    * No namespaces (and they were dropped from PHP 5). include()/require()'ing a file just dumps its namespace into the big happy global namespace, and it's a freaking nightmare.

    * OOP sucks. You have to litter &'s everywhere to get references, and lots of other problems that I'll refrain from typing out. Ok here's one -- how do you pass an instance method for use as a callback? Something like array($object, "method_name_in_a_string"). Good god.

    * No exception handling. Want to "handle" an error? Toss a @ in front of it, then you'll never see it. How helpful.

    * 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.

    And that's the root of the whole issue, I think. Things that bend over backwards to cater to newbies end up doing a shitty job for people who have a clue.

    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. I looked at a tiny bit of PHPMyAdmin's code just for kicks and was horrified. But that's not a valid judgement by any means. Again, I'm just interested to see if there are any out there (and have a look at them).

    And a last thing, I might be biased by knowing Python (but I knew PHP first!). Python tends to flow very naturally for me, and even big complex things just end up being big and complex, instead of big and complex and A COMPLETE FREAKING NIGHTMARE like big things in PHP tend to wind up (for me).

    Go Python! Death to PHP!

  12. The real comparison is against Cold Fusion by Black+Art · · Score: 4, Insightful

    Cold Fusion is also a web scripting language, but costs quite a bit.

    The last time I compared the two (admitedly a while ago) PHP had many more features and was the much better choice. (Even if they were priced the same, which they are not.)

    Even more telling is the amount of books available for each. There are seven Cold Fusion books still in print according to Amazon. (Most the same book for different versions of Cold Fusion.) A search for PHP gets 112 hits. (I am not certain how many are still in print. Much more than seven.)

    Comparing Java (a general purpose language) to PHP (a web scripting language) seems to be a bad comparison. Comparing it to .net (a proprietary collection of patent encumbered programs and methods) even more so.

    --
    "Trademarks are the heraldry of the new feudalism."
  13. AxKit, XML based sites even worse by Fastball · · Score: 4, Interesting

    When you've laid eyes on an Apache/AxKit driven site that uses XPathScript and XSLT, then we'll talk. You want completely unmaintainable content? First, you have XML files which somehow are supposed to respresent data. Nevermind that somebody is supposed to make some kind of heads or tails of these things. Second, you have either XPathScript (.xps) or XSLT (.xsl) which is somehow supposed to transform that XML into discernable HTML that a browser can use. In the case of XPathScript, you have an wacked hodgepodge of Perl and HTML. Nothing halfway understandable like an Embperl, Mason, or even Text::Template template or component. No, go look up XPathScript to see what I mean. XSLT stylesheets are no better.

    I want to believe in the XML's mission, but when I recently took up a migration of someone else's AxKit driven site, I haven't been able to get much sleep (it's 2:28am on a Friday night and I'm rebuilding a server to accomodate this goofy setup).

  14. Coolest language by linuxperformer · · Score: 4, Informative

    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 will be icing-on-the-cake.

  15. Re:The code is the data! by Anonymous Coward · · Score: 4, Informative

    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.

  16. Re:heh by Skim123 · · Score: 3, Interesting

    As a Web developer who has created Web applications in both PHP and ASP.NET, I can say, without hyperbole, that ASP.NET is one-million times better. Ok, so maybe there's a little hyperbole in there, and I know I'm just feeding a troll with this post, but I would wager that anyone with extensive experience with both PHP and ASP.NET would, at minimum, say ASP.NET is par with PHP, but would likely express that ASP.NET is better in a variety of areas. About the only negative for ASP.NET is its lack of cross-platformness, but with Mono and such, who knows how long this complaint will hold merit. Too, having Apache serve ASP.NET Web pages on a Windows box is something that is doable.

    --

    I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.

  17. why it will have trouble by b17bmbr · · Score: 2, Insightful

    i used perl almost exclusively, then had a couple of projects and used php. it was a dream to use. nice syntax, powerful built in functions, not super verbose like java nor bizarre like perl. you can cruft together a few pages or create a huge site. been there, done both. however, remember PHP is a templating language. designed to be so. so, it is not necesarily an OOP language, yet is is OO in nature. for instance, create different .php files and piece together your pages. as for security, use good programming skills. duh. for instance, keep your connections in separate files. then just include("connection.php"); that will help.

    that being established, it will have trouble being accepted as an enterprise tool because it is not backed by a company. java backed by sun, .NET by what's that company, i forgot. linux didn't really enter mainstream until IBM ponied up a billion. no matter how great a tool, it just seems cheap, and to businesses, they just won't "risk" it. sad. the other problem that php has it that it is esy to put together a good site, and easy to learn and use. java and .net are not. so, it seems like BASIC. you can't use that for serious apps.

    --
    My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
  18. This discussion is like so 1999 by Skim123 · · Score: 4, Insightful
    A more appropriate question, as another poster mentioned, is what's better: PHP, classic ASP, or Cold Fusion? Those are stand-alone scripting technologies. ASP.NET and JSP are more platform-based, providing true OOP, an impressive set of base classes, and so on.

    If you are interested in the scripting language comparison, see Server-Side Scripting Shootout.

    --

    I could not justify my existence if I were a turkey farmer. Would I terminate myself? Undoubtably, yes.

  19. Re:The code is the data! by mackstann · · Score: 3, Insightful

    The problem is that people *do* use it for these heavy duty tasks. "PHP Usage in the Enterprise"...

    It's like a lot of things: not bad, but grossly misused. Flash is not a bad technology. PDFs are not a bad technology. Javascript is not a bad technology. The problem is that people use them for all kinds of stuff that they shouldn't, and it winds up working like crap and annoying people.

  20. J2EE is not slow by Kunta+Kinte · · Score: 3, Interesting
    Stick with .NET or J2EE. They're clunky, .NET is expensive, J2EE is slow, but they're both leaps and bounds ahead of PHP.

    I can understand why people think that Java is slow, taking that Java GUI widgets are usually slower than native widgets on the desktop. But J2EE is not inheritably slow.

    Though there are clunkly J2EE apps out there, I'd wager on a hunch, that the average J2EE app would out-perform a same sized PHP app. If we add a PHP accelerator to the mix, like Turck MMCache, then PHP may have a fighting chance.

    But remember, J2EE compiles the web application only *once* at startup, and can also ( and probably does ) optimize for the specific processor that it's running on. PHP, without an accelerator compiles on every hit, and PHP can't optimize for the specific processor unless you have a good sysadmin.

    --
    Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
    1. Re:J2EE is not slow by jorleif · · Score: 2, Insightful

      You would probably use an accelerator on real projects anyway so the compile point doesn't count really.

      I've used PHP without an accelerator in all "real projects" and never had any performance problems on the PHP-side. For web-applications the bottleneck is mostly the database so most "PHP is slow" vs "Java is slow" arguments are fairly pointless. The real issues are more often development speed and robustness. Of course if you're going to implement some nifty algorithms Java might be a better choice, but why not write those in any language and make it a PHP-extension or some kind of server?

    2. Re:J2EE is not slow by TomV · · Score: 2, Insightful
      I can't begin to express just how useful, every day, I find the discipline I learned from my first boss in a proper computing job.

      Bill was an old-school, where's-my-schema, lets-see-the-docs-first, mainframe guy. And every time anyone would suggest any change to the systems we were building, Bill would ask:
      "What's the business case for that?"
      Superb. Must have heard that several times a day every day until I internalised it. We all get great ideas for our systems, perfectly technically valid inspirations. But where's the business case?

      If fast and easy is all that's needed, what's the business case for using J2EE? If complex transactionalised distributed business logic is what's needed, what's the business case for using PHP?

      TomV
    3. Re:J2EE is not slow by abulafia · · Score: 4, Informative
      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.

      Downsides:

      - 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?

      --
      I forget what 8 was for.
    4. Re:J2EE is not slow by aytekin · · Score: 2, Informative
      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.

  21. Re:The code is the data! by saden1 · · Score: 5, Interesting

    I used to think highly of PHP when I was using it for small tasks (creating a blog page and a half ass forum) but man oh man does it suck for doing big projects. In the enterprise marked, there really only one player I'd look to and that is Java. Everything else is really irrelevant. Yes Java has a steep learning curve but once you get ahead of the curve you are never going back to whatever you were using. Java + Eclipse is a deadly combination.

    --

    -----
    One is born into aristocracy, but mediocrity can only be achieved through hard work.
  22. Backend for PHP webapp? by Cyberax · · Score: 4, Insightful

    .NET has COM+ for backend systems, Java has EJB, but PHP has nothing :( I can't use distributed transactions, transparent failover, declarative security and transaction demarcation in PHP.

  23. SST & edrugtrader (nice combo, btw) by Anthony+Boyd · · Score: 4, Interesting

    When I joined the IT department at SST (a fabless chip manufacturer), they were 100% MS. I said I would be using PHP or they would be hiring someone else. They hired me, so I went hog-wild. I hired on the guy who built edrugtrader.com, the guy who built beerotopia, and one of the developers of Yube (which is/was a primarily Java shop). We've built up a massive intranet product in PHP. It's modular, with 196 files all interoperating nicely. Thanks to our Yube guy, it's object-oriented in the most-reused parts. It has areas for file management, posting news, creating new Web pages with a built-in GUI editor (thanks HTMLArea!), org charts, a task management system, a budgeting tool, employee evaluation systems, a signoff system with escalations & delegates, a form builder, and a lot more. On a day when we post earnings, the intranet can see just as much traffic as the public site. We've sustained over 100 requests/second in a few spots, and done just fine. I know that's not Yahoo-size numbers, but it's not "small" either, I don't think. If it is small, I know that edrugtrader sees many times more traffic and performs well. So no qualms there.

    The problems we've had with PHP were small in number and quickly resolved. First, 4.3.2 had a bug that resulted in blank pages displaying intermittently to our users. That sucked, but 4.3.3 fixed it. And way back about 3 years ago as we started the site, we had to increase the memory allotment for just about everything -- we had some big processes with hundreds of queries getting read into PHP arrays, and we hit the default memory limits pretty quick. Other than that, no problems. Development is quick, often easy, usually fun. If we need to go OOP, that's fine. If we need to do simple templating, that's fine too. And increasingly, we're using it outside of the Web. We have a dozen cron jobs now that are all PHP scripts. Some things, especially screen scraping and working with mailboxes, still need to be done in Perl. But lots of server management stuff -- filesystem work, data dumps, monitoring -- seems to be going along fine with PHP nowadays. I'm pretty happy to have bet my career on PHP so far.

  24. Re:The code is the data! by forevermore · · Score: 2, Insightful
    * No exception handling. Want to "handle" an error? Toss a @ in front of it, then you'll never see it. How helpful.

    Then what's the set_error_handler() function for?

    I have to agree about the OOP, though. I wrote a pretty large-scale ecommerce project in php, though, and it took me about 1/5 the time it would have taken in perl.

    --
    Do you really need reason for beer? Wingman Brewers
  25. Smarty + PHP5 by TheInternet · · Score: 4, Informative

    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. 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

    --
    Scott Stevenson
    Tree House Ideas
  26. Re:The code is the data! by jorleif · · Score: 4, Interesting
    Exceptions are required for enterprise quality applications.
    I'm not saying this is some ultimate solution, I've also missed exceptions badly, but if the application needs exception handling only in a few places it's quite simple to simulate them:
    1. Wrap the function which throws the exception in a class
    2. If the exceptional condition occurs have the function set a description in an instance field named for instance "exception" and then return
    3. The client code calls the "getException"-method in the class of the function throwing exceptions
    4. If exceptions occured, deal with them, otherwise proceed

    Far from beautiful, but you know a lot of "enterprise applications" have been written in COBOL, Fortran or C which none of them has exception handling AFAIK (if gotos don't count).
  27. Re:The code is the data! by jadavis · · Score: 2, Insightful

    Exceptions are required for enterprise quality applications.

    I don't think that they're required, look at perl & C.

    PHP definitely has some issues.

    * By the time you're done coding it right, it's as long as similar C code
    * Exceptions are a very nice way to handle things properly and concisely, and die() is certainly not a solution.
    * Not easy to contrain variables to a type (type contraints are essential for any good database, why not for a language?), i.e. you can't cast a variable without doing something ugly like settype($x,"integer"), which modifies the argument.
    * Not good class/object support, no namespaces
    * Include()/require() are weak

    Let's face it: PHP's strength is not the language, it's not the library, it's the platform!

    PHP makes a nice template language that helps you organize simple web apps in a simple way, quickly. It's nice for a sysadmin of a virtualhost (it allows safe mode operation and enforces it's own limits on RAM & CPU). PHP knows what it takes to write a web app, and it puts everything right in front of you, and that's what's good about it, the platform.

    So, I say scrap the language! Just steal perl or python or ruby or any combination of the above! Use their syntax, their libraries, their speed, their developers, their object models, everything. Why did they need a new language? Who in there right mind thinks that PHP is on the cutting edge of syntax, or consistency, or standard libraries, or OOP, or anything like that? Embed some other language into the platform.

    Think if all of the PHP developers time was spent coding something like mod_python|perl|ruby. Maybe they could even allow any language per coding page or something cool like that.

    --
    Social scientists are inspired by theories; scientists are humbled by facts.
  28. My experience by Alien+Conspiracy · · Score: 3, Interesting

    Having used both PHP and J2EE for major projects, I'd have to say that I prefer PHP because:

    1. It is more concise - java even _less_ compact than C++ with a good set of libraries - whereas PHP has loads of very forgiving high-level functions builtin.
    2. It is more lightwight - java is just _still_ too bloated and slow even after all these years of promises from Sun.
    3. The Java VM's for Linux really suck, they 'officially support' only RedHat and are unstable as hell running on Debian.

    That said I really miss the J2EE ability to cache persistent data between requests in memory simply by declaring a variable as static. It's the only feature I miss in PHP.

    As far as .NET goes, it never reached my radar since it is Windows-only.

  29. PHP software development market - USD 5.6 billions by harry_f · · Score: 2, Insightful

    There are 75.000 PHP development companies in the world, totalling 150.000 professional developers. Each company creates 12 websites per year on average, and one website takes approximately 32 work days to be completed.

    The average price of a PHP dynamic website is USD 6.000, and a regular company receives USD 75.000 income from PHP development per year. By multiplying this with the number of companies in the world, we can estimate the size of the PHP software development market - USD 5.6 billions.


    Potentially that's a massive market to anyone selling PHP related tools (and their aren't many). Of course that's based on the questionee's estimate.

    Zend is throwing the number "500,000" PHP developers around. That might be accurate - Interakts survey made the assumption that you worked for a PHP development company and had clients. That ignores, for example, those building intranets for internal use only, which my, guess is a significant number.

  30. PHP == Best pure SSI Technology ever. Period. by Qbertino · · Score: 2, Insightful

    I've done quite some web developement with lot's of stuff, including JSP, Zope/Python and PHP. I'Ve looked into CF and ASP.Crap and have heard all the MS Junkies doing verbal wee-wee in their pants over how so very sweet their new stuff is.
    After all these years I've had my perception of things confirmed day in and day out:
    The best existing webapp technology ever concieved to this very day is the Zope Application Server together with it's intergrated Object-Relational Database, it's PL Python and the SSI solution TAL (Template Attribute Language). It will take _everything__else_ in the industry something like 5 years at least to catch up.
    Apart from that, anything that strives to go the pure SSI approach with a separated DB eiher uses PHP or most certainly is crap. It's really that simple. I've evaluated CF (Nice dynamic flash with a poor mans PHP for 10000$. No thanks.) and ASP, finally moving into usable regions with .Net but still stomped to chunky kibbles by PHP and it's community. Both won't even come close.
    JSP is a nice substitute if you've got a Java Enviroment there allready. But then again, who would want one if you get allmost everthing (apart from maybe banking applications) ready or done faster in PHP.
    Bottom Line: If you've got a standalone Server for your project, use Zope and all the goodies that come with it. On the other hand, if Apache is a must, mod_php is present and/or you need a finished OSS solution *now* you use PHP. PHP has the largest dev-community, and for good reasons too.
    I really can't take CF or .Net zealots serious anymore.

    --
    We suffer more in our imagination than in reality. - Seneca
  31. Presentation on PHP Adoption by ubiquitin · · Score: 3, Interesting

    Here's a presentation about what the following tech companies have publicly said about PHP:
    Macromedia, IBM, Oracle, Sun, Apple, Symantec, Novell, Microsoft, MySQL

    http://php.ist.unomaha.edu/presentations/secondc la ss.pdf

    I think the biggest news is that Oracle is putting the PHP module into their 9i Application Server.

    --
    http://tinyurl.com/4ny52
  32. The code is the data in FP, not in PHP by axxackall · · Score: 2, Interesting
    PHP code does not see (reflect) itself as data, no reflection in PHP. The code FUNCTIONS are not first class objects. So, that's why in PHP the code is not a data from FP (Functional Programming) prospective.

    IN FP languages, like Lisp, the code is the data: there is very well defined reflection, I can construct new functions and manipulate existing ones as they are first class objects. Same/similar situation is in ML and Haskell.

    Well, among traditionally imperative programming languages there are more and more cases of "the code is the data" paradigm as well. First of all in iterpreting (scripting) languages, like Python, Perl and Tcl. You can construct the text of the function and "eval()" it. The problem is that in FP languages there is a very well designed math model for it protecting you from many errors (you construct real functions, not a text for for functions). In scripting languages it's more like a hack leading to many errors in a similar way as C pointers and Fortran GOTO operators.

    --

    Less is more !
  33. Re:Apples to Oranges by the-matt-mobile · · Score: 3, Insightful

    You can't compare PHP and ASP.Net.

    I don't see why not. They are both technologies designed to provide dynamic content via the web. Just because they require different methodologies, doesn't mean they are incomparable.

    PHP is not a true object-oriented programming environment.

    Where I work, we favor Microsoft technologies. I use ASP.NET and I love using it. But the object-oriented stuff gets in my way more than it helps me. OO is not the best paradigm for web development. HTTP is a stateless protocol (albiet there are layers on top of it like cookies which allow for maintianing state) so creating a whole object structure on the server to manage data is a waste of time because the objects are lost after the request completes anyway and have to be recreated on each subsequent HTTP request. And trying to build presentation using objects is a nightmare. (An HTML table as an object? Please!) No, the OO paradigm is not what makes ASP.NET better to use IMO than ColdFusion, classic ASP, and PHP (I've used them all on other projects at other companies). The part where ASP.NET shines is the separation of presentation from code. In a properly coded ASP.NET page, almost no server side code is present in the aspx page, and all of the work is done in a "code behind" area. That is what I find lacking when using PHP - not an overrated OO-for-the-web paradigm (OO is great for other things though), but in a proper MVC architecture with separation of code and presentation.

    On top of that, the PHP language is not strongly typed, and you don't even need to declare variables

    Truthfully, I see that as an advantage of PHP over ASP.NET. Yes, traditionally weakly typed languages perform slower than strongly typed ones, but other than that the advantage of not having to deal with excessive casting is a fantastic advantage. You may argue that it allows for bad coding practices, but I'd counter with "what language doesn't?". If you want to be stupid about it, any language will let you do things wrong. Languages like Java try so hard to force you to do things right, it ends up being at the expense of useful functionality. No thanks.

    PHP has no structured exception handling

    Yeah, I agree. That does suck.

    When performing operations like variable assignment and passing the object as a parameter to a function, the whole object is copied

    I think that depends on your point of view. Not having the option sucks though.

    On the other hand, ASP.Net is a true OO language, with inheritance, polymorphism (overloading of methods) and encapsulation. ASP.Net is strongly typed. ASP.Net is compiled and JIT'd.

    I don't mean to sound snotty, but my honest reaction here is "so what?". OO is a great paradigm for other things, but it falls short when trying to use it for web development. And, being compiled arguably makes ASP.NET harder to debug. I'm no fan of VB, but at least the VB environment allowed dynamic changing of code during a debug session without having to stop the debugger, recompile the code, and start again. Interpreted languages are not nearly as slow anymore as everyone claims them to be, and in the real world it seems that rapid application development will win out 9 times out of 10 over rapid program execution. A lot of bad architecture decisions are made in a falsely percieved need to boost speed all the time (just ask the Java camp about the state of affairs in the late 90's).

  34. Re:The code is the data! by __aawpnr5477 · · Score: 5, Insightful
    I used PHP extensively for a number of years and finally wrote my own framework. In the end it turned out to be very much like some of the Java frameworks out there.

    IMHO the good parts about PHP are also the bad parts. ie, * you don't have to say what type a variable is, but that means you can't specify a type of parameter to a function. * you don't have to specify scope, but then you can't protect functions that should be private etc.

    I looked at a lot of Java code for ideas on what I could do with PHP to clean it up . The main things that I did were: set up a 3 or 4 tier architecture.

    • database abstraction layer
    • business layer
    • presentation layer (preferably using templates)
    (I modeled a lot of this on Enhydra - www.enhydra.org)

    never use globals. Wrap up the HTTP_GET_VARS, HTTP_POST_VARS etc in a class (ie Request). Create classes to wrap the server vars and whatever else.

    Use classes for everything. This gives you a reasonable amount of namespace control.

    Never access variables directly in classes. Create accessor methods for them.

    I think that if you are feeling the need to structure your PHP, you will probably need to move towards Java or some other more structured language. It can definitely be more challenging to write, but as your applications get bigger, the compiler-enforced type checking, programatticaly enforced/supported interfaces etc will save you a lot of time in the long run.

  35. Re:PHP on the Enterprise? by chegosaurus · · Score: 2, Funny

    You say that now, but wait till you find out what versiou they're up to.

  36. The need now is an OLAP api and servers by Nicolay77 · · Score: 2, Interesting

    I love the idea of have used php which I know well to create our OLAP enabled services.

    But there are no available good Open Source OLAP servers (just something in the works with Java). So I'm using ASP which is ugly but has the powerful MS olap server. I don't like to use MS products, but in this case is the one with the most favorable cost/benefit ratio.

    Want to increase PHP market share... integrate it with OLAP technologies. Help Open Source OLAP technologies. You will increase marketshare and I will use something nice, stable and open.

    --
    We are Turing O-Machines. The Oracle is out there.
  37. Best part of PHP is the growing support code by WoTG · · Score: 2, Insightful

    I've used PHP quite a lot lately. And it's great. On the whole it is every bit as good as the last versions of ColdFusion and ASP that I've used (admittedly those are a version or two old by now).

    To me, the biggest strength of PHP going forward is the huge number of people that are improving the PHP experience every day.

    1) New features? There are free extensions and modules for templating, database abstraction, compiled script caching, and more.
    2) Sample code. I'll bet that there are more free as in speech snippets and full applications of code available for PHP that any other web language.
    2) Community. There are lots of sites and other online resources where PHP developers can find help with debugging code when they need it.

    Once you toss in great cross-platform support - PHP runs on just about any web server of interest - and a good price ($0), PHP is very competitive.

    No, I wouldn't want a bank running on PHP, but for MANY other uses inside companies, PHP is good and getting better. I liken it somewhat to Linux a couple years ago with respect to corporate acceptance. The foundation is more or less built, what's left is some time to mature and gain credibility.

  38. I'm still slightly annoyed... by Dr.Dubious+DDQ · · Score: 2, Interesting

    ...that so many people assume PHP is "only for web pages". The entire first report linked above seems predicated on the notion that "PHP is for companies to make money setting up websites for other people, and other uses are 'fringe' or irrelevant."

    PHP is definitely good for web-pages, but I've increasingly found it to be very useful for a lot of command-line programs and system administration, much as Perl is.

    PHP-GTK has also already been mentioned in other postings, and the increasing interoperability with Java means you can implement a variety of parts of your PHP projects in "native Java" if you want to...and that's not just "Java for web pages" code, either.

  39. Re:The code is the data! by brianlmoon · · Score: 2, Informative

    > 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.

    http://dev.phorum.org/cvsweb/cvsweb.cgi/phorum5/