Java is the SUV of programming tools

Our students this semester in 6.171, Software Engineering for Internet Applications have divided themselves into roughly three groups.  One third has chosen to use Microsoft .NET, building pages in C#/ASP.NET connecting to SQL Server.  One third has chosen to use scripting languages such as PHP connecting to PostgreSQL and sometimes Oracle.  The final third, which seems to be struggling the most, is using Java Server Pages (JSP) with Oracle on Linux.  JSP is fantastically simpler than “full-blown J2EE”, which is the recommended-by-Sun way of building applications, but still it seems to be too complex for seniors and graduate students in the MIT computer science program, despite the fact that they all had at least one semester of Java experience in 6.170.


After researching how to do bind variables in Java (see the very end of http://philip.greenspun.com/internet-application-workbook/software-structure), which turns out to be much harder and more error-prone than in 20-year-old C interfaces to relational databases, I had an epiphany:  Java is the SUV of programming tools.


A project done in Java will cost 5 times as much, take twice as long, and be harder to maintain than a project done in a scripting language such as PHP or Perl.  People who are serious about getting the job done on time and under budget will use tools such as Visual Basic (controlled all the machines that decoded the human genome).  But the programmers and managers using Java will feel good about themselves because they are using a tool that, in theory, has a lot of power for handling problems of tremendous complexity.  Just like the suburbanite who drives his SUV to the 7-11 on a paved road but feels good because in theory he could climb a 45-degree dirt slope.  If a programmer is attacking a truly difficult problem he or she will generally have to use a language with systems programming and dynamic type extension capability, such as Lisp.  This corresponds to the situation in which my friend, the proud owner of an original-style Hummer, got stuck in the sand on his first off-road excursion; an SUV can’t handle a true off-road adventure for which a tracked vehicle is required.


With Web applications, nearly all of the engineering happens in the SQL database and the interaction design, which is embedded in the page flow links.  None of the extra power of Java is useful when the source of persistence is a relational database management system such as Oracle or SQL Server.  Mostly what you get with Java are reams of repetitive declarations at the top of every script so that the relevant code for serving a page is buried several screens down.  With a dynamic language such as Lisp, PHP, Perl, Python, Tcl, you could do bind variables by having the database interface look at local variables in the caller’s environment.  With Java the programmer is counting question marks in the SQL query and saying “Associate the 7th question mark with the number 4247”, an action that will introduce a bug into the program as soon as the SQL query is modified (since now the 7th question mark has been moved to become the 8th question mark in the query).

149 Comments

  1. Jack Lund

    September 23, 2003 @ 1:05 pm

    1

    I thought I’d chime in here (and if this reiterates something already written here, forgive me) but I think the issue in your article has more to do with using the right tool for the right job than an indictment of Java, or any other language. Just as it’s silly to buy a Hummer to drive in the suburbs only, using Java and JSPs for a two-tier web application is overkill. In fact, that’s exactly what PHP was designed for. On the other hand, try using PHP with a three-or-more-tier, “enterprise” application, and you’ll soon find that you’re tying knots in yourself trying to get the sort of scalability you need.

    What’s at issue here is that it’s no longer relevant to know a programming language, any more than a carpenter can know how to use one type of saw. You need the flexibility to use PHP, Perl, Java, C#, VB, etc, where it’s appropriate, and to know when it’s appropriate to use what. This is part of what should be taught in school, because this is what real-world experience teaches us. Yet time and time again I see programmers trying to use their favorite tool in inappropriate ways. The issue isn’t the language, but the usage.

    While I agree the Philip has brought up some good points about the dopey way JDBC binds variables, you can find dopey things in just about any language or package. The important thing is finding the language that gets you to your goal in the quickest and most maintainable fashion.

    -Jack Lund

  2. Lofi Dewanto

    September 23, 2003 @ 1:46 pm

    2

    Indeed, this is quite interesting

    At University of Muenster (Department of Business Informatics and Controlling, Germany) I teach and conduct graduate students for doing their software projects. Yes, they have to make a practical software development project to finish their study. Most of them have heard some lectures about Software Engineering and Java. Some of them are already working in companies as Java developers (plain Java, without J2EE). All the projects I conduct are about building real world J2EE applications and most of them don’t have any experience with J2EE.

    For this purpose I build the so called EJOSA Template (Enterprise Java Open Source Architecture), which offers a fully-fledged template based Open Source J2EE development environment with Ant. Important principles in EJOSA Template:
    – KISS (Keep It Short and Simple). Install JDK, install NetBeans and unzip the ejosa.zip and you have everything you need with you.
    – No wizards, understand the process. At the end we want to have capable students, which do not only understand wizards and drag&drop but really understand the underlying development process.
    – Fast prototyping but the code must be maintainable and scalable. This is important because we want to reuse the code for our university’s projects. Therefore we need to have a good structure.

    I choose following Open Source products because of KISS principle:
    – EJOSA Template is fully independent of IDE but I always tell them to use NetBeans. Mount your project directory and use F6 to run every ant scripts (build app and execute app).
    – JOnAS for EJB container because of its very good documentation.
    – Enhydra + XMLC, because easy to handle: Normal HTML files + id => Flow of the application.

    EJOSA Template also integrates many other OS-Java libs (XDoclet, Velocity, etc.), but it’s not a must to use every single libs.

    So, with EJOSA Template + NetBeans I can offer them a ready to use Development Environment. Without this, you are lost in Java space! For more info about EJOSA Template (LGPL):
    http://prdownloads.sourceforge.net/ejosa/ejosa1.3.5-doc.pdf?download

    I tend to see 2 different groups of students:
    1) Students with very minimal Java knowledge. With this type of students, it’s very easy to handle the project. Introduction to UML, introduction to general J2EE, introduction to EJOSA Template (NetBeans, CVS, examples), that’s it, the project can begin. We discuss many things just through the project mailinglist. This type of students tend to follow the process, concentrate on the application problem and can finish the project successfully on time.

    2) Students with good until very good Java knowledge (with some J2EE knowhow). They tend to work in their own way. So, they try to make some improvements into EJOSA Template like:
    – I want to use Eclipse instead of NetBeans…
    – I want to use JBoss instead of JOnAS, etc…
    So, they are sometimes stuck into the Java technology details and forget what the real problem is. Surely they also finish the project at the end, but they sometimes need more time. On the other side this is good for EJOSA Template, because it will be improved by them

    IMO, the success of such a student project depends also on you as tutor. Just saying: allright, you should use J2EE and Hibernate to implement your J2EE application will not help them (yes, I’ve done this and had a bad experience with this).

    Anyway, creativity and freedom are important but you should show them the way…

    Lofi.
    http://www.openuss.org

  3. Mike

    September 23, 2003 @ 2:04 pm

    3

    It’s not just Java.. Perl has the same problems with it’s DBI and binding data:

    http://search.cpan.org/author/TIMB/DBI-1.38/DBI.pm#Placeholders_and_Bind_Values

    Of course, I know how to count so it’s not really a problem in either Java or Perl. And to think, I almost didn’t show up that day in kindergarten.

  4. Zoe

    September 23, 2003 @ 2:08 pm

    4

    Well… Java -the language- is just half broken… which is not too bad… or at least something one can easily work with… but, as Vadim Zaliva rightly pointed out, this should really be about “J2EE being the SUV of programming tools”… but, as always, the “customer/student” has a choice… just don’t drive that SUV… and blame yourself if you end up in that SUV nonetheless… this is your choice… this has not much to do with Java itself…

  5. Jason

    September 23, 2003 @ 2:16 pm

    5

    I don’t use my SUV to drive down the block to 7-11, I use it to take me to the beach with my surfboard strapped on top; to pack up the back and go camping in, to drive me over things and through things that other cars can’t. When I want to go to 7-11, I walk! But see… SUV’s actually allow for tremendous flexibility if you’d just use your imagination, and there are so many differen’t things you can do out there even in a web application environment.

    My most common critique of web applications is the HTML side. It makes it hard to get any kind of manageable UI when trying to communicate complex problems and associations to your users, but mostly just because its a prototyping language. Kinda like my experience with VB.NET. I’ve worked at many different companies from startups to behemoths and the startups that started prototyping with VB.NET on the MS platform and IIS ran into a serious problem as soon as they had to figure out how to scale their application. Why? ‘Cause the MS platform is a prototyping tool. MS has made it really easy to do all those things that every application needs to do upfront, and have integrated it with some really nice tools… MS has great tools I’ll give ’em that. But when you want to do things that actually require creativity and imagination in complex multi-teared environments where load balancing is a necessity and recycling your servers every couple of days isn’t an option, then you’re gonna need the flexibility that Java/J2EE provides you. I haven’t worked with C# yet at this point, but I’m very wary about MS app-server technology when it comes to scalability. And don’t even get me started on Security… ugh!

    None of this was readily apparent when I was in college… in fact, I had no idea about any of the bigger picture issues until I’d had 2 or 3 years of solid development experience under my belt. As mentioned above, there are many alternatives when it comes to Java. Flexibility and creativity are key there. Wanna spend time in memory management? Go with C/C++. Wanna quick prototype, go with PHP/VB. Trust MS and want flexibility stay with IIS and go with C#. Want pure flexibility and to take advantage of a ton of excellent open-source work out there, then your answer is Java.

    Furthermore, large enterprise solutions will not allow the MS platform at this time. It’s just not mature enough, and again… flexibility and system control are issues here. Old legacy companies are based on unix or even mainframe systems where security is a premium, and they don’t have the time to babysit blue-screens. The requirements are system up time, and system up time, and then flexibility. Fortunately Java has been ported to most (if not all) of these environments already, because it provides for the kind of flexibility that fit the requirements of very large enterprises.

    Now, colleges… they’re a good starting point, but don’t expect to know 1/2 of what you’ll start to understand after just a couple of years working as a software professional in a development environment, ’cause you haven’t even scratched the surface. Every semester and class is another chance for you to be introduced to yet another *concept* that you will come across at some point in your career as a software professional. And in the technology industry where change occurs on a monthly basis at a very high rate… flexibility and creativity are King!

    I would have thought that thinking outside the box would have been a skillset that is both coveted and stressed at MIT.

    Cheers,
    -Jason

  6. Jason

    September 23, 2003 @ 2:18 pm

    6

    I don’t use my SUV to drive down the block to 7-11, I use it to take me to the beach with my surfboard strapped on top; to pack up the back and go camping in, to drive me over things and through things that other cars can’t. When I want to go to 7-11, I walk! But see… SUV’s actually allow for tremendous flexibility if you’d just use your imagination, and there are so many differen’t things you can do out there even in a web application environment.

    My most common critique of web applications is the HTML side. It makes it hard to get any kind of manageable UI when trying to communicate complex problems and associations to your users, but mostly just because its a prototyping language. Kinda like my experience with VB.NET. I’ve worked at many different companies from startups to behemoths and the startups that started prototyping with VB.NET on the MS platform and IIS ran into a serious problem as soon as they had to figure out how to scale their application. Why? ‘Cause the MS platform is a prototyping tool. MS has made it really easy to do all those things that every application needs to do upfront, and have integrated it with some really nice tools… MS has great tools I’ll give ’em that. But when you want to do things that actually require creativity and imagination in complex multi-teared environments where load balancing is a necessity and recycling your servers every couple of days isn’t an option, then you’re gonna need the flexibility that Java/J2EE provides you. I haven’t worked with C# yet at this point, but I’m very wary about MS app-server technology when it comes to scalability. And don’t even get me started on Security… ugh!

    None of this was readily apparent when I was in college… in fact, I had no idea about any of the bigger picture issues until I’d had 2 or 3 years of solid development experience under my belt. As mentioned above, there are many alternatives when it comes to Java. Flexibility and creativity are key there. Wanna spend time in memory management? Go with C/C++. Wanna quick prototype, go with PHP/VB. Trust MS and want flexibility stay with IIS and go with C#. Want pure flexibility and to take advantage of a ton of excellent open-source work out there, then your answer is Java.

    Furthermore, large enterprise solutions will not allow the MS platform at this time. It’s just not mature enough, and again… flexibility and system control are issues here. Old legacy companies are based on unix or even mainframe systems where security is a premium, and they don’t have the time to babysit blue-screens. The requirements are system up time, and system up time, and then flexibility. Fortunately Java has been ported to most (if not all) of these environments already, because it provides for the kind of flexibility that fit the requirements of very large enterprises.

    Now, colleges… they’re a good starting point, but don’t expect to know 1/2 of what you’ll start to understand after just a couple of years working as a software professional in a development environment, ’cause you haven’t even scratched the surface. Every semester and class is another chance for you to be introduced to yet another *concept* that you will come across at some point in your career as a software professional. And in the technology industry where change occurs on a monthly basis at a very high rate… flexibility and creativity are King!

    I would have thought that thinking outside the box would have been a skillset that is both coveted and stressed at MIT.

    Cheers,
    -Jason

  7. Jason

    September 23, 2003 @ 2:22 pm

    7

    I don’t use my SUV to drive down the block to 7-11, I use it to take me to the beach with my surfboard strapped on top; to pack up the back and go camping in, to drive me over things and through things that other cars can’t. When I want to go to 7-11, I walk! But see… SUV’s actually allow for tremendous flexibility if you’d just use your imagination, and there are so many differen’t things you can do out there even in a web application environment.

    My most common critique of web applications is the HTML side. It makes it hard to get any kind of manageable UI when trying to communicate complex problems and associations to your users, but mostly just because its a prototyping language. Kinda like my experience with VB.NET. I’ve worked at many different companies from startups to behemoths and the startups that started prototyping with VB.NET on the MS platform and IIS ran into a serious problem as soon as they had to figure out how to scale their application. Why? ‘Cause the MS platform is a prototyping tool. MS has made it really easy to do all those things that every application needs to do upfront, and have integrated it with some really nice tools… MS has great tools I’ll give ’em that. But when you want to do things that actually require creativity and imagination in complex multi-teared environments where load balancing is a necessity and recycling your servers every couple of days isn’t an option, then you’re gonna need the flexibility that Java/J2EE provides you. I haven’t worked with C# yet at this point, but I’m very wary about MS app-server technology when it comes to scalability. And don’t even get me started on Security… ugh!

    None of this was readily apparent when I was in college… in fact, I had no idea about any of the bigger picture issues until I’d had 2 or 3 years of solid development experience under my belt. As mentioned above, there are many alternatives when it comes to Java. Flexibility and creativity are key there. Wanna spend time in memory management? Go with C/C++. Wanna quick prototype, go with PHP/VB. Trust MS and want flexibility stay with IIS and go with C#. Want pure flexibility and to take advantage of a ton of excellent open-source work out there, then your answer is Java.

    Furthermore, large enterprise solutions will not allow the MS platform at this time. It’s just not mature enough, and again… flexibility and system control are issues here. Old legacy companies are based on unix or even mainframe systems where security is a premium, and they don’t have the time to babysit blue-screens. The requirements are system up time, and system up time, and then flexibility. Fortunately Java has been ported to most (if not all) of these environments already, because it provides for the kind of flexibility that fit the requirements of very large enterprises.

    Now, colleges… they’re a good starting point, but don’t expect to know 1/2 of what you’ll start to understand after just a couple of years working as a software professional in a development environment, ’cause you haven’t even scratched the surface. Every semester and class is another chance for you to be introduced to yet another *concept* that you will come across at some point in your career as a software professional. And in the technology industry where change occurs on a monthly basis at a very high rate… flexibility and creativity are King!

    I would have thought that thinking outside the box would have been a skillset that is both coveted and stressed at MIT.

    Cheers,
    -Jason

  8. Jason

    September 23, 2003 @ 2:22 pm

    8

    I don’t use my SUV to drive down the block to 7-11, I use it to take me to the beach with my surfboard strapped on top; to pack up the back and go camping in, to drive me over things and through things that other cars can’t. When I want to go to 7-11, I walk! But see… SUV’s actually allow for tremendous flexibility if you’d just use your imagination, and there are so many differen’t things you can do out there even in a web application environment.

    My most common critique of web applications is the HTML side. It makes it hard to get any kind of manageable UI when trying to communicate complex problems and associations to your users, but mostly just because its a prototyping language. Kinda like my experience with VB.NET. I’ve worked at many different companies from startups to behemoths and the startups that started prototyping with VB.NET on the MS platform and IIS ran into a serious problem as soon as they had to figure out how to scale their application. Why? ‘Cause the MS platform is a prototyping tool. MS has made it really easy to do all those things that every application needs to do upfront, and have integrated it with some really nice tools… MS has great tools I’ll give ’em that. But when you want to do things that actually require creativity and imagination in complex multi-teared environments where load balancing is a necessity and recycling your servers every couple of days isn’t an option, then you’re gonna need the flexibility that Java/J2EE provides you. I haven’t worked with C# yet at this point, but I’m very wary about MS app-server technology when it comes to scalability. And don’t even get me started on Security… ugh!

    None of this was readily apparent when I was in college… in fact, I had no idea about any of the bigger picture issues until I’d had 2 or 3 years of solid development experience under my belt. As mentioned above, there are many alternatives when it comes to Java. Flexibility and creativity are key there. Wanna spend time in memory management? Go with C/C++. Wanna quick prototype, go with PHP/VB. Trust MS and want flexibility stay with IIS and go with C#. Want pure flexibility and to take advantage of a ton of excellent open-source work out there, then your answer is Java.

    Furthermore, large enterprise solutions will not allow the MS platform at this time. It’s just not mature enough, and again… flexibility and system control are issues here. Old legacy companies are based on unix or even mainframe systems where security is a premium, and they don’t have the time to babysit blue-screens. The requirements are system up time, and system up time, and then flexibility. Fortunately Java has been ported to most (if not all) of these environments already, because it provides for the kind of flexibility that fit the requirements of very large enterprises.

    Now, colleges… they’re a good starting point, but don’t expect to know 1/2 of what you’ll start to understand after just a couple of years working as a software professional in a development environment, ’cause you haven’t even scratched the surface. Every semester and class is another chance for you to be introduced to yet another *concept* that you will come across at some point in your career as a software professional. And in the technology industry where change occurs on a monthly basis at a very high rate… flexibility and creativity are King!

    I would have thought that thinking outside the box would have been a skillset that is both coveted and stressed at MIT.

    Cheers,
    -Jason

  9. Scott Lamb

    September 23, 2003 @ 2:24 pm

    9

    Philip,

    I don’t consider Java to be the panacea of programming languages, but I like that it is simple enough to get out of your way. It sounds like your problem is with the APIs. You see that it has an API for almost anything but don’t think they’re particularly good. I think they are good, though there’s always room for improvement. And I use a lot of Java’s APIs. I’m not sure if that means Java isn’t a SUV or if I’m someone who goes off-road a lot, but I couldn’t live without them. I really hate programming in C++, where I have to dig up third-party code for everything or write my own wrappers. The C++ standard doesn’t even have a decent string class (sorry, std::basic_string<char> sucks!). I do nearly all of my general-purpose programming in Java, Perl, or Objective-C+Cocoa now, since all of these have relatively rich APIs.

    As to your specific complaint against JDBC: I created something I’m calling (temporarily) xmldb (http://www.slamb.org/projects/xmldb/). It lets you put your SQL queries and DML in an external library file and use named bind variables. This solves that problem, though it’s probably not going to set aside any of your fears of complexity. There is a learning curve to doing things like creating a new format and putting stuff in separate files. I do it because in the long-term, my code is more maintainable. Seeing one language at a time is very helpful. The automatically generated documentation for library files is very helpful.

    In general, most methods of producing pages with Java are more complex. This isn’t the language; it’s the choice of the users. I feel that complexity is justified for experienced programmers, but not for students. My attitude is always that you should build on the complexity one layer at a time after you’ve seen its utility. I hate redundant code, poorly organized code, etc. so at this point I’m using Jakarta Struts with a homegrown presentation layer (http://www.slamb.org/projects/framework/) and the xmldb mentioned in the last paragraph. Expecting students to learn that in a semester just wouldn’t go well. They have to first build the simple but imperfect site, then see how each step along the way makes it easier to maintain a large structure. If you skip any step, they’ll just resent the complexity and fail use it properly.

    Incidentally, if anyone follows those links and looks them over, I’d appreciate an email with your thoughts. No one uses them now but myself and a friend; I’d eventually like to change that.

  10. Jeremy

    September 23, 2003 @ 2:32 pm

    10

    Making a general judgment about a programming tool by how good it is for website development is ridiculous. In Java, a lot of costly, important trade-offs are made in favor of suitability for applications having nothing to do with dynamic websites. And there Java enjoys its dominance for a reason.

    In web development, Java is a niche technology, incomparable to ASP, Perl, PHP in its market share. Everyone I seen using it to build dynamic websites had their own subjective reasons that couldn’t be applied to a general situation. First thing your students need to be taught is how to choose right tool for the job.

  11. Jeremy

    September 23, 2003 @ 2:34 pm

    11

    Making a general judgment about a programming tool by how good it is for website development is ridiculous. In Java, a lot of costly, important trade-offs are made in favor of suitability for applications having nothing to do with dynamic websites. And there Java enjoys its dominance for a reason.

    In web development, Java is a niche technology, incomparable to ASP, Perl, PHP in its market share. Everyone I seen using it to build dynamic websites had their own subjective reasons that couldn’t be applied to a general situation. First thing your students need to be taught is how to choose right tool for the job.

  12. Rob

    September 23, 2003 @ 2:36 pm

    12

    Phil,

    For many web applications I agree that Java may not be the best language, but it can handle the
    problem fine if need be.(If organizing question marks is a problem, maybe you shouldn’t be programming. Build some wrappers, sheesh). For deployment of standalone applications Java is a superior language. For six years we have been building Java applications on Linux and deploying them to users running Windows NT. We have a dozen large (30,000 or more lines of code) applications, with dozens of smaller ones. We can build a new app in problably half to a quarter of the time it took in C or C++. We share code better, we design interefaces faster and better than C or C++, and we don’t have to spend time writing linked lists, or file I/O classes. The Java APIs are excellent for the most part. We use the Swing GUI classes extensively. We handle quite a high level of message traffic (Stock quotes) in Java just fine. We access a large Oracle database committing millions of tranasctions a day.

    I have 20 years of programming in Pascal, Fortran, C, C++, perl, blah, blah, blah, and Java is the most productive language of any by far. If they take Java away, I will have to find a new job because I would NOT want to go back to the tedium of older languages.

    If all you are building forms and reports, yes, Java is overkill. But lets not dimiss Java just because it is inappropriate for your task. Java is meant to be used for more sophisticated applications. Yes, it was touted early on as a web language, but now there are better tools for the most common situations. Java still has a viable place however, on the web and off. Phil, it would be great it you renamed your article to something like “J2EE is the SUV…”.

    Thanks,
    Rob Dodson

  13. CommonDialog

    September 23, 2003 @ 3:20 pm

    13

    Hey, this argument is going to go on ad infinitum ad naseum. Philip, as a die hard Java person who actually likes JSPs (looking around to dodge tomatoes) I wonder if your extrapolation is not a little too broad. Calling all of Java an SUV because a PreparedStatement (one of many classes) is probably overstating your point.

    Here’s the should be the final answer: Go with what you like. If building Java apps feels good, do it. If you want to write a web interpreter for Cobol, do that. The Java die hards aren’t going to convince the Microsoft die hards that Java is the Way and vice versa.

    Frankly, I think we all need to agree to disagree. Or if possible, create a compendium of each languages’ strenghts and weaknesses. I would propose such an effort if I didn’t think that it was absolutely impossible to do without delving into finger pointing and name calling.

  14. CommonDialog

    September 23, 2003 @ 3:23 pm

    14

    <sarcasm>I think the real crime here is that Lofi makes his students use NetBeans! Yikes! Now there’s the real crapper product.</sarcasm>

  15. Will Gunadi

    September 23, 2003 @ 3:58 pm

    15

    PHP: Not OO, can’t handle complicated applications
    PERL: More powerful than PHP, OO module being tacked on, you can’t read your own code in 6 months
    Python: OO from the ground up, and readable to boot, can control ActiveX objects, create NT services, try that with PERL.
    Python and wxPython: Cleaner than Visual Basic, much faster than Swing, but uglier than SWT
    Python and Zope: More productivity than Tomcat, Apache, Weblogic, JBoss, etc.
    Java and SWT: Beautiful, faster than Swing

    Choose your weapon.

  16. Charles

    September 23, 2003 @ 4:03 pm

    16

    This little treatsie is right on the mark. I have 20 years experience and a degree in CS and I have been saying this for the past several years!

    Most of the people that argue in favor of Java are motivated by two things. First, Java is primarily popular because it was seen as a tool and rallying point AGAINST MS. Two, people are just realizing that “Java has no clothes” and they are having a knee jerk reaction to the fact their baby is a piece of crap.

  17. Ravi Sunchu

    September 23, 2003 @ 4:47 pm

    17

    Why is ADO.NET is being compared with JDBC here. To me, it seems that the Author has no knowledge of current tools available in Java persistence. Pit JDO against ADO if you want to make a fair comparison of how difficult or easy it is to code in either of the languages/platforms.

    As so many others have mentioned already in the comments, author should teach his students (probably he needs to understand it first) difference between Java language and Java platform.

    Try coding a web site hit counter with multi-threaded C# code on IIS using
     ASP.NET, MSMQ, ADO.NET, MTS, COM/DCOM and enable it to run in a distributed multi-cluster
    environment. It’s definitely like driving a Ferrari in downtown Manhattan.
    Obviously one will be frustrated as it costed so much but still unable to
    enjoy the power. Don’t blame the car… blame the choice of roads.

    And I believe that students who have chosen to use Java for the project would be able to complete it on time along with the others provided they get similar help.

    Ravi

  18. Shahram Khorsand

    September 23, 2003 @ 5:33 pm

    18

    Just the phrase “JSP is simpler then J2EE” shows that the “professor” maybe should read a couple of books about the platform before writing something like that.
    Maybe the good professor should get out of the university and do some real application development. This would help the students understand better!

  19. Shahram Khorsand

    September 23, 2003 @ 5:34 pm

    19

    Just the phrase “JSP is simpler then J2EE” shows that the “professor” maybe should read a couple of books about the platform before writing something like that.
    Maybe the good professor should get out of the university and do some real application development. This would help the students understand better!

  20. Thomas Sondergaard

    September 23, 2003 @ 5:54 pm

    20

    It is interesting that you gripe is with java. I on the other hand choose to blame the web application model itself for being cumbersome and downright stupid. I don’t even find it surprising that it is so, as the foundation of it all http and html were developed for SERVING HYPERLINKED DOCUMENTS! Now people are building applications with it and when it appears that there is an impedance mismatch with a well structured relative clean OO language I don’t think the problem is with the OO language, thank you very much. Now that I’m on the subject I don’t much care for SQL and relational databases either.

    Developing for the web is one big compromise – the user interface is never as smooth as it could have been with a native GUI and the expression of complex flow and logic invariably mixes with presentation.

    Web development sucks. Java? Java is just java, no big deal, but it doesn’t suck.

    Thomas

  21. Marc Logemann

    September 23, 2003 @ 6:15 pm

    21

    Hi,

    i love PHP, but i am coding java because it lets you do everything you want. With PHP there are so much limitations. Your JDBC example is a little bit lame, because its easy to use JDO for persistence and you will see that persistence feels like a dream now, no more troubles for counting prepared statement question marks. Let me think about what PHP can offer there…. right NOTHING. You will say, for a 10.000 lines project you dont need it, but some of us are working in the real world.

    But congrats for this superb blog entry, so much momentum is hard to achieve :-)

  22. Mark

    September 23, 2003 @ 6:52 pm

    22

    Love these web interfaces –
    the comments window opens up and it is
    too *small* yeah! love the web
    its so sad

    Mark

  23. James Welcher

    September 23, 2003 @ 7:05 pm

    23

    Philip, John Major:

    Thanks for the replies. It is interesting to hear how VB is used at Whitehead.
    And for all we know, it is likely used to control robots and other lab equipment
    at some of the other facilities that were involved in sequencing aspects of the
    HGP. The order of magnitude of exaggeration involved in seeing VB control
    equipment at Whitehead and then producing the statement “Visual Basic (controlled
    all the machines that decoded the human genome)” shall be left as an exercise
    for the reader.

  24. Alon Blayer-Gat

    September 23, 2003 @ 7:31 pm

    24

    The best of both worlds – Ruby

    Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, extensible, and portable.

    Oh, I need to mention, it’s totally free, which means not only free of charge, but also freedom to use, copy, modify, and distribute it.
    Features of Ruby

    * Ruby has simple syntax, partially inspired by Eiffel and Ada.
    * Ruby has exception handling features, like Java or Python, to make it easy to handle errors.
    * Ruby’s operators are syntax sugar for the methods. You can redefine them easily.
    * Ruby is a complete, full, pure object oriented language: OOL. This means all data in Ruby is an object, not in the sense of Python or Perl, but in the sense of Smalltalk: no exceptions. Example: In Ruby, the number 1 is an instance of class Fixnum.
    * Ruby’s OO is carefully designed to be both complete and open for improvements. Example: Ruby has the ability to add methods to a class, or even to an instance during runtime. So, if needed, an instance of one class *can* behave differently from other instances of the same class.
    * Ruby features single inheritance only, *on purpose*. But Ruby knows the concept of modules (called Categories in Objective-C). Modules are collections of methods. Every class can import a module and so gets all its methods for free. Some of us think that this is a much clearer way than multiple inheritance, which is complex, and not used very often compared with single inheritance (don’t count C++ here, as it has often no other choice due to strong type checking!).
    * Ruby features true closures. Not just unnamed function, but with present variable bindings.
    * Ruby features blocks in its syntax (code surrounded by ‘{’ … ‘}’ or ‘do’ … ‘end’). These blocks can be passed to methods, or converted into closures.
    * Ruby features a true mark-and-sweep garbage collector. It works with all Ruby objects. You don’t have to care about maintaining reference counts in extension libraries. This is better for your health. 😉
    * Writing C extensions in Ruby is easier than in Perl or Python, due partly to the garbage collector, and partly to the fine extension API. SWIG interface is also available.

    And much more … at http://www.ruby-lang.org

  25. KrzysioK

    September 24, 2003 @ 4:28 am

    25

    Maybe you guys take a look at CodeCharge Studio. It’s a nice web RAD package that generates its applications for most languages. Having the same application design, with one switch you may generate ASP or PHP or Java or even .NET code (only custom events code needs to be translated). Generated applications use nice templating engine to separate html and code, many database types are supported. Things like common grids, forms and editable grids can be created with few clicks using database schema.

    http://www.codeocharge.com

  26. lee

    September 24, 2003 @ 5:40 pm

    26

    What a waste of time for so many people.

  27. Sam Griffith Jr.

    September 24, 2003 @ 6:42 pm

    27

    Hey ya’ll,

    After reading:

    http://blogs.law.harvard.edu/philg/2003/09/20#a1762

    Suggested to me by Kevin Wittkopf and Bill Dudney, I went and read the comments posted about that particular article and then in a comment of his own Mr. Greenspun referenced the following:

    http://philip.greenspun.com/internet-application-workbook/

    Read the section on scaling gracefully…

    Anyway, I think that his comparison of J2EE and Java to a SUV is somewhat right in terms of overkill and large learning curve to use it how it is supposed to be used, with lots of potential traps and pitfalls, much like a SUV or Jeep.

    I see his comparison as valid, but oversimplified. One thing all of us need to be aware of is that building “Enterprise” class solutions is not something you can do or understand all of after 4 years of college or even X years of programming. You must grow into that solution space deliberately and depending on the problem at hand, you may have a very steep learning curve with tools and solutions to get there, not to mention integrating into the current systems in place.

    What is completely inaccurate are his gross overestimates of cost, time, etc. Just because you use a scripting language doesn’t make you or your toolset any easier necessarily. What it does do is provide you with more pre-canned solution spaces to work from, because typically the scripting language is targeted at a specific problem. Java is a general purpose programming language. Also, when he talks about “truly difficult problems”, there is no arguing that using a fully dynamic system and language makes for much easier exploratory programming and allows for many more possible solution spaces to be examined by the programmer, those systems and languages are like having a Battalion and all it’s tools to attack a problem. It can and will do whatever you want, but the responsibility and power can cause just as much of a mess, while at the same time being the most flexible possible environment to experiment in assuming you have the prerequisite skills to command that battalion.

    As for his contention that the DB defines the engineering space for most web apps. I would contend that for the most part he is right. There are many more applications written quickly to solve a specific smaller problem that is not considered an enterprise application. Those applications and the programmers behind them don’t want or may not have the understanding to choose or use a OR mapping layer, app server, and the complexity that those tools bring to design and implementation. They use there template language created for solving this class of problems. What we are seeing with those template languages though, is a better understanding of those languages trying to provide abstract layers that insulate the programmer from the DB. But those are not typical OR mapping approaches and I’m not so sure they should be.

    As for his contention that the “None of the extra power of Java is useful when the source of persistence is a RDBMS”, he is just ill informed. Using JDO or another OR mapping tool, you can abstract the DB. But this assumes that you get to design the DB yourself from the Object model or OR model. If you do not have that luxury, then his contention is closer to the truth. But, still using tools like JBuilder or the Oracle JDeveloper tool set, you can overcome that problem very easily as well, much in the same way that the .NET toolset does it. Data bound controls and ADO like database abstraction layers.

    Also, when referring to the JSP code embedded in many pages this although Bill you are right, it is not the preferred way, it is the way detailed in many books on the subject as the way to get started and thus is the first and possibly only way many people are exposed to doing systems design for sites driven with JSP, ASP or any other tool for doing dynamic web presentation.

    Finally, his argument about dynamic binding of variables, etc. Well, I can’t argue with that one, as a matter of fact, I couldn’t agree more. Dynamic languages and systems are more flexible, programmable and modifiable, but at a cost. Speed or Space. You choose depending on the language and technique employed to get the dynamism. But give how more and more programmers and languages are slowly inching that way and keep adding features to try and get the power of the dynamic languages it won’t be long before we see J2EE solution sets available for those dynamic languages and scripting systems. Many already have a majority of the toolsets to do many things that J2EE is used for. Now given that and the power those languages have and if you notice, speed approaching that of Java, it really will put up a challenge to anyone doing any system Enterprise or not as to which language or system to use to solve there problem.

    With more and more solutions needing to be coded and modified on an shorter time cycle, it behooves all programmers and solution providers to look at solving the problem with which ever toolset can fulfill all the requirements and grow for as long as needed.

    Sun themselves earlier this year has inadvertently supported the argument by Mr. Greenspun. They are very interested in incorporating scripting systems into the Java system. And many of the reasons are the same and Mr. Greenspun has alluded too….

    Having written all this commentary, I’d like to share my own opinion on where programmers and the toolsets we use are going….

    It has been show time and time again by running systems used in production environments that fully dynamic systems can and do function just as effectively and just as fast as fully type checked systems. Our tools are requiring more and more runtime behavior and linking and decision making. Our testing procedures have already focused on testing entire interfaces and exceptional paths. (Exactly how those who test dynamic systems make sure they are as safe as static systems) Our design models and view of how to architect are built around fully flexible reconfigurable systems. What is a common theme with all this that we are being taught…..

    Dynamic modification is of utmost importance.

    So we see more and more dynamic features added to languages. Doing so helps, but at the same time causes code bloat to try and support a more dynamic style of programming. Java examples are Dynamic proxies or Inner classes used for event handling. When is the trade-off between that code bloat and the complexity that comes with it, which isn’t handled by the static typing compiler, not enough anymore? When is the ability to write something in a dynamic system with full test suites using 1/20 the code and in a shorter time going to break thru again? Smalltalk almost made it common place, but the C, C++ crew jumped on Java, because it had what they considered the right balance. But look how huge the Java classes libraries are and how much memory just to run a simple system. A fully dynamic system like Smalltalk or Lisp can do all that and more in 1/5 to 1/8 the memory and CPU requirements. How long before the lie is exposed about dynamic systems and safety and speed and complexity management? How long before every programmer can use languages that have been the birthplace of so many of the worlds great computer ideas and implementations? How long before companies and those who run them get the benefits of those tools?

    Thanks for your time,

    Sam Griffith Jr.
    staypufd@mac.com

  28. Peter

    September 24, 2003 @ 7:16 pm

    28

    I agree with what (Richard • 9/23/03; 10:54:22 AM) said. Look at the the defensive Javanese replies you’ll realize the total mess the Java platform has become.

  29. jim

    September 25, 2003 @ 2:06 am

    29

    Phil are you talking thru your ass again

  30. Rasik Pandey

    September 25, 2003 @ 7:49 am

    30

    Are any of you familiar with Cocoon? If so, what are your thoughts within the context of the previous comments?

    Regards,
    RBP

  31. Karl Tiller

    September 25, 2003 @ 9:43 am

    31

    Hey:). I hate Java, it sucks.
    K

  32. Karl Tiller

    September 25, 2003 @ 9:48 am

    32

    MS JVM has bugs and therefore it sux twice. :)
    When u run massive applets (which are workin’ fine with MS JVM) using SunJVM in Linux, J sux again.
    When u run them using SunJVM on Mac… What u think? Eh. It sux!!!
    Three examples. No need for 4th,
    because it will suck.
    Karlo

  33. Chris Hanson

    September 25, 2003 @ 3:21 pm

    33

    It’s not Java that’s the problem here, it’s the “standard” frameworks as promoted by Sun and others for web application development that make life difficult.

    WebObjects 5.2 is great and runs on J2SE 1.3.1. It interoperates with J2EE but it’s not J2EE; that’s how it can help you develop applications so fast. Really, Philip, you should check this out. It blows away things like PHP, ASP.NET, JSP/J2EE, and even the AOLserver system you used to build the original ArsDigita Community System.

    There are some systems out there that are spiritual descendents of WebObjects. I seem to recall hearing that the Common Lisp system used by Orbitz was modeled on the WebObjects architecture. In the Java space, there’s Wotonomy (a GPL reimplementation of the WebObjects frameworks in Java) and Tapestry (which looks and feels like WO but uses more “standard” Java technologies and is also Open Source). For object-relational mapping, there are Cayanne and Hibernate; these are also Open Source. And there’s even an LGPL reimplementation of the original Objective-C WebObjects in GNUstep, GNUstep Web.

    It’s *very* worth checking these out. By and large I loved “Philip and Alex’s Guide” and its predecessor, but when you called WebObjects “packaged junkware” you *really* made yourself look stupid to those of us who know it. It’s written with people like you (top 0.01%-ers) in mind. :)

  34. Kelly French

    September 25, 2003 @ 4:41 pm

    34

    I’d have to diasagree with him. It sounds as if his approach is where the problem is. His comment about question marks belies that his JSP code is too tightly coupled to the database. As I see it, JSP’s greatest strength is providing an interface between the presentation and any code that controls it or produces data for it. That being the case, having actual Java code in your JSP using <%jsp> tags is evidence that something in the design has already failed. The web page defines the interface, and happens to use HTML as the language of implementation. JSP lets you connect (or bind) the interface to any logic required. It so happens that you can embed the java code directly. That does not mean that it is the best approach. Java Beans exist mainly to help encapsulate data with the ease of access for a given web page. They, then, also provide a mechanism for any support logic needed so the Java code can be kept separate from the HTML code while still being connected to each other.

    The comparison used is apples to oranges. You can cause the same problem in PHP if you try to dynamically build an SQL query the way he described. The opposite is also true, you can use variables defined in the environment, here being the HTPP session, to link a given screen with the data using Java Beans.

    Where I would agree with him is that the focus should be on knowing your tools, including the language. They have strengths and weaknesses. If you have a particular implementation in mind, you might be playing into the languages strength but you might be trapped by one of its weakness. The article mentions this same concept by referring to Lisp. I’m sure there are programming approaches that could be done in Lisp but that would be extremely out performed in some other language because the approached used in the Lisp version was inappropriate for the language. I’m just as sure that that same problem could be done in Lisp with no performance gap if done with Lisp’s strengths in mind by someone knowledgable in Lisp.

    In other words, he’s just using Java as his personal whipping boy.

    Remove “.deleteme.” in the email address to contact me.

    Kelly

  35. Eric Hawthorne

    September 26, 2003 @ 2:28 am

    35

    When I applied to MIT comp sci grad school (as a Canadian) years ago I was told in reply that 700 foreign students, many of whom were the top student in their year at their U, applied each year for 25 positions, so we’ll let you know.

    Who was to guess that they’re all actually Java-illiterate morons after all that?
    You want a challenge, try mastering the Mozart(Oz) programming language and its
    concepts.

    I think the problem here is that most web apps are trivial applications
    in a complex but now well-known environment. Certain tools now provide the
    scaffolding for you, so you can implement your trivial app quickly, as
    it should be. That’s no reason to criticize a (by Java 1.5 anyway) decent
    O-O general-purpose software engineering (systems) language like Java.
    Java is capable of way more than the boring but lucrative web app pattern.

    For example, you could write an OS-microkernel in something really fast and
    real-time, and then provide all the rest of the OS utility apps (e.g. the
    GNU software that comes with Linux kernel) and the UI layers in Java these
    days, if you wanted to. Or you could write in Java a worldwide grid supercomputer
    and P2P distributed storage subsystem, or something like that.
    Simple web apps that put a few numbers and strings in a database
    are a bit of a yawn compared to that stuff.

  36. Dan Fishman

    October 1, 2003 @ 10:53 am

    36

    Programming languages are like faith based healings. They are not effective for you unless you BELIEVE. But if you do believe you will get wonderous results, which will be dismissed by others who do not believe.

    The trick is making yourself believe

  37. Nick Bauman

    October 10, 2003 @ 8:06 pm

    37

    You might as well be comparing Emacs with Oracle.

    Java is a platform. The language part of the platform is at the level of C/C++, which are systems programming languages. PHP is a language that runs in a web page. Can you write anything useful with PHP that doesn’t need a web browser? VB is a proprietary language that can only be used to push around these huge opaque abstractions (don’t touch!) that are owned by Microsoft.

    Can you program a telephone switch in VB? Can you program a water purification sensor using PHP? No.

  38. Nick Bauman

    October 10, 2003 @ 8:10 pm

    38

    JSP does suck, that’s true. It sucks because ASP sucks, with some minor improvements like taglibs. JSP was Sun’s hope to capture the ASP developers, so they made it look and feel like ASP, which was a big mistake because ASP is totally Model-I.

    But you don’t have to use JSP!! You can use Velocity.. Waaaaay better.

    http://jakarta.apache.org/velocity/

  39. Bjoern

    November 4, 2003 @ 4:45 am

    39

    Don’t know how old this article is, but by now you can embed SQL into JSP pages, I think it was with using the Standard Tag Library. The criticism of the ‘?’
    -replacements I also don’t quite understand, as this is only for using PreparedStatements. I guess other languages (like PHP) don’t even have such a thing. In Java you can also just pass any SQL-statement as a String, which you can put together in any messy way you want, including filling in your local variables.

    I agree that the mechanism of PreparedStatements, addressing the fields by integers, isn’t perfect. I myself wrote a simple wrapper for that, so that I can adress the fields by a name. Of course that is more work for a simple homework web app – but nobody forces you to do such a thing. Maybe it’s more that people using Java are trying to do things in a supposedly right way, than Java itself that is to blame. Personally I blame all the hype about Software Engineering, not Java. I found that when using other languages like Perl, I waste hours searchign for bugs that I would not have been able to create with Java to begin with. How anyone can compare Java and Perl (or PHP which appears to be mostly the same mess) is beyond me.

  40. Vlad Patryshev

    November 5, 2003 @ 5:23 pm

    40

    That’s funny. For a student it may be cheaper and easier to learn Frontpage, Notepad and Paint and go ahead developing “web pages” using these “tools” – but a professional will have to use Photoshop and Dreamweaver to achieve professional results. If you want to turn your students into real professionals, they’ll have to choose a harder road, unless you all hope to rely more upon industrious peoples of India, China, Brazil, and Russia.

    I love Perl, I’ve been using it for years, but it would be unwise to take it as a serious tool for developing serious web applications. But as a duct tape for a student project – it is just fine! It all depends on what you want to teach your students.

  41. Vlad Patryshev

    November 5, 2003 @ 5:38 pm

    41

    Having reread the author’s article, I’ve also got a weird feeling that the teacher is not actually so good with Java. It would probably make more sense to leave judgements like this one to software professionals that do know Java and can professionally compare it to other languages. “Find a second question mark and associate it with number 4727” – this is what the author thinks Java is about.

  42. Alexandra Milton

    April 9, 2004 @ 10:54 am

    42

    Have a look at WebObjects from Apple. It

  43. NM

    July 1, 2004 @ 11:17 pm

    43

    For those that claim that MVC is hard in PHP, check this out: http://www.mojavi.org Mojavi. It’s a great PHP MVC framework that embodies all the great flexibility and speed that PHP is good for without going crazy with tons and tons of hierarchical classes like those struts clones do. Enjoy!

  44. Erik Midtskogen

    September 20, 2004 @ 4:38 pm

    44

    If you are embedding SQL statements and configuring bind variables in a JSP file then I guess it’s no wonder why you are having trouble with Java. JSP’s are for presentation-tier concerns only. If you allow Tier Leakage to generate Concern Slush in your (ahem) “scripts”, it’s not Java’s fault. Java isn’t a scripting language like VB (thank God). Stop trying to treat it as if it were.

    If you’d care to learn how to use the J2EE API’s correctly (and yes, I know the learning curve can be rather steep, unfortunately), then I’d be interested to hear you report on Java’s weaknesses as a web development language. Until then please stop offering uninformed opinions that could be mistaken for expert advice.

  45. Kevin Bailes

    January 17, 2005 @ 10:35 am

  46. James McCarthy

    December 9, 2005 @ 11:38 am

    46

    Having been tought Java in College for 3 years & then having to do a final year project I chose Ruby. I’ve managed to build a 1500 line simple web application server faster than some of my classmates were able to get their java servers talking to their DB.

    I understand Java perfectly well (I’m frequently asked for help by my classmates), and I undertand that for fast web app developement it’s totally useless.

    It’s faster for me to write my own server than learn the massive API’s for someone elses.

    I couldn’t care less about “industrial strength” stuff cause how often do you actually have to build for the big iron? not much, and even if it is Ruby, Perl, Python & even PHP are great.

  47. Caleb Powell

    December 9, 2005 @ 12:46 pm

    47

    Ignoring any language comparisons, the worst part about developing Java web-applications (in my experience anyways) has got to be Java Server Pages! They are extremely painful to create and debug, and most of the JSP’s I have seen violate MVC design. Even Tag Libraries (which are intended to resolve some of these problems) have their drawbacks. The entire design was flawed in my opinion.

    When working on a Java project, I always try and use Apache Velocity rather than JSP’s for HTML (or ny other) generation (http://jakarta.apache.org/velocity/). It is far superior to JSP’s in my opinion.

  48. Pedro Vera

    February 27, 2006 @ 10:13 am

    48

    According to the number of recruiter inquiries I receive every week, Java is anything but dead. Either that or the recruiters are getting even dumber than usual, since I am not a Java programmer.

  49. Carlos de Luna Saenz

    December 7, 2007 @ 1:59 pm

    49

    The true is that Java Programming needs a good OO knowdlege, if your students are feelling ok with ASP/C#/LISP/PHP is because they haven’t understand the OO theory, and if you ask them to program using the hole J2EE for a “simple” project then you are not following the KISS ideology. Java has enough power to “kill an elephant” and “to “kill an ant”, just don’t try to kill an ant with a “java bazooka”.

Log in