Slashdot Mirror


PHP Succeeding Where Java Has Failed

ficken writes "Web browser pioneer Marc Andreessen recently announced his prediction that PHP will be more popular than Java for building web-based applications." From the article: "Wooing programmers is nothing new in the computing industry, where players constantly jockey to establish their products as an essential foundation. Indeed, many credit Microsoft's success to its highly regarded programming tools, which make it easier for developers to write software that run on Windows. PHP has caught on widely. About 22 million Web sites employ it, and useage is steadily increasing. About 450 programmers have privileges to approve changes to the software. Major companies that employ PHP include Yahoo, Lufthansa and Deutsche Telekom's T-Online." Meanwhilie, Piersky writes "Zend has announced its rival to .NET and J2EE, with the Zend PHP Framework. In a press release, they stated that it will be 'A Web application framework which will standardize the way PHP applications are built. The Zend PHP Framework will accelerate and improve the development and deployment of mission-critical PHP Web applications'. This will for part of Zend's PHP Collaboration Project"

94 of 610 comments (clear)

  1. I am completely unbiased... by Fortyseven · · Score: 5, Funny

    As a PHP coder and Java hater, I am completely in agreement with whatever the hell this article says. :D

    1. Re:I am completely unbiased... by SatanicPuppy · · Score: 5, Insightful

      Well, as a Java coder who's been coding almost exclusively in php for a year or so, I have to say it makes me feel better about my time spent. Php is definitely easy to work with, though that creates the opportunity for some seriously scary code.

      I have to say, just not working with Tomcat is a plus (though I give major Props to the Fedora team for the option to install Tomcat right off the install disks)...When gcj finally catches up, I'll be a happy puppy.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    2. Re:I am completely unbiased... by KiloByte · · Score: 2, Insightful

      As someone impartial to the Java-vs-PHP debate (and a soldier to a third side), I would describe PHP as Visual Basic of server-side development. It's very easy to use, but most code is monstrously sloppy and/or insecure -- I might have been unlucky, but the three times I fixed problems in php code (and usually rewrote things in Perl), the code had glaring holes and was totally unreadable. You're reading this right -- I rewrote things to Perl to make them readable.

      The problem with Java is that you can't really integrate it with anything other than Java itself -- Sun can teach Microsoft a lot when it comes to blocking third-party improvements. Until, as you say, gcj or any other piece of free software catches up, Java won't be usable. It died as a client-side language, and is struggling on the server as well.

      Thus, the bottom line is: long live Larry Wall!

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    3. Re:I am completely unbiased... by SatanicPuppy · · Score: 4, Interesting

      Yea. You can write good code in Php, but I've seen a lot of slop as well, and I've talked to a lot of "Php programmers" who don't know the first thing about datastructures---unsuprising since php really doesn't have anything besides a weird hash-array-stack thing with ad hoc support for multidimensions, and don't understand reusable objects or abstraction.

      Does definitely remind me of VB, though the syntax isn't as screwy.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    4. Re:I am completely unbiased... by LDoggg_ · · Score: 5, Insightful

      The problem with Java is that you can't really integrate it with anything other than Java itself

      Huh?
      Not sure what you mean here. If by integrate you mean communicate with other languages there's things like CORBA and SOAP, if you mean call other shared libraries there's always JNI if you can't find a java lib to do something.

      Until, as you say, gcj or any other piece of free software catches up, Java won't be usable.

      Strange, I'm using it every day at work. Have been in one way or another professionally for 8 years now.

      It died as a client-side language, and is struggling on the server as well.

      You do realise that is no better than a BSD is dying troll right?
      Just checked Moster.com. 105 java positions available within 50 miles of my house, 18 for PHP, 42 for perl

      Now I'm saying that as someone who also uses PHP. I've been using it quite a bit lately and don't mind it at all, but we're talking apples and oranges here. Sure PHP can be used to write monstrously sloppy and/or insecure code, but so can any language. PHP can also be used to write clean easily maintable secure code.
      PHP wasn't even close to java in terms of object oriented coding until PHP5 came out, which unfortuneatly has been very slow to appear on most 3rd party hosting servers and distros.

      My only real gripes with PHP are the lack of a standard DB connectivity layer like JDBC. PEAR:DB and ADODB are close, but they still rely on non-php libraries so setting up a connection to oracle or sql server is painful. The other thing is a lack of type hinting for primatives. Seems kinda silly to have to do a check if something is an int or double in the method instead of just putting it in the method's signature. I'm know its a loosely typed language, but type hinting is there as an option for objects, why not primatives too?

      I'm looking forward to PHP5.5 its going to have some real nice features that will bring it little closer to server side java and a little further from something like .asp where most of the business logic is in the presentation layer.

      --

      "If they have both, tell them we use Linux. And if they have that, tell them the computers are down." -Dave Chapelle
    5. Re:I am completely unbiased... by Xugumad · · Score: 3, Funny

      Note to self - write article claiming people who use the online name "Xugumad" at 100% more productive than regular employees :)

    6. Re:I am completely unbiased... by Anonymous Coward · · Score: 2, Informative
      I could say several positive things about PHP, but I think it wiser to point out some of its weaknesses. The presentation is a fairly geeky and technical based rant, so read if it works for you! PHP is fine for certain websites, but don't believe it's universally better:
      • No non-commercial debugger without paying Zend $$ (Perl, Python, and Ruby provide one for free).
        • For certain embedded or kernel environments, I can understand kprintf() mentality. For today's ample boxes and supposed modern languages I expect at least a rudimentary command line debugger.
        • For gravy, give me a good profiler for when the performance problem isn't with a backend database and doing it's tracing/diagnostics/explain plan mantra. NOTE: Strangely enough I've had more success in this area with PHP than for the debugger
      • Lack of well known tool of similar quality to Perl's (-w|use diagnostics) or pychecker to spearhead any of deficiences of using a scripting language over a statically typed language. Sorry more analysis than "php -l" for syntax errors would be of great benefit to PHP. If there is one that I'm not aware of since the last time I checked, here's your chance to educate more people on the matter.
      • Windows PHP/Apache stack seems very unstable on Windows compared to Linux, yet these two are the same respective layers in LAMP. Zend has a $olution and I have NOT tried FastCGI, so mission critical apps with high reliability don't seem to be really cross-platform. I'd be willing to pay ActiveState money before Zend, since it all seems about hooking people and selling the pot-hole patch kits.
      • Brain dead basic library design, until Pear remedies (in some cases):
        1. Why doesn't variable interpolation within an HTML page do htmlspecialchars()?
          • Most cases need this behavior, let's make the opposite the default!
          • Making the hacks and the couple of legitimate cases call a function to not do the expansion would make too much sense, we can't cause any minor backwards compatibility problems, especially when we would have to admit to one of our mistakes. Far better to claim there is some correct way for the application programmer to do that and that it is their fault, not ours.
        2. Basic language design promotes, but doesn't preclude, seperation of business logic and display, especially for lower-level developers who write code who others must maintain. Just read the default documentation assuming you're a beginner with nothing else. NOTE: yes, I believe that you are better off using one of the Pear Template Solutions for several reasons and getting a decent book besides the default documents (this advice goes double, if you happen to use Perl). Python and Ruby seem to have better documentation sources for learning the languages, IMHO.
        3. Most PHP DB interfaces are prone to SQL injection, because they do not promote the use of Bind variables. Proper DB quoting can happen at the proper place within the library instead of depending on application programmers to get it right all the time. This is the approach used by many other scripting languages (Perl DBI and Pythin DB API 2.0 come to mind).
        4. Alot of damn functions for PHP array, yet doing usorts() and other stuff doesn't allow one to keep a sorted array efficiently while still inserting items
          • Already tried using a PHP-user level implemented binary search
          • Some approaches work OK, until about 1000-2000 items then performance significantly decays.
          • Weasel statements about providing object-like facilties within the language, but not saying that it is an object oriented language. Heck I wouldn't want to be able to sort my "objects" without using a regular function now would I and efficiently at that?
          • Some sorting can happen at the DB level, if properly done. But some applications and algorithms require more capability in the host language.
          • Most other lang
    7. Re:I am completely unbiased... by rsheridan6 · · Score: 2, Insightful
      Is this because PHP is inherently unreadable, or because it's so easy to learn that a lot of incompetent people who barely deserve the title "programmer" use it? People say the same things about Perl, but when I dabbled in Perl I concluded that its alleged unreadability had more to do with its users than the language itself, because the code I found was pretty readable (I happened to have an interest in a project written by MIT CS grads). I have no experience with PHP (besides looking at the manual and finding it unappealing), but maybe the same thing is going on with PHP. PHP was, after all, designed to be used by, let's just say, non-alpha-geeks.

      The existence of badly written code that nonetheless works would be sign of PHP's success in that regard.

      --
      Don't drop the soap, Tommy!
    8. Re:I am completely unbiased... by Mercano · · Score: 4, Interesting

      [Java] died as a client-side language.

      Not sure how much this is worth, but as we speak the top item on the Most Active Projects list over on SourceForge (insert tinfoil hat disclaimer here), Azureus is a client side Java app. For those of you keeping score at home, the #2 spot, GAIM, is in C and PHP comes in at #3 via phpMyAdmin. Keep in mind this is looking at quality (and a pretty wierd messure of quality, at that), not quantity, but still intersting.

      --
      #include <signature.h>
    9. Re:I am completely unbiased... by SatanicPuppy · · Score: 2, Insightful

      I don't think Php is inherently unreadable. With good formatting, well-named variables, and intelligent use of functions, it's just as readable as anything else.

      I think it's a bit more readable than Perl, simply because Perl lets you get away with things that php does not. $_ leaps to mind.

      But Perl gets a bad rep from people who write sloppy Perl code. If you break things out into packages and functions and aren;t afraid to use linebreaks, the code doesn't become an illegible snarled mess. The things I see that make most people throw their hands up are undocumented regular expressions...If you're good with regex you look at it and go, "eh, email address validator", but if you're not it looks like someone wiped their nose on the number bar while alternately whacking the shift key.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    10. Re:I am completely unbiased... by anti-trojan · · Score: 2, Informative

      If I write a big PHP app, I want to keep the compiled classes in RAM or on disk for more speed, like I do with mod_perl or Rails. What is the *reliable* way to do this in PHP?? I think it might even be impossible, due to the massive dependence on a global namespace..

      I believe PHP accelerators (like the open source eAccelerator) do exactly that. But again, I am not a PHP expert.

  2. PHP is great stuff by ReformedExCon · · Score: 2, Insightful

    If you are a web "programmer", it's definitely nice to have well-built tools that let you think even less about what you are doing and come up with something useful.

    I suppose that's true in most jobs, though.

    --
    Jesus saved me from my past. He can save you as well.
    1. Re:PHP is great stuff by rovingeyes · · Score: 4, Interesting
      "If you are a web "programmer", it's definitely nice to have well-built tools that let you think even less about what you are doing and come up with something useful."

      Don't know about you, but it sounds dangerous to me.

    2. Re:PHP is great stuff by AVee · · Score: 2, Interesting

      True, but it also explains why PHP will likely be more populair than Java for web apps. The resulting apps will also likely be of lower quality, but Windows is the most used OS as well...

    3. Re:PHP is great stuff by masklinn · · Score: 2, Interesting

      AFAIK:

      • ASP.Net is NOT a language, it's a framework, it makes quite a number of modules and precreated functions available but it's not a language (while ASP was a language, more or less, created from VB).
      • You can use just about any language running on top of the CLR (.Net's equivalent of the JVM) in an ASP.Net environment. That includes VB.Net, C#, Boo, IronPython, ... or even your own language since the CLI itself is an open spec and you're completely free to create your language compiling in CLI (.Net's "assembly")
      • Mono implements ASP.Net 1.1 very well (completely in fact, I think) and even implements part of .Net 2 already, which means that ASP.Net actually is cross-platform (since Mono runs on Linux, OSX, Solaris, *BSD and Windows over s390, SPARC, PowerPC, x86, x86-64, IA64, ARM and HP-PA)
      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  3. J2EE won't fail... by _undan · · Score: 5, Insightful

    ... until companies who need mission critical systems have someone they can phone when something goes wrong, and some form of developer accreditation. Don't kid yourself. J2EE isn't picked because of the language, it's because it's got Sun and IBM (through Websphere) behind it.

    1. Re:J2EE won't fail... by digidave · · Score: 2

      Swap "J2EE" for "Windows" and you have the same argument as is used against Linux. PHP is supported by Zend and several other companies. As the article says, Oracle and IBM are both showing support for PHP.

      And nobody said J2EE was going to die. It's just that more people are realizing it isn't always the best way to develop a web app. IMO (and some people say I'm wrong sometimes), Java excels where you need to interface with legacy and/or disparate systems. If you don't need to do that, Java and J2EE might not be for you. This is why it's so great for banks that need to interface their online banking web site with their banking and account data. It's also why it's overkill for 99% of web sites. It makes more sense on an intranet where you don't need to worry as much about security when linking many internal systems (not because Java is insecure, but because linking web apps to critical business systems in inherently dangerous, moreso when you're exposing the web app to the general public).

      --
      The global economy is a great thing until you feel it locally.
    2. Re:J2EE won't fail... by arkanes · · Score: 2, Interesting
      Java excels where you need to interface with legacy and/or disparate systems.

      This is exactly contrary to my experience. Java *sucks* at playing nice with other systems, unless you build up a "play nice with Java" layer in those other systems first. PHP, shitty as it is, is much better. Python and Perl are both much better (Python more than perl these days, imo) as glue code.

      Java works best when it can run in long running, memory hogging, monolithic processes, where it's development and execution model can really shine (these are the circumstances you get those "faster than C" benchmarks). Java doesn't play nice with other systems, and interop via JNI can kill the GC optimizations that let it beat manual memory management for performance.

  4. In other news by Anonymous Coward · · Score: 5, Funny

    Coke succeeding where peanuts fail.

    What? The two do different things.

  5. Will be? by bhirsch · · Score: 2, Insightful

    I thought PHP was already more popular. Granted PHP-Nuke, etc aren't exactly banking apps.

  6. Help me out here by wren337 · · Score: 5, Insightful

    Doesn't PHP tend to be embedded in the page? I thought it was a more direct comparison to JSP than to Java. And like JSP I expected it violated the seperation of logic and presentation that I love so dearly. I've been avoiding PHP for the same reason I don't do JSP pages, I don't like code in the presentation layer.

    I am prepared to have my mind blown here, can someone enlighten me?

    1. Re:Help me out here by TheSpoom · · Score: 5, Informative

      You're pretty much correct. PHP is a lot closer to JSP or ASP than Java, and yes, it can violate separation of logic and presentation. However, you can use the Smarty templating library to separate code and presentation (and I recommend this to anyone learning PHP, because embedding PHP in HTML makes for very sloppy and nigh unreadable code).

      --
      It's better to vote for what you want and not get it than to vote for what you don't want and get it.
      - E. Debs
    2. Re:Help me out here by Anonymous Coward · · Score: 2, Informative

      You can separate presentation and logic in PHP just fine, and once you come to doing templates you can use a really powerful templating language - PHP.

    3. Re:Help me out here by tertullian · · Score: 2, Insightful

      Don't fool yourself, I've seen much Java code with "real Java" embedded into the pages. I've worked on projects that make use of BroadVision, Weblogic, etc... and there seems to always be a need to have logic on the presentation layer. With PHP, I've been using Smarty, and I've been able to accomplish everything I need to do without the having to put PHP logic on the page. This argument of presentation/logic separation is hypocritical when it comes from Java developers, because they don't practice what they preach.

      --
      Goal in Life: Learn as much as I can...
    4. Re:Help me out here by digidave · · Score: 2, Interesting

      There is nothing in PHP that discourages you from mixing logic and presentation, but there is also nothing discouraging you from separating them either. This is exactly what makes PHP great for dirty hacks and large web apps alike.

      Templating is part of the solution, but so is good app design. If you don't want to mix your logic, you simply need to code it that way. Zend PHP Framework will help enforce some of the same separation as Java does, but it's not strictly necessary. You can do MVC app design without much trouble. Take a look at Sitepoint's PHP Application Design forum (http://www.sitepoint.com/forums/forumdisplay.php? f=147).

      There are also Ruby on Rails-type frameworks such as CakePHP (http://www.cakephp.org./

      --
      The global economy is a great thing until you feel it locally.
    5. Re:Help me out here by __aanonl8035 · · Score: 3, Informative

      I find it strange how people recommend Smarty for separation of code from content. Smarty implements its own while loops and if then statements. I have yet to come across a web application using Smarty that was easily readable. I would think if the goal was to separate code from content, one would use a templating engine more akin to QuickTemplates. It does not make you relearn a whole new programming language syntax for while loops and if then statements like Smarty does.

    6. Re:Help me out here by Randolpho · · Score: 2, Informative

      Separation of concerns (code in your presentation layer) is a design issue, not a language issue. Calling PHP a bad language because you can put code in your presentation layer is like calling water bad because you can drown in it.

      --
      "Times have not become more violent. They have just become more televised."
      -Marilyn Manson
    7. Re:Help me out here by bobdinkel · · Score: 3, Insightful
      I find it strange how people recommend Smarty for separation of code from content. Smarty implements its own while loops and if then statements. I have yet to come across a web application using Smarty that was easily readable. I would think if the goal was to separate code from content, one would use a templating engine more akin to QuickTemplates. It does not make you relearn a whole new programming language syntax for while loops and if then statements like Smarty does.

      People recommend Smarty because PHP feels pretty incomplete without it. And it's not about separating code from contentit's about separating business logic from display logic. And the syntax is really easy.

      --
      A publicly traded company exists solely to make profits for shareholders.
    8. Re:Help me out here by Anonymous Coward · · Score: 3, Insightful

      PHP already is a templating language! You don't need the extra overhead of these 'template engines'. PHP is already doing it for you. You wouldn't go and build a templating engine via Smarty now would you?

    9. Re:Help me out here by thePowerOfGrayskull · · Score: 4, Insightful

      However, you can use the Smarty templating library to separate code and presentation (and I recommend this to anyone learning PHP, because embedding PHP in HTML makes for very sloppy and nigh unreadable code).

      Come again? You're saying that {$value} somehow separates presentation from code more than does <?=$value;?>?

    10. Re:Help me out here by moof1138 · · Score: 2, Insightful

      It's not about exactly separating presentation from code - the presentation is also code. It's about separating business logic from display logic. Your example overlooks the key piece, where the business logic to determine $value is done.

      --

      Hyperbole is the worst thing ever.
    11. Re:Help me out here by robla · · Score: 2, Insightful

      It's harder to enforce separation without something like Smarty. Disclaimer: I haven't used Smarty, but I've used a homegrown templating system with PHP.

      It's nice to be able to give the people responsible for content and layout access to the files of the website, without giving them access to the code that actually contacts the database, has access to server globals, etc. You can enforce that sort of separation via policy rather than code, but if its only policy, there's a temptation to bend the rules, especially if you have a page designer who knows just enough PHP to be dangerous. Better to have a template system that doesn't give raw database access, and then have a backend that exposes the pieces of database data to the designers that they need.

  7. PHP Desktop Apps?! by luiss · · Score: 3, Insightful

    Java "failed" on the desktop. I didn't know PHP desktop apps were taking over.

    1. Re:PHP Desktop Apps?! by digidave · · Score: 2, Interesting

      Sure, that's what php-gtk (http://gtk.php.net/) is all about :)

      Actually, php-gtk is very useful when you have an existing PHP web app that you want to port into a desktop app. It's a great project, but is definitely not meant for large-scale apps.

      --
      The global economy is a great thing until you feel it locally.
    2. Re:PHP Desktop Apps?! by Dukael_Mikakis · · Score: 4, Funny

      It's a great project, but is definitely not meant for large-scale apps.

      What are you talking about? I'm posting this right now on my php-coded web-bro&%($(*#&%#&@&NO CARRIER

  8. Guessed wrong again! by MojoSF · · Score: 5, Funny
    I've resisted specialization for most of my career, giving me breadth but not depth. It's hurt me in job interviews where the hiring managers want specialized expertise instead of intelligence and problem solving skills.

    So I decided that I'd focus on Java for my depth. Now I read that I guessed wrong again!

    Maybe I should have gone C#/.ASP.

    No, Python and Zope are where it's at!

    No way, Ruby is the way to go. Arrrgh!

    1. Re:Guessed wrong again! by Anonymous Coward · · Score: 3, Insightful

      If hiring managers were looking for specialization, you were hiring at the wrong kind of company.. i would kill for developers that could develop and not just plug crap into .net or java

    2. Re:Guessed wrong again! by KiroDude · · Score: 2, Insightful

      Can you give me the name of those companies that do not ask for specialization??
      I totally agree with the parent post, people mistake syntax with logic. I might be able to tell you every single reserved word, function, operand and whatnot of one language, but if I do not have the necessary logic to put all these words together in the right order, it is useless.
      Language syntax can be picked up pretty quickly, logic not.

  9. The Success of PHP by kihjin · · Score: 3, Informative

    About 22 million Web sites employ it

    Well, of course. PHP works for free.

    Wondering where the '22 million web sites' comes from? http://www.php.net/usage.php.

    --
    This slashdot-related signature is a stub. You can help kihjin by expanding it.
    1. Re:The Success of PHP by Piersky · · Score: 2, Informative

      Actually it comes from Netcraft

  10. Pardon me while I roll my eyes by Anonymous Coward · · Score: 5, Insightful

    "Java is much more programmer-friendly than C or C++, or was for a few years there until they made just as complicated. It's become arguably even harder to learn than C++," Andreessen said. And the mantle of simplicity is being passed on: "PHP is such is an easier environment to develop in than Java."

    This is just silly. PHP is far from "simpler" than Java. PHP *is* better suited to basic page generation tasks. Its syntax is easy to learn, and it's quick to get a page running. However, any sort of complexity thrown at the system starts making PHP look difficult and Java look easy. For example, I often write web applications that require that user sessions communicate with each other. Now this is stupidly simple in Java thanks to the use of Singletons or named derivitives. One can easily build a chat room, for example, whereas PHP begins to get a bit more tricky. Now throw really complex needs like PDF generation, Dynamic Excel Spreadsheets, XML/SOAP/XML-RPC/EDI communication, mainframe interfaces, off-brand databases, performance caches, and other large scale features, and suddenly Java doesn't look so hard anymore. PHP, OTOH, begins screaming for mercy.

    One would think that Andreessen would understand how to use the right tool for the right job, but apparently not. He should be kept away from the press. He always manages to sound 50 IQ points dumber than he actually is. (A common problem when dealing with the press.)

    1. Re:Pardon me while I roll my eyes by netkid91 · · Score: 2, Interesting

      Not a big fan of Java, slow, bulky, not user friendly. Best part about PHP is extensions, just write some C++ code(or C#/VB.NET on windows *frowns*) and make it a DLL, set it up and use it, not easily available as Java yet because no as many people use it yet. Honestly both preform well compared to ASP.NET and we should stop bashing each other, get a way for JSP and PHP to work together is what we need, simple page rendering stuff goes to the PHP engine, backend proccessing to Java, really, it might work.

      --
      NO~, I read Slashdot because I think it's stupid.....
    2. Re:Pardon me while I roll my eyes by Gilmoure · · Score: 3, Funny

      Don't you know that non-partisanship on Slashdork won't be tolerated? If your comment can't be fodder for flamewar, you may be modded down (and cute bunnies won't like you anymore).

      --
      I drank what? -- Socrates
    3. Re:Pardon me while I roll my eyes by Crayon+Kid · · Score: 4, Informative

      However, the real strength of these systems is not in themselves; they are built on a superb platform base which provides Threading, IO, Networking, Graphics, Db access, i18n,and all the things a programmer might ever require. PHP doesnt have anything remotely similar, as far as i can see.

      OK, this is a troll if I ever saw one and may I be damned for feeding one but here it goes:

      Go look at PEAR and the PHP manual index and then tell people PHP doesn't have a platform offering all those.

      --
      i ate crayons when i was a kid and now i have two braincells and the blue ones taste nicer
    4. Re:Pardon me while I roll my eyes by coder111 · · Score: 4, Informative

      There's usually no need to integrate PHP with Java and use PHP for page rendering, because there are tools in Java that do page rendering just as well as PHP, if not better. If you need integration anyway, you can integrate Tomcat with Apache- then all your static (images, CSS) and PHP stuff will run on apache, for java stuff tomcat will get called. This will both increase performance (as Apache is better suited for serving static stuff than Tomcat) and allow PHP to be used on same box, same port.

      Java is not slow in server-side, it is just slow on desktop with Swing. Get Tomcat and try benchmarking some JSPs if you don't believe me. Templates with java might be slower than JSP, but anyway, page rendering is something that impacts the performance of web application the least.

      With java you EXTREMELY RARELY need to write extensions, usually you can find java libraries (most of them open source) that do the stuff you need. Or you can just use standart java class libraries, that are enough for 95% of cases. This way you can get a platform-independent solution for no additional cost. While your DLLs (.so's?) will have to be compiled for each architecture, coded to be cross-platform, installed by system administrators, etc.

      If you need to interface with C++/C, there is JNI (Java native interface, It is hairy and unfriendly though). Of you can integrate via some kind of interprocess communication (pipes still work, as will TCP, with java you can write TCP client/server in 10-30 lines of code). This way you can have any language on the other side of IPC. You can use webservices/CORBA/XML RPC if you want to be fancy.

      --Coder

    5. Re:Pardon me while I roll my eyes by masklinn · · Score: 2, Informative
      Best part about PHP is extensions, just write some C++ code(or C#/VB.NET on windows *frowns*) and make it a DLL, set it up and use it.

      That's called a theory. It's much harder to build in reality, and mostly sucks anyway since you still don't get any namespace and have to decorate every damn function like there was no god.

      not easily available as Java yet because no as many people use it yet

      Thing is in Java you can write your extensions in Java (the JIT compiler is running behind so perfs are good anyway), or use JNI to use C/C++ compiled modules.

      Or you can do it the Nice Way and just hop on to Python or Ruby, get full OO, namespaces, and modules (including native compiled) that are actually fairly easy to build.

      With batteries included

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    6. Re:Pardon me while I roll my eyes by hoggoth · · Score: 5, Insightful

      > One would think that Andreessen would understand how to use the right tool for the right job, but apparently not

      Andreessen knows exactly how to use the right tool for the job, like a surgeon. His tool is the media, and his job, as a new member of the board at Zend, is to promote PHP.

      --
      - For the complete works of Shakespeare: cat /dev/random (may take some time)
    7. Re:Pardon me while I roll my eyes by Decaff · · Score: 2, Informative

      Not a big fan of Java, slow,

      No, especially not server side. Reaches within a few % of C++ speed in well-established benchmarks:
      http://www.shudo.net/jit/perf/

      bulky,

      No. It can run within a few 100k on mobile devices. Non-GUI java apps can run in just a few MB.

      not user friendly.

      A vague term, which could mean anything.

  11. Caching by Anonymous Coward · · Score: 2, Interesting

    In asp and asp net there are extensive facilities to cache in to memory.

    I don't know much Php but as far as I can tell there is no way to do this natively. This is one of the reasons I don't use php. You see site like groklaw get overloaded when Slashdot hits them because they pull the freaking article out of the database every time it's requested.

    If somebody could show me some in process caching that'd take me a long way to ditching php. I don't mean caching to disk either. Caching to disk is much slower than memory.

    Ideas?

    AC.

  12. Re:Java failed because it's a slow toy. by Piersky · · Score: 2, Insightful

    No, I agree. PHP is just a scripting language. Would you use C/C++ on a website? I wouldn't

  13. Both have strengths and weaknesses by Anonymous Coward · · Score: 4, Insightful

    I've done programming in PHP and in Java.

    PHP is straightforward and easy, and most distributions have their own packages for it. Whereas with Java, the initial set up is overwhelming for beginners.

    I learnt PHP years ago by myself, and it wasn't really that hard. Yet a few months ago when I was finally required to learn Java, the complexity of the Java frameworks (Hibernate, Spring, etc) tortured me for days before I actually knew what was going on. And it doesn't help when all the frameworks gives such a "bulky" feeling.

    The learning curve of Java is definitely much higher than PHP.

    Of course, I do agree that Java is much better suited for large scale web programming than PHP. It's much easier to do things cleanly in Java, and although PHP's loose typing is great for a simple 1 page script, I'd rather have the strict typing of Java when it comes to large scale projects.

  14. Re:PHP can do allot by christopherfinke · · Score: 5, Informative
    I'm very impressed with how far PHP (Personal Home Page) has gone.
    PHP hasn't stood for Personal Home Page for a long time. It stands for "PHP: Hypertext Preprocessor."
  15. Re:PHP can do allot by totallygeek · · Score: 2, Informative
    I'm neither a java or php programmer, but I do work with both. While java is nice and portable, I'm very impressed with how far PHP (Personal Home Page) has gone. There are acclerator projects out there that cache php scripts, making them much more responsive. I use eAceelerator (formerly MmTURKE Cache or something like that) and it's obvious that php performance can be improved. For many a simple LAMP setup is very powerful, I've been using it for a website, as well as webmail, for over 4 years now.


    Two things:

    • Java may be portable, but a fair percentage of applications written with Java, both corporate and Internet, work only for an intended audience of operating systems. Java has evolved out of its starting premise of platform-independence.
    • PHP no longer is referenced as Personal Home Page. It is the PHP Hypertext Processor. For some reason, corporate types won't let you use something with the word personal in it, but annoying recursive acronyms are acceptable.
  16. Marc Andreessen is on Zend's Board of Directors by ChrisRijk · · Score: 5, Informative
    http://www.zend.com/news/zendpr.php?id=107
    Zend Technologies, Inc., the PHP company and creator of products and services supporting the development, deployment and management of PHP-based applications, today announced Marc Andreessen and Gaurav Dhillon as the newest members of the Zend board of directors.


    Little "full disclosure" for everyone.

    PS There's more to Java on webservers than J2EE. There's also multiple Open Source versions of J2EE.
    1. Re:Marc Andreessen is on Zend's Board of Directors by duncangough · · Score: 2, Informative

      Beat me to it, of course he's going to say that PHP is catching up on Java in the enterprise since that's where they want to take it and that's where the next pot of gold is.

      Sadly, PHP has hit a brick wall recently. There are backward compatibilty problems with PHP4 (not helped by the developers telling the community to stfu, noobs), PHP5 is not being picked up at any rate of knots and now people are look to PHP6 to fix all their problems. Ruby looks better by the day, to be honest.

      --
      Millionsofgames!

    2. Re:Marc Andreessen is on Zend's Board of Directors by masklinn · · Score: 2, Informative

      Either Ruby (and RoR) or Python (and Django, Zope, the terrific TurboGears or any other framework) would probably be much more interresting and enjoyable.

      Do remember, though, that none of them are Java, you have to forget the Java way and "get" the philosophy of those languages or you'll end up frustrated with very slow apps and bloated code.

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  17. lingo... overload by jkind · · Score: 2, Interesting

    Is it just me, or is anyone else having "framework" and "standards" overload?
    Seems like every post mentions some form of standards or framework, and everyone wants to standardize everything within a framework. Or perhaps make a framework which will help standardize everything. I can't stop saying standards framework.......standards framework..... I miss the old days when "ware" was the hot term.. webware..awareware..opencourseware..cookware..
    On topic.. Php is just so much more fun then Java... (except when you're first loading it into Apache for Win and Apache just tells you "failed").. And I visit phpclasses.org almost daily, just because there is lots of cool stuff there to try and play with. Kind of like javaboutique, but not as stale..

    I do think it is an exaggeration to say Java is failing.. Although C#/.NET seems to peck away at the domination every quarter.. Way off topic: Does anyone have a website which lists the "top skills" as listed in job postings online? I used to visit such a site for jobs in the UK but can't find it anymore, and doing a search on google for "top skills job postings C# Java" is a fruitless endeavour.

    --
    ~jennifer.k~
  18. Here we go... by Naikrovek · · Score: 2, Insightful

    PHP just isn't on the same standard in my eyes as Java or C#. Doesn't PHP have something like 3,000 built-in functions? That is not a sign of a well designed language.

    J2EE has a very well-respected place in larger organizations. The support is fantastic, the tools are fantastic, and the language is actually very nice, once you truly get to know it.

    I used to think that Java was slow and useless, but when I actually started writing a lot of it, I found that its really not as bad as everyone told me it would be. Java is becoming the new COBOL as far as business acceptance goes, its everywhere that it needs to be, from what I've seen.

    PHP is good for its own uses as well. I started programming in PHP, and I've written dozens of website backends in PHP, but the Java families (and other OO languages like C++ or C#) are just more elegant for the larger projects, web-based and otherwise.

    I wish PHP and PHP programmers the best. Go, spread to anyone you can, but stay away from me. I've found a new girlfriend, and her name is Object Orientation.

    1. Re:Here we go... by Anonymous Coward · · Score: 2, Interesting

      PHP just isn't on the same standard in my eyes as Java or C#. Doesn't PHP have something like 3,000 built-in functions? That is not a sign of a well designed language.

      Doesn't Java have like 5,000 built-in classes, let alone functions? And then the web page support adds on more classes and more functions. This is not the sign of a well designed language...

      (And, yes, they are the same things. Most of those "3,000 built in functions" are actually libraries. You can strip them out if you really wanted to. I have no idea how you'd strip out the massive Java library bloat, though. Probably why Java's runtime comes in at like 400MB (410 MB on my machine, but that includes the docs), while PHP boasts a slightly trimmer and more functional 20MB or so runtime.)

  19. PHP, or Ruby? by tcopeland · · Score: 2, Insightful

    Seems like Ruby on Rails is competing for web apps too - lots of comparisons are floating around out there. Some large sites are converting over, too, like Derek Siver's "CD Baby" - he blogged on the conversion here.

    I've certainly found Rails to be a good fit with interfacing with a Jabber PostgreSQL backend. Good times!

  20. Apples and Oranges? by Dekortage · · Score: 3, Insightful

    I work with PHP and Java (and JSP and XML and enough other acroynms to choke a hippo). Andressen's comments seem so clearly aimed at server-side Java. PHP doesn't do client side, though there are projects underway like GTK and WinBinder. But still... Java was supposed to kill C, and it didn't. PHP won't kill Java either.

    --
    $nice = $webHosting + $domainNames + $sslCerts
  21. Bitter by cparisi · · Score: 2, Interesting

    Andreessen sounds bitter about Java and Sun in general. Maybe he attributes Netscape's ultimate "failure" with their misplaced focus on creating a browser written in Java. Netscape placed a lot of faith and resources in Java and perhaps he feels betrayed or disillusioned. Anyway, I agree that PHP is better (or at least easier to use) than Java for some things. But it is not a replacement for Java.

  22. PHP wins - it's economics by CousinLarry · · Score: 3, Insightful

    Yes, both PHP and Java are free - i'm not talking about the monetary cost of either platform.

    I'm talking about the network effects of PHP being available on every shared host in the world.

    Try to find a cheap, reliable tomcat hosting service. Then throw a dart at a google search for "web hosting." You'll find that outside of enterprise, PHP is the lingua franca.

    So if you're a poor student or struggling entrepreneur looking to make an experiment or prototype, you will naturally gravitate toward PHP (same argument works for mySQL/postgre v the world). And guess who will populate the next gen of enterprise?

    1. Re:PHP wins - it's economics by orasio · · Score: 2, Insightful

      I was a student in 1996, and I learned ASP for a specific project. Some time later, I found PHP, and liked it. I did some stuff with PHP. I really admire Rasmus, I met him when he came to Uruguay, and he is great. I believe PHP is a great idea, and works great.

      But now I use Java, because I think it's much easier to work with, when you have teams of more than two people. PHP gives you too much freedom to be easily managed. It's nice for experimenting, for stuff you want to see right away, for complex stuff you don't have to maintain for others, too.
      I like better the ability to have interfaces, standards, Struts, lots of things that make Java better for developer teams.

      The same that the guys who start right now with PHP, they might or might not change.

  23. PHP Succeeds Because It's Not Overkill by sbma44 · · Score: 3, Insightful

    I primarily work in ASP.NET, and have done some work with JSP. Those are nice environments (well... ASP.NET is, anyway) -- but for many, many things, they're overkill. A robust OO model is nice for making programmers feel comfortable, but until recently the web has been an inherently procedural undertaking. ASP.NET and AJAX are putting an end to this, but the underlying technology remains stateless.

    PHP is procedurally oriented, works well, and -- most important -- is free. I can't convince my boss to touch it, of course, but if some names get behind it, it might become a much easier sell.

  24. Java vs PHP development by totallygeek · · Score: 5, Informative
    I am an owner of a software development company, and I can tell you that both have their place. All languages (and sadly, operating systems) are tools and it makes sense to use the right tool for the job. Languages we may be using depending on the task include C, Pascal, DataFlex, Java, PHP, Perl, Python, and even bash. Someone might ask why Pascal; which is because we have a well-defined set of libraries for that language which allow us to access many other applications, which in another language would be difficult or expensive to recode.


    All that aside, we typically use PHP for all web-based applications. The ease of coding, and the ability to affect change with zero downtime is a big plus. We can have several programmers affecting changes in one codebase in real time. And, for a program which took us six months to develop in PHP, it would have taken at least fifty percent longer with Java.

    1. Re:Java vs PHP development by jcoleman · · Score: 2, Insightful
      We can have several programmers affecting changes in one codebase in real time.

      I'm not sure why you think
      a) this is a good idea to do in PHP, and
      b) this can't be done in Java.

      And, for a program which took us six months to develop in PHP, it would have taken at least fifty percent longer with Java.

      And now it will take you at least two hundred percent as much time to maintain.

  25. very biased article by Philodoxx · · Score: 5, Insightful

    I'll come straight out and admit that I'm a Java programmer, but I've used PHP and I will admit it is simple to use.

    I find the comparison that the article makes between them is very one dimensional, it's saying that PHP is better than JSP, which I suppose is debatable (I prefer JSP ;) ). The problem is that Java is so much more than just JSP on the server side, it has an entire framework of technologies (some part of J2EE, some not) that make it a complete package. If they want to compare Java and PHP, it should bring in not only ease of development, but scalability, interoperability and security. I would have also liked to see the number of commerical websites running PHP vs the number of commercial websites running Java. For instance my home page has TorrentFlux on it, which is php based. So I guess I fall into that 22 million, although that's not really by design.

    I won't try and say Java is better (because of my limited PHP experience) but if an author wants to convince me that PHP is better than Java, it's going to have to talk about more than simplicity and hype.

    --
    Oh, a lesson in history from Mr. I'm my own grandpa.
  26. Let's send an in email by tertullian · · Score: 2, Insightful

    Let's see In Java: import some.crap; import some.more.crap; import yet.some.crap; class SomeMailClass { create object 1 create object 2 create object 3 call object 1.somefunction(); call object 2.somefunction.bloated(); call object 3.somefunction.Ihave.lost.interest.already(); blah, blah, blah } now, let's do this in PHP. mail('me@mydomain','Subject',$message,$headers); In Java: For the above code, I'll bill out an hour to my client just for writing and compiling the class. Oh wait, there was a compile problem, let's debug...recompile, wait, wait, wait... ok, let's get started on the next part In PHP: I sent an email, ok, let's get started on the next part. I'll bill an hour to my client have something to show for it.

    --
    Goal in Life: Learn as much as I can...
  27. Success through lack of hype by Pike · · Score: 2, Interesting

    PHP might well succeed where java has failed, but it will be because:

    - it's used on its merits, not because of hype, or a New Gospel of Platform Independence
    - it's simpler and faster
    - it's not being touted by a huge company such that it shows up on MS's radar as a challenge ...which are also things that Ruby has going for it. Or Python. The point isn't that PHP succeeded, the point is that java failed (at becoming kingathehill) and why it failed.

  28. flamebait! by Anonymous Coward · · Score: 2, Insightful

    There should be an option to moderate a whole article as flamebait!

  29. this is sad by namekuseijin · · Score: 3, Informative

    The alternative to extremely bloated and redundant java and .net web technologies is an extremely basic (old)ASP-alike with all functions and variables sharing the same namespace and global variables running wild. Granted, it's easy. Just as easy as notepad and just as featureless and error-prone...

    Hey, i'm just as annoyed at java and .net as everybody else, but i'd point to Python, Ruby, Perl or Tcl technologies rather than this sub-Perl refugee...

    --
    I don't feel like it...
  30. I risk being tagged elitist, but... by Snowhare · · Score: 5, Insightful

    PHP is and will be continue to be popular with the masses simply because, like HTML, the entry barrier is very low. It will fail to make deep inroads at the high end for the same reason: The entry barrier is very low.

    Sounds like a contradiction? Not really. The entry barrier for PHP is so low that we are seeing zillions of poorly written, insecure and unscalable PHP apps written by amateur programmers. Resulting in numerous security scares about PHP and contributing more than slightly to the infamous Slashdot Effect where a site that gets a sudden traffic surge craters as it runs out not of datapipe but simple CPU power. This scares the hell out of anyone who considers using PHP in the enterprise.

    Don't get me wrong: It is possible to write good, secure, scalable code in PHP. It just isn't very common.

    1. Re:I risk being tagged elitist, but... by dun0s · · Score: 2, Informative

      Sites that suffer the /. effect do so because they are not expecting the traffic. In the same way that very large enterprise websites that suddenly release XYZ bit of software for download by the marketing department who never told the IT department also suffer a similar /. effect. It isn't always the language or the programmer or the scaleability of the website. It all depends on what level of traffic is expected.

  31. PHP: good for admins, not so good for developers by FedeTXF · · Score: 3, Interesting

    I teach PHP in college since 2001 and I use Java/JSP at work and at home since 2003.
    PHP is good for an admin to set up some forum, photo gallery, database administration front end, a CMS, whatever tool you can download form sourceforge and install in a few hours to give users/customers a service.

    When you need to develop a solution with specific needs and there's no tool to download and use right off the shelf, PHP gives you lots of headaches.

    The API changes a lot, very fast. This is not good. From PHP 3.0 to 4.0 things break and new stuff gets added so fast some sites have to keep using PHP 3 in order to avoid spending many hours recoding old code. Now PHP 5 is a new language altogether.

    Lots of changes are for good since PHP was really bad in some areas in early version so the rewrote everything form scratch, that forces developers to relearn and recode.

    The lack of abstraction in the PHP API leaves lots of stuff to the developer. For example, working with HTTP headers. The header function just sends whatever header you send in. You have to account for browser bugs on your code and maitain that. The manual is full of user comments regarding how to use certain function that give different results with different databases, browsers, platforms, Apache configurations, etc. Those things don't belong to API, there are bugs, but you have to work around them in your code.

    If you use a PHP CMS or a PHP forum, you know the people developping it will do the dirty work for you and release a quality product, but for a small organization with a few programers, migrating from PHP3 to PHP5 to get the new cool stuff they implemented is hard, painful and takes a lot of debugging time.

    In contrast Java has managed to keep backwards compatibility while adding new functionality and the API has been quite stable. Of course it has bugs, migration problems and imcompatibilities, but the java developers (SUN, Apache foundation, IBM, etc) make an effort to make developers' life easier. The PHP developers also try, but are less sucessful.

    At the same time in Java you don't have such a wide selection of free tools ready to use in a web site, but you do have tons and tons of libraries ready to be integrated in your java web app, which PHP has but in much smaller quantity.

  32. Re:Cliche Elitist Reply by TheSpoom · · Score: 3, Insightful

    And because I'm bored and I like PHP, my reply to all of the above:

    * PHP sucks.

    PHP has functions for practically anything you can imagine. Of course, I'll get into why it doesn't suck in the replies below, as this is a bit too general.

    * PHP is for n00bs.

    PHP is for developers who want to get something done quickly. The syntax is very easy to learn, and variables are loosely typed, but in my experience this doesn't mean that the language is flawed; it means that one can code up something without having to worry about unnecessary things like pointers, variable conversion and the like. And to be honest, in website scripting I've never come across a need for more advanced syntax than PHP provides in my five or more years of using it.

    * PHP is usually poorly written.

    This, unfortunately, is usually true. Because PHP is easy to use, it is often used by people who don't want to worry about writing good code either. But like everything else, there are varying grades of professionalism. PHP *can* be written well, it's just a case of taking the time to do so.

    * PHP is a scripting language and you can't do anything but write web pages with it.

    Scripting language, yes. But it most certainly can be used for things other than websites.

    * PHP sucks because the function names are inconsistent.

    True, but this is why one has a manual. I've never been all that concerned about it.

    * PHP is slow.

    Actually, it's really not. Take a look at this comparison between different CGI modules for Apache: PHP actually outdoes Perl here.

    * PHP isn't capable of working in a real enterprise.

    I haven't had experience with integrating PHP into an "enterprise" situation personally, but I'll refer you to Zend's Enterprise PHP page for various reasons why PHP is indeed ready for the enterprise.

    * Real coders use Perl.

    Real coders use the tool that best fits the problem.

    * PHP doesn't scale.

    Now THIS is something I can definitely refute. I work for a company that creates mods for a PHP / Smarty-based online shopping cart known as X-Cart and I can tell you, PHP scales wonderfully, otherwise stores wouldn't use it as a base of their business operations. X-Cart is on the order of hundreds of thousands of lines of PHP code, and very commonly has tens of thousands of customers accessing it concurrently.

    And yeah, I know you were joking, but hey, I was bored. ;^)

    --
    It's better to vote for what you want and not get it than to vote for what you don't want and get it.
    - E. Debs
  33. Java never seemed intregrated with the browser by xtal · · Score: 2, Insightful

    Applets, apps.. whatever, Java never seemed to flow as an extension of the browser in the way that PHP did. It always seemed to be a better C++ (flame suits on) with one hell of a standard library built in.

    Unfortunately, the answer to "it's not fast enough" always seemed to involve a very heavy, expensive machine from Sun. Hrmm.

    Microsoft's solutions always seemed inelegant to me.

    PHP always was, and is, about making web applications and database interfaces very efficiently.

    Why is it suprising then, that it would be adopted?

    --
    ..don't panic
  34. web apps all have the same problem: the browser by helix_r · · Score: 4, Insightful


    Web apps all have the same problem. They use a goddamn BROWSER as the application platform. This sucks.

    I'm looking at a typical jsp right now. Its an awful demoralizing conflation of xml, css, jstl, html, and javascript-- all in one file. As developer, it sucks to work with and it is a major hassle to create a nice user experience with this trash y stuff.

    I have not worked with PHP, but looking at the source from the browser page, I imagine the same problems apply.

    Whatever happened to the "applet" concept? True, there were problems with it initially, but one would think that these problems could have been solved by now. Instead, the industry turned away from nice clean designs to the brutal mess that is today's web app.

  35. As a Java developer with PHP experience... by pico303 · · Score: 5, Insightful

    ...I can honestly say I avoid PHP at all costs. PHP feels like it was built by committee: there's no consistency in the language. Even with 5 I still feel like I'm hacking together web pages.

    I feel like there's a lack of standardized libraries for PHP. I've used PearDB, but it's sure not ActiveRecord or Hibernate. Smarty's o.k., but I'm already developing in a template language for HTML pages, why do I need another one? It's like working with JSP tag libraries (which I find equally wasteful).

    Fundamentally, I think the tight coupling between view, controller, and model that PHP naturally engenders is bad. Practically, I've seen where Ruby on Rails has gone in just a single year, and it's further than PHP's gone in the last 5. Things you can do in Rails in a few days take weeks of coding in PHP, even with the help of third-party libraries.

    PHP has a strong foothold with small, inexpensive ISPs, which is the only reason I think that people still use it. Unfortunately, the "war" between 4 and 5 has really hurt the credibility of PHP moving forward. Does any ISP support PHP 5?

    If PHP wants to compete against Ruby on the low end and J2EE and .NET on the high end, it's going to need new development tools--both for writing the code and useful libraries, stronger leadership, and a clear plan for the future. I don't see any of this happening in its current state. I consider myself to be a PHP outsider these days, and looking in it doesn't look so fun in the pool.

  36. This is an API complaint, not a language complaint by israfil_kamana · · Score: 3, Interesting

    If you have such problems in Java then write a really small little class that does all this work for you, generically, in one place, so you can access it by saying

    Mailer.mail(to,from,subject,message,header1 ... headerN);

    Many java frameworks are terrible, but that's a matter of API aesthetic. For instance, I hate the Java frameworks' APIs for reflection and dynamic method invocation and such. So I wrap it all in two methods

    public boolean canPerformMethod(String methodSignature);

    public Object performMethod(String methodSignature,Object param1 ... Object paramN);

    (Note: the above is pseudo-code so I don't have to explain how to do variable number of parameters in Java 5 - not all /.ers are Java coders.)
    (Note2: By using aspect-oriented programming, I can insert these methods high-up in the object-hierarchy)

    The point is that now, anywhere in my code I can dynamically invoke methods by:

    Foo result = null;
    if (target.canPerformMethod("processFoo:String:Foo")) {
          result = (Foo)target.performMethod("method:String:Foo","Pro ccessing Foo",aFoo);
    }

    That simple structure replaces about 10-20 lines of exception handling, method lookup, and all sorts of crap, because I (wait for it) encapsulated it.

    I'm not saying it's not convenient to have mail(...). Of course it is. But the point of languages like Java is that if you have a preferred API, you can wrap the complexity of a crappy API with a nicer convenient one in your own code. That's called good programming. No actualy need to whine.

    It's only when the raw functionality is not there, or when the raw langauge/runtime capabilities don't actually allow you to create the functionality you want in a convenient form - that's when whining is necessary. But modern Java, with Java 5 + aspectJ pretty much allows anything to be created in relatively convenient APIs.

    The only remaining issue is to convince someone at Sun to refactor their core APIs into something that provides some of this convenience out-of-the-box. Or go write Objective-C against the Cocoa APIs on MacOSX. They're pretty nice.

    --
    i - This sig provided by /dev/random and an infinite number of monkeys at keyboards.
  37. Since When Has Java Failed? by the+eric+conspiracy · · Score: 3, Interesting

    This article is a crock. PHP is great for your $10 a month hosting service domain on a shared server, but Java has been and continues to be the market leader when it comes to writing web based functionality that integrates across an entire enterprise.

    Try doing this in PHP.

    There is a reason that eBay handles 1 billion transactions a day on Java.

    1. Re:Since When Has Java Failed? by drew · · Score: 4, Funny

      There is a reason that eBay handles 1 billion transactions a day on Java.

      Because they run it on a million servers?

      --
      If I don't put anything here, will anyone recognize me anymore?
  38. The problem for casual Java is hosting (price) by buddylee · · Score: 2, Interesting

    I'm running into this now, but to get wide acceptance, hosting for Java needs to come down in price. For instance, I can find a company to host my html website for $10/year. I can find a company to host my asp/asp.net website for $3.99/month and I can find a company to host my php site for about the same. The CHEAPEST java host I found was charging about $15/mo for fewer feature addons (bandwidth, space, etc) than the $3 php or asp hosts.

    It's not difficult to see why Java isn't in the mainstream as far as casual or moderate web developers go.

    And I really don't understand why the cost is so high since everything Java hosting uses is supposed to be free (compared to buying IIS & a windows server).

  39. Re:Java failing? by bloo9298 · · Score: 2, Insightful
    It's not quite clear from the article where Java is failing.

    On the contrary, the article makes it very clear: Java is failing to provide income for Marc Andreesen.

  40. Parallel universe? by lorcha · · Score: 3, Funny
    I think Andreessen is operating in a parallel universe that is different from the one in which we live.

    Fact: PHP was released on June 8, 1995.
    Fact: The Java Servlet spec (first server-side Java) was released over 4 years later on October 1, 1999.

    After 5 years, Java as caught up with and far surpassed PHP in terms of usage, tools, maturity, etc. Java is showing no signs of slowing down. I don't know what iPlanet Marc is on, but on my planet, if you want to do any server-side web programming, you better know J2EE or .NET.

    Also funny was this quote from TFA:

    "I think Flash is one of the most exciting technologies out there that's almost on the verge of great success and never quite achieving it," Andreessen said.
    Uh, yeah, Marc. That falls solidly in to the category of "thing we wish were true but aren't." I wish Flash wasn't so popular, but the fact is it's used very heavily.
    --
    "Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
  41. It's getting there, but it has its problems by bigtrike · · Score: 3, Informative
    I've used PHP for years and by now I have a love/hate relationship with it. Some of my biggest issues with php are:
    • Lack of binary compatibility even on debug fix releases. My code shouldn't stop working when I upgrade from 4.3.2 to 4.3.3 due to an undocumented addition of a run time warning
    • Error reporting must be turned down well below useful levels in order to use PEAR in PHP 5. Ignoring E_NOTICE level warnings is usually a very bad idea, but necessary until PEAR works in PHP 5
    • Code can't be entirely compatible with PHP 4 and 5 standards (var produces warnings in PHP5, public/private does not work in any PHP 4)
    • Lack of standardization of function naming and argument order. I always have to check whether the function I'm using has an underscore between the words and whether it's needle, haystack or haystack, needle
    • Kitchen sink approach. Again, all functions are in the same namespace. This results in some pretty weird function naming
    • Lack of great debug support. xdebug sort of works, but is still very immature
    • Loose typing. You have to study the documentation very carefully in order to understand how to compare variables and get the expected result. In addition, since type conversion is automatic and performed on numbers when they exceed certain ranges, precision may be lost unless you have a very detailed understanding of how and when type conversions happen and plan out the numerical ranges of your variables accordingly
    • Caveats with unset()/isset/null/arrays


    PHP may have a bunch of issues, but it's still the best tool for my job.
  42. Re:Native compiled PHP with a widget set? by vidarh · · Score: 2, Informative

    You mean like PHP-GTK?

  43. Re:Pardon me while I unroll your eyes by Mateo_LeFou · · Score: 2, Interesting

    TFA has a perfect example of andreessen using the right tool for the right job: "Andreessen, who just helped launch a start-up called Ning for sharing photos, reviews or other content online, acknowledges that Java has its place. "'My new company is running a combination of Java and PHP. This is something I get no end of crap about,' he said of the technical decision. 'We have a core to our system that is built in Java. It is more like an operating system, like a system programming project. Then we have the entire application level--practically everything you see is in PHP.'"

    --
    My turnips listen for the soft cry of your love
  44. Have to chime in here as a new Railer... by 5n3ak3rp1mp · · Score: 2, Informative

    I know this is about PHP but as a long-time web developer, I'm sure a lot of other web devs will be reading this, so here are my observations on RoR.

    I've started my first small-scale Ruby on Rails project, having done work in the past in ASP, .NET and PHP. Here are some thoughts.

    1) RoR may be highly buzz-worthy but it is certainly NOT a panacea. It has a definite and slightly steep learning curve, especially if you are also new to Ruby and/or OOP and/or MVC (I am sort of but not completely new to all of these). You will still have to do the work of developing your application- you just won't have to do the "stupid" kind of work that much (repeating code in views, bubbling new database fields through umpteen app tiers to the surface of your app, hand-validating everything, building a mechanism to bubble errors or notifications to the surface, etc. etc.)

    That said...

    2) I can see that if I can get past the little syntactic things that are currently tripping me up, a lot of the RoR technology (and all the assistance its framework provides, once you get to know it... again, that takes time) helps to make web development a breeze.

    3) MVC certainly seems like a pattern to seriously consider for anything other than a small web app. Mixing code in the presentation layer is not the way to go if you want easy unit testing, separation of view from code (so your graphic designers can go in and do their thing separately), arbitrary mixing of controller code with different views, etc.

    4) Ruby itself is a pretty great language to code in and highly readable. It has a few quirks (doesn't every language?) but if you are aware of them then they won't get in your way. Some of the things I like about it were apparently "borrowed" from Perl (as I never really got that into Perl). If you are not a static-typing purist, I'd say check it out on its own.

    5) Installing some Ruby/Rails components that depend on each other is not at ALL as painless as it should be on OS X. For example, I'm currently having issues with RMagick and GraphicsMagick even though I followed a guide I found online, to the letter. I think the darwinports, fink, and rubygems people should get together and work some shit out, as all the different default paths these packaging/deployment tools install their stuff to causes mutual interdependencies to sometimes fail. I've also seen some MySQL issues that will require good troubleshooting to resolve, for some people- some of it is based on incompatibilities with GCC 4.0, or between the password hashes of different MySQL versions, or... Basically, this is all stuff that as a Rails scripter (as opposed to a C++ programmer) you wouldn't want to focus too much time on. If you want to know what I'm talking about just google "rmagick 'os x'" or "mysql rails 'os x'" and read up. That said, if you can get a good host with good Ruby/Rails support, you might not need to worry about such things... Unless you want to develop locally on that shiny Powerbook (grrrr). You better be a good troubleshooter, as Google won't get you out of EVERY bind!

    6) The people on the #rubyonrails IRC channel on freenode are generally helpful, but not at all hours of the day. It also helps if you put up small PayPal rewards to get someone to help you over those time-sensitive humps ;)

    7) Managers at big corporations (such as my employer) who have been out of direct touch with technology for a while will only tend to recommend the "usual big stuff"- in this case Java/EJB/Oracle, or .NET. I suppose this falls under the "Nobody ever got fired for recommending IBM" paradigm, but the si

  45. Silly argument by pavera · · Score: 2, Informative

    Ok, I've been developing for 12 years now, and almost purely web development for the last 4. I generally use PHP for what its good for (page generation, presentation layer type stuff), and use xml-rpc or SOAP from php to connect to java, python, perl, or c++ whatever has the best libraries/capabilities/ease of use for what I'm trying to do. I've actually moved almost exclusively to python as my backend/business logic language of choice, but Java worked fine for this purpose 3 years ago too. To me, setting up struts, jsps, all that garbage is a ton of overhead that a simple soap/xml-rpc setup easily replaces (and in my experience php + soap/xml-rpc + languageX is faster than an all java setup). PHP then can do what its best at, my frontends are very lightweight, and load almost as fast as static html, and I use a real language for logic and libraries etc. Now maybe this new PHP Framework will provide some classes and things that would be useable on the backend, I dunno.

    The setup I use is basically the J2EE model, except I get the best of all worlds, because I can access code written in any language seemlessly, use n-tier architecture without even thinking about it, use advanced cacheing libraries available in the higher end/heavier languages, and because the backend code is running as a daemon running a soap or xml-rpc server, I sidestep the whole perl/python interpretter startup bottleneck.

    It's not about which language is "best" its about what tool gets the job done.

  46. What about the long run? by RAMMS+EIN · · Score: 4, Interesting

    I have to wonder about the long run here. When I work with Java, I find it a pain to work with, because of all the required boilerplate and the inflexibility. Things have probably gotten better with Java 5, but Java has been a pain in all the years before it.

    When I work with PHP, I find it a pain to work with, because of its apparent lack of design. It feels like a cobbled-together heap of features and hacks, and so does the code written in it. I tend to write cleaner code than what I've seen from other people, but that doesn't make the final product any less messy when various people have worked on it.

    Neither language is absolutely horrible; comparing them to others, Java is a language with a relatively clean design, and PHP is a good choice in its niche of writing web applications. However, my pain in working with these languages is a direct result of these languages being poorly designed. I'm into programming languages, and I know many that have better designs than Java and PHP. I wonder if these languages won't take over in the future.

    Some changes are happening already. Various organizations are moving away from Java for web applications, and I know others that would do well to do so as well. Much of the work that went into PHP 5 comes from a realization that earlier versions were flawed (the same can be said of Perl 6). Ruby appears to be on the rise. Paul Graham and others have had good results employing Common Lisp for web applications.

    The only thing I can see standing in the way of better languages taking over the web application sphere is the fact that the decision making process is based more on fame than on qualities. I maintain that Java has become so successful largely because of the enormous hype surrounding it. PHP, Linux and MySQL have also risen largely due to hype. Of course, it's true that you won't overly disadvantage yourself if you use whatever most others use, but it would still be better if decisions were made based on sound knowledge of technical benefits.

    --
    Please correct me if I got my facts wrong.
  47. Programming tools? by Mike+McTernan · · Score: 3, Insightful

    > Indeed, many credit Microsoft's success to its highly
    > regarded programming tools, which make it easier for
    > developers to write software that run on Windows.

    Bleh. Windows doesn't even come with a compiler.

    I think that's probably why a lot of developers like Unix so much - most systems come with a compiler as standard and the man pages give you all the APIs you need. Grab your favourite editor and off you go!

    --
    -- Mike
  48. I won't step into the language wars here, but... by smagruder · · Score: 2, Informative

    PHP-based applications can be great if designed by good programmers.

    For proof, just look at some of the projects using PHP: Mantis Bug Tracker, PHPMyAdmin, MediaWiki (Wikipedia), several top discussion boards, Friendster, reportedly apps by Yahoo, and countless others.

    These are HIGH-QUALITY web applications. Of course, great things can be done with other platforms, but it's nonsense to slam PHP because "it's so easy that non-programmers produce a lot of crap code with it". The proof that it's worthy is in the *best* apps that are produced, not the worst ones!

    --
    Steve Magruder, Metro Foodist
  49. J2EE Sucks by multipartmixed · · Score: 4, Funny

    I don't write in either Java or PHP -- I'm a Grade-A C-slinger -- but here are my REAL-WORLD experiences with both platforms.

    C Coders perspective:

    PHP - I wrote some objects for PHP5 about eight months ago. The documentation blows, I had to use gdb and a notepad to figure out some of the idiotic details for accessing the symbol table and so forth. The Horrible, horrible dangling-if-macros are terrible. Took 3 days (from "I know nothing" to "I'm done and debugged").

    Java - I wrote some JNI interfaces. Actually, they interfaced to the exact same code as the PHP5 modules! (Making a useful C library, encapsulated in C++ objects usable across Java and PHP platforms). Easy stuff! I used cxxwrap. Took 1 day.

    Manager's Perspective (I wear that hat, too): PHP is pretty cool, as long as you treat it like a programming language and perform proper data abstraction, code layout, blah-de-blah. "Web guys" need to learn awful fast that "Web Programming" had better be treated the same was as system programming, or large applications become difficult to manage. PHP does little to enforce this (hey, just stick some code right in the middle of the style sheet!), but good discipline will solve all of PHP's major problems.

    It's also nice when PHP the guys ask for help, I say "C library function XXXX will solve your problem" or "the underlying OS call behaves this way, that's probably why you're having issues..." and it transliterates directly into PHP. (And I can look at the PHP sources and actually understand them).

    Java, on the other hand -- I can't take my years of experience with the UNIX OS and help anybody coding on Java, because it has absolutely nothing in common with the underlying OS, POSIX, etc. Now, that may not be all that bad, but it's damned frustrating when you plan on doing common, every day operations that work anywhere else BUT Java, and have the platform smacks you in the face.

    For example, say you need to link two different web hierarchies together (say, images from your apache server and the same images in your tomcat container). You'd make a software link, right? OH, NOOOOO, you make a soft link and then you spend the next three hours figuring out why the fuck it doesn't work, because those asshats who designed the platform didn't like them, so you instead have to hunt through cryptic XML configuration files to find out how to turn on some asshat undocumented directive to allow a BASIC FUNCTION OF THE OPERATING SYSTEM.

    For fuck's sake! Now, I suppose the above criticism is more a J2EE criticism than a Java critism, but, if we want to compare apples to apples, .php vs. .jsp seems right on target. So let me enunciate very clearly:

    J2EE SUCKS HUGE DONKEY BALLS.

    Essential redux: Each PHP guy gets more done in a day than two Java guys get done in a week.

    Why? How can this be? Java solves everything except world hunger!

    The Java guys spend three days a week debugging shit that's gone wrong with Tomcat on one server or another. It's always some incompatibility here, surprise-bite-you-in-the-ass-there. Two applications on the same server use the same JAR file, so the containers refuse to load. That sort of thing. Sheer idiocy.

    Then they spend one day debugging shit that's gone wrong with Eclipse (or its mangling of the CVS repository, or some ant dependency problem, or)... then they spend half a day each writing code, and another half day synchronizing their changes. And meanwhile they whine that 256 megs of RAM isn't enough to edit a fucking text file (and do NOTHING else at the same time).

    And Lord help you if you want to add another table to the database and want them to do something as silly as retrieve the data from it and put it on a web page. Apparently, this is incredibly difficult, because it involves creating new hibernate objects, which of course fucks everything else in the ass, well, because, something called hotspot didn't get it's monthly fucking hormone shot or som

    --

    Do daemons dream of electric sleep()?