Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Python/Perl/PHP versus Java

  1. Mar 17, 2005 #1

    dduardo

    User Avatar
    Staff Emeritus

    In terms of enterprise web development why would you choose Java over Python/Perl/PHP? I ask this question because i've done significant web development with both Python and PHP and have recently been dabbling with jboss/tomcat/j2ee and have found that Java is very cumbersome. Not only is it a pain to program for, it is a resource hog. My personal opinion is that Java is an unweildly language obfuscated by marketing/legal mumbo jumbo. Just trying to find/download anything from Sun's website requires an immense amount of patience. I've come to the conclusion that the only companies wanting to implement any web frontend/backend in Java have a huge burning hole in their pockets.

    Sorry if this sounds like a rant, but I just want some honest responses.
     
  2. jcsd
  3. Mar 17, 2005 #2

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    For back-end web development, I'd pick one of the text-processing-oriented langauges like PHP, too. If I needed object-orientation, I'd pick Python.

    - Warren
     
  4. Mar 17, 2005 #3

    dduardo

    User Avatar
    Staff Emeritus

    I totally agree. Then why are so many companies investing in Java? Is there something special that Java provides that would compel them to choose this technology? I think Yahoo got it right:

    "Yahoo is a cheap company. It can't afford to waste engineering resources."

    They are currently running on php with a sprinkling of python.
     
  5. Mar 17, 2005 #4
    If you wanted to do anything multi-threaded, or distributed, Java makes it pretty easy.

    I have not found Java servlets to be that cumbersome. I haven't tried the J2EE/Struts stuff.

    PHP is good for doing simple things - but becomes a pain for large, complex projects because it is untyped.

    Last time I tried Python, their DB support wasn't up to snuff, at least for the DBs I was using - PostgresSQL and MySQL(yeah I know - yuck)
     
    Last edited: Mar 17, 2005
  6. Mar 17, 2005 #5

    graphic7

    User Avatar
    Gold Member

    Perl and Java both have the best DBCs. Even moreso, Java's DBC support is more optimized for higher-end databases like Oracle or Sybase.
     
  7. Mar 17, 2005 #6

    graphic7

    User Avatar
    Gold Member

    Well Sun's target for Java is the professional market, not hobbyists. Java is a resource hog - 1.5 isn't that bad, but 1.4 and 1.3 both had some issues. Where Java really shines for web programming is high volume sites. You should hear some of the nightmares of people running Apache and trying to serve a high amount of users with a Perl frontend. You'll hear about all sorts of hacks (mod_perl hacks and DBC modifications) , etc. to help ease all the simultaneous database connections that are going on. I've heard of similar nightmares with Python and PHP.

    Also, most companies that do use Java for web frontends don't worry about the complexities of Struts, J2EE, etc. They have programmers that just worry about writing the frontend, and system administrators that implement the applications once they've been written. I'm sure you're finding it tedious to try to program with Java and maintain a J2EE configuration. That's not what any real environment will be like, though.
     
    Last edited: Mar 17, 2005
  8. Mar 17, 2005 #7

    dduardo

    User Avatar
    Staff Emeritus

    Python makes mutli-threading a piece of cake. Two interfaces are provided. The low level interface and the easy way is to basically do this:

    start_new_thread(function_name, args)

    You can't get any simpler than that.

    The other interface is high level uses the thread class. You pass the target and various other parameters to the constructor. To start the thread you do threadname.start(). You can even daemonize a thread by using the setDaemon function.

    ------

    As for distributed computing, just check out the original Bit torrent project. IBM also offers a good intro into grid computing with python:

    http://www-106.ibm.com/developerworks/edu/gr-dw-grpintro-i.html

    ------

    If Yahoo isn't big enough I don't know what is. Also check out Sourceforge.

    ------

    I haven't had an issues with the postgresql bindings. If it is an issue you can always create a c++ module that uses the c++ bindings that you import into your programs. But I guess thats what they do already anyway.
     
    Last edited: Mar 17, 2005
  9. Mar 17, 2005 #8

    dduardo

    User Avatar
    Staff Emeritus

    That's a major problem. You need more people maintaining and as a result costs a lot more money. I would prefer to throw more computers at the problem than pay full salaries.
     
  10. Mar 17, 2005 #9
    I agree. Almost any language can be made to work in a situation if you're willing to throw enough time and money at it. What does that tell you about the language? Almost nothing.

    People are far too willing to forgive programmers and companies that produce overly complex products and then justify it after the fact by claiming that the tool is only "designed for professionals". There's a big difference between "designed for professionals" and "you need lots of time and money to burn in order to make this work". The second doesn't necessarily imply the first.
     
  11. Mar 17, 2005 #10

    graphic7

    User Avatar
    Gold Member


    Are you referring to Java in this statement?
     
  12. Mar 17, 2005 #11
    And what language does Yahoo use for Yahoo! Games?
    :smile:
     
  13. Mar 17, 2005 #12
    Somewhat; for things like J2EE (which actually was designed for large, heavyweight systems) I don't think it's wrong to tell someone that this tool wasn't designed for them. So long as it's done up front.
     
  14. Mar 17, 2005 #13

    graphic7

    User Avatar
    Gold Member

    Well, if you disect the J2EE acronym you get Java 2 Enterprise Edition. This should tell you whether or not it's designed for you. I won't argue the fact that J2EE is a very complex product. You have Tomcat, ant (I believe, they're including this nowadays), and the whole administration interface, a few plugins for LDAP, Web Start (this allows rapid remote deployment of Java applications - very nice, too), plus J2SE.

    Disecting J2SE, we have Java 2 Standard Edition. I don't think anyone would argue that J2SE is overly complex. There's the JVM, the bytecode compiler, source code, the API documentation, a few other little things (like the debugger, remote debugger, Web Start client, etc.)
     
    Last edited: Mar 17, 2005
  15. Mar 18, 2005 #14

    dduardo

    User Avatar
    Staff Emeritus

    so-crates, of course Java can be used to make online games, but I actually prefer flash games because the stupid JVM doesn't keep on crashing. Regardless, the focus of this thread is on server-side programming, not client-side.
     
  16. Mar 18, 2005 #15

    dduardo

    User Avatar
    Staff Emeritus

    This is what I mean by marketing mumbo jumbo. If I forked Python and renamed it to Python Enterprise Edition, other than being a really bad acronym (PEE) :rofl: , does this make it any more appropriate for enterprise level programming?
     
    Last edited: Mar 18, 2005
  17. Mar 18, 2005 #16
    Just sticking "Enterprise Edition" into a name isn't being upfront. Sure, I know that some guy running a server out of his basement shouldn't use it, but how large should a company have to be before they have enough resources to get a J2EE-based system working?

    I think the standard edition is unnecessarily complex, but it's still good enough to be useful. I just wish more of an effort was made to make the language good at doing simple things.
     
  18. Mar 18, 2005 #17

    graphic7

    User Avatar
    Gold Member

    Would PEE have LDAP plugins, a rapid remote installation service, Tomcat, a Python make, a web administration interface?

    If PEE did have a simple package that contained Python, bundled with Apache and some plugins, a sleek web administration interface to distribute the Python apps to multiple servers, I would consider that Enterprise. If you haven't gotten it by now, an "Enterprise" package is something that is easy to administer for a high volume of users. J2EE has a all of thus: a) the web administration interface makes it very, very easy to move Java apps/containers across systems b) for client-side apps, show me a utility that does something like Web Start c) there's plenty, plenty of API documentation.

    Java could be streamlined a bit more. What people neglect to think of is that Java is a whole language. C has been around for much longer, and it's integration into an operating system is much cleaner. Sun, however, has to produce a version of Java for Linux, Solaris, and Windows, which is by no means an easy task. Each of those OSs are supported as well as the other ones (there are a few exceptions pertaining to file i/o and SWT). Sun also produces an Enterprise distribution for each of those respective platforms. Does Perl, PHP, or Python have a single package for Linux, Solaris, and Windows to install that configures Apache, comes with a slick web interface, and much more? No, you do it yourself, and that does not qualify it as enterprise-worthy.

    Edit: Zend, a PHP server that is propiertary, is an exception to the above statement about Enterprise readiness.
     
    Last edited: Mar 18, 2005
  19. Mar 18, 2005 #18
    You are the master of understatement. :smile:
     
  20. Mar 18, 2005 #19
    Hmm, I found this page quite interesting. I'll have to d/l the latest versions of Java, Python and Perl and see if its true. Wouldn't look too good for Python if it is.

    I think part of the reason for Java's success is it had a very easy to use, platform independent (OK, Unix and Windows) GUI long before Python or C++ ever did, and it people started using it for other things despite some of its deficiencies.
     
  21. Mar 18, 2005 #20

    dduardo

    User Avatar
    Staff Emeritus

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Python/Perl/PHP versus Java
  1. Numbers In Perl (Replies: 3)

  2. PERL Programming (Replies: 5)

  3. Java or Python (Replies: 13)

  4. A PHP modification (Replies: 9)

  5. AJAX versus JAVA (Replies: 45)

Loading...