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

 



Forgot your password?
typodupeerror
×
Java Programming IT Technology

Phillip Greenspun: Java == SUV 974

lateralus writes "In his blog, Philip Greenspun re tells of his epiphany that Java is the SUV of programming languages. An interesting point brought forth in his typical extreme style."
This discussion has been archived. No new comments can be posted.

Phillip Greenspun: Java == SUV

Comments Filter:
  • by Anonymous Coward on Monday September 22, 2003 @08:57AM (#7023611)
    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 "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-w orkbook/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, 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).
  • Re:/.'d already.... (Score:4, Informative)

    by jrc313 ( 168973 ) on Monday September 22, 2003 @08:59AM (#7023631)
    Google does [216.239.59.104]
  • Re:JAVA is the suv? (Score:1, Informative)

    by Anonymous Coward on Monday September 22, 2003 @09:03AM (#7023663)
    You're thinking about C, sparky. C++ has STL strings which are immune from buffer overflow.
  • by angle_slam ( 623817 ) on Monday September 22, 2003 @09:03AM (#7023665)
    Its a bad comparison from a non programmer..

    Didn't even attempt to find out who Greenspun is, huh? Check out his resume [greenspun.com]. He is a Ph.D. in Comp Sci and teaches Comp Sci courses in MIT. Do you happen to teach Comp Sci at MIT?

  • copy und paste!!! (Score:1, Informative)

    by Anonymous Coward on Monday September 22, 2003 @09:07AM (#7023704)
    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 "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-w orkbook/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, 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).

  • Google cache (Score:2, Informative)

    by stienman ( 51024 ) <adavis&ubasics,com> on Monday September 22, 2003 @09:09AM (#7023717) Homepage Journal
    Google cache [google.com] of the blog entry.

    Also below:
    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 "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-w orkbook/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, 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).

    -Adam
  • i'm sorry but.. (Score:3, Informative)

    by gl4ss ( 559668 ) on Monday September 22, 2003 @09:11AM (#7023732) Homepage Journal
    **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 "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.**

    but they should be able to do them in all three of the choices they had, or was the course subtitled: "gaining profiency in one of 3 systems for doing one kind of a web project"?

    and jsp is simpler than j2ee? jsp is part of j2ee, heres a clip from somewhere

    ***"What Is JSP?

    JavaServer Pages (JSP) is a Sun Microsystems specification for combining Java with HTML to provide dynamic content for Web pages. When you create dynamic content, JSPs are more convenient to write than HTTP servlets because they allow you to embed Java code directly into your HTML pages, in contrast with HTTP servlets, in which you embed HTML inside Java code. JSP is part of the Java 2 Enterprise Edition (J2EE).

    JSP enables you to separate the dynamic content of a Web page from its presentation. It caters to two different types of developers: HTML developers, who are responsible for the graphical design of the page, and Java developers, who handle the development of software to create the dynamic content.

    Because JSP is part of the J2EE standard, you can deploy JSPs on a variety of platforms, including WebLogic Server. In addition, third-party vendors and application developers can provide JavaBean components and define custom JSP tags that can be referenced from a JSP page to provide dynamic content.

    "***

    and are we a little generic here (from greenspun)**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).**

    that's nice, what kind of a 'project' is this project in this? the whole point in using java in projects like this is that you can reuse the code in other parts straight(heck, make a game for a java phone, then use the _same_ compiled classes on the server to determine if the uploaded scores are legit that you use for game engine on the j2me device). sure there's other points as well, like not tying yourself to microsoft(though, that is a point for php as well).

    and really, people who use visual basic for big projects don't except to live long.. or be taken seriously on slashdot. surely you can do it seemingly cheaper when anyone can do it(but if mit produces people who aren't able to learn any language that suits the job best in reasonable time i've kinda lost my respect for them).
  • Re:JAVA is the suv? (Score:5, Informative)

    by Twylite ( 234238 ) <twylite&crypt,co,za> on Monday September 22, 2003 @09:15AM (#7023767) Homepage

    I've got to agree with this. Reading Greenspun's blog I was left pondering how to start responding to something so completely wrong.

    The article implies a lack of understanding of the JSP paradigm. Sure, binding variables to a relational database is tough. So if you insist on doing that, use JSP tags. But that's not the point of Java -- you should be access instance methods from a JSP page, and those instances can access any data source they choose.

    VB and ASP are intended for developing front-ends to primarily relational data, so they make it pretty easy to accomplish. The fact that they make it easy doesn't mean that you can use the same design and technique to deliver a scalable, maintainable web site. All the current theory says take the pain up front and put in a decent template system, and never put code in your page.

    "People who are serious about getting the job done on time and under budget" will get the requirements first, and not making sweeping bullshit generalisations. There is a huge problem in the industry at the moment with IS departments trying to coalesce the functionality of dozens of specific-purpose VB applications into one enterprise system. The size of the project, requirement for scalability, expected lifetime and regularity of changes, systems integration issues, cost, stability, customer technology preference and other technical and non-technical issues will all influence the choice of a development environment.

    With a dynamic language ... you could do bind variables by having the database interface look at local variables in the caller's environment

    And if you look at development guides and bug reports, you'll find that it is exactly this sort of implementation that has insidious security holes. The security of systems that provide such shortcut functionality depends on the developer understanding how to use the system properly. Unfortunately it is quite often developers who don't have the time or inclination to understand that use these shortcuts.

    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

    Greenspun seems to believe all "web applications" are Internet (rather than Intranet) applications. Beyond management systems (CMS and document management) I have seem few significant intranet systems that are merely a web interface to a database. Many intranet web applications interface to accounting, stock, POS, banking, quotation and other systems, where integration cannot be accomplished using a database. A Gung Ho "do it all in the web page because its fastest" approach is the quickest route to failure.

    So ASP and PHP have their place, and they're almost certainly easier to understand for a CS senior who isn't interested in reading up on the design principles behind JSP ... but that doesn't make them better.

  • by tgreiner ( 107912 ) on Monday September 22, 2003 @09:16AM (#7023777) Homepage
    What this guy describes is called a JSP "type 1" application. It (ab-)uses the JSP's ability to embed Java code directly into the JSP page (which is typical for languages like PHP). Doing this is a BAD idea.

    You will typically
    • use Java beans or some other utiliy classes to encapsulate data base or business logic access (type 2)
    • use a Java tag library like Jakarta struts to provide you with an application framework and common used tags (logic tags, bean access etc.) (type 3)


    I tend to agree with his problems with JDBC being quite cumbersome to use. This is why one will typically use data access Java beans which encapsulate data access. Also there are several object-relational mapping frameworks (e.g. CastorJDO) which will even isolate you from SQL and database details completely.

    I would even tend to agree with him on terms of how quickly one can hack some web application. One will be faster with a scripting language like PHP, but when it comes to extending/maintaining a JSP type 2/3 application will win.
  • Re:JAVA is the suv? (Score:5, Informative)

    by Ed Avis ( 5917 ) <ed@membled.com> on Monday September 22, 2003 @09:39AM (#7023960) Homepage
    Portability? Oracle ships with three different JVMs because they are all incompatible with each other. That's all you need to know about Java portability.
  • by KDan ( 90353 ) on Monday September 22, 2003 @09:40AM (#7023967) Homepage
    Hibernate [bluemars.net].

    Daniel
  • Tcl is good (Score:4, Informative)

    by DavidNWelton ( 142216 ) on Monday September 22, 2003 @09:43AM (#7024010) Homepage
    Tcl has a lot going for it. It has a very nice C API, is simple to work with, is extendable to deal with more complex problems (namespaces, OO), and is easy to read 6 months down the road.


    The "problem", if there is one, with Tcl is that it is not fashionable. Instead, lots of people just use it to get their jobs done quickly without lots of chest thumping, willy waving, and enterprise enabling.

  • by Anonymous Coward on Monday September 22, 2003 @09:52AM (#7024095)
    The problem with Java is that it explicitly excludes a lot of powerful language features and forces the programmer to perform a lot of unnecessary work.

    C/C++ don't have closures (but do have first-class functions, unlike Java) because they can't work properly with manual memory management. What's Java's excuse?

    Java only supports subclass polymorphism, which makes things like collection classes very awkward to use (worst of both worlds of statically vs. dynamically typed languages), why? (Admittedly, this is being addressed by the upcoming generics)

    Not only does Java force an "OO-only" approach, but an unusually clunky and awkward OO approach compared to most other languages.

    The only reason why Java can be used to implement (some) programs efficiently is because it includes a huge library of pre-packaged functionality. The core language is probably the least expressive, least featureful language currently in use.
  • Re:Wahhh !!! (Score:3, Informative)

    by -brazil- ( 111867 ) on Monday September 22, 2003 @10:03AM (#7024193) Homepage
    Java is slower than C you blockhead. How could it be any other way, given that Java is interpreted whereas C is compiled!?


    Java has not usually been "interpreted" for years. And in its JIT compilation, it can use optimizations based on data available only at runtime, which could in some cases make it faster than precompiled C code. Admittedly, that's rare and most of the time Java is slower.

  • by brlewis ( 214632 ) on Monday September 22, 2003 @10:04AM (#7024200) Homepage

    Who do you think keeps Franz [franz.com] and Digitool [digitool.com] in business? Hobbyists? I don't think so; they'd be using one of the free implementations. [lisp.org] Your "no one in business computing considers using Lisp" comment shows you don't know what you're talking about.

    I myself use Scheme [schemers.org] in my employment, and it's helped a lot.

  • Re:Finally (Score:5, Informative)

    by Bob9113 ( 14996 ) on Monday September 22, 2003 @10:06AM (#7024218) Homepage
    OK, it's just a joke, but I'm interested in countering one point that some people still believe.

    It's cross-platform feature has been tainted by the agenda of the forces that dominate the respective operating system

    I am currently employed on a project with roughly one megaLOC of Java. It has a Swing GUI, EJB middle tier, and Oracle at the back. It currently runs on Windows, several flavors of Linux, and Solaris, without recompile. I do the production builds on a Linux machine and we distribute them to roughly 2000 Windows and a few dozen Linux workstations. Likewise I do the production middle tier on Linux and deploy to Solaris, and the development and testing versions of the middle tier go to Windows, Linux, and Solaris.

    Would it fit on a wristwatch? No, it's too big. Would it run on BeOS or Mac? You betcha.
  • by 11223 ( 201561 ) on Monday September 22, 2003 @10:11AM (#7024261)
    Again, no further comment, except to note that no one, I mean
    no one in business computing considers using Lisp.
    Your ignorance is astounding. No, I'm not going to cite some obscure example. Instead I'm going to point you at the Franz "Success Stories" site at http://www.franz.com/success/ [franz.com]. Read through all the categories. Then realize these are just the people who thought it worth $10k to use Franz's Allegro Common Lisp. Also see all the applications that Xanalys [xanalys.com] develops with their LispWorks product.

    AMD also uses GNU Common Lisp and ACL2 internally, though they can't reveal any specifics - this is of course the problem with a language that's suited well for the research and development part of the product phase. Who wants to give away what they're doing just to advertise that they're using Lisp?

    Of course, if you wanted pretty pictures and "yet another database web interface", try the Stargreen site [stargreen.com]. But you won't find a lot of people using Lisp on those, for the simple reason that most of that work is cut and paste from a previous project.

  • by Dr. Bent ( 533421 ) <<ben> <at> <int.com>> on Monday September 22, 2003 @10:24AM (#7024380) Homepage
    OK, I guess I need a programming lesson then. For a database driven application, how do you propose not to have hardcoded SQL statements?

    Well you could,

    - Use Java Entity Beans with Container Managed Persistance.
    - Use JDO
    - Use TopLink

    All of the O/R mapping tools automatically generate the SQL queries for you based on your Database Schema. No SQL necessary, hardcoded or otherwise.
  • Re:Like a SUV huh? (Score:1, Informative)

    by wasabii ( 693236 ) on Monday September 22, 2003 @10:26AM (#7024405)
    I would like to let you know I have a 9 inch penis and I LOVE Java.

    Owned.
  • by theolein ( 316044 ) on Monday September 22, 2003 @10:31AM (#7024442) Journal
    As someone who used an overly complex PHP "application server" for a project that was screaming "decent seperation of logic and presentation" I think the guy is on some nice drug.

    PHP is fine for smaller applications. It is an utter desaster for large applications that need maintenance and the ability to be coded by many inidividuals. Every bit of templating done in PHP has to be done by hand or you have to have intimate understanding of the code for the "application server".

    JSP allows you to use Java's strengths in that the logic can be done in servlets, beans etc and implemented as one line JSP tags. It's overhead heavy for small projects but excellent for larger ones where you will still be able to figure out what the code does if the original developer left or got fired. This is similar to ASP.Net I imagine.

    His comparisons say nothing about the scope of the students applications or the tools used. Anyone doing a whole application in JSP is going to suffer, and this is because JSP is not meant for this, and a comparison of JSP and PHP on this basis alone will make PHP seem better than it is.

    As someone else mentioned: Use the right tool for the job.
  • by flakac ( 307921 ) on Monday September 22, 2003 @10:45AM (#7024560)
    I develop regularly in C/C++ (Unix and Windows), Java (J2EE), and PHP, and can't really agree with the author's contentions. J2EE is much superior to PHP for serious web applications -- the students mentioned in the article would have been much happier using WebLogic or jBoss instead of than Oracle.

    Of the three, C/C++ is obviously not well suited for developing web-based applications.

    PHP is quick and easy, but it suffers from a lack of vision -- it was never designed, and the authors don't really seem to know what they want to do or where they want to go with it (don't even get me started on how it's supposed to be "Object-oriented" now...). IMO, it's much easier to make a mistake in PHP, and code is much less maintainable than equivalent JSP pages -- just try switching from MySQL to Oracle, and you'll see what I mean. I shudder whenever I hear the words PHP and enterprise in the same sentence.
  • by mobiGeek ( 201274 ) on Monday September 22, 2003 @11:16AM (#7024845)
    ... but Php and Java aren't even the same kind of programming language

    Agreed.

    Java can be used to create all the same types of apps that C can

    Well...no. C is used for system development (i.e. hardware banging). Java cannot be used in that environment without direct support of the libraries and the JVM (or by JNI calls to libraries written in C/C++).

    ...though C cannot be used in all the apps Java can (i.e Web.)

    Well...no. C can be used anywhere that Java can be. On the server side, most servers (including web and proxy servers) are written in C. There's nothing stopping people from writing "app servers" in C...in fact there may even be a few of those too.

    On the client side, "applets" are not a valid use of Java. Applets was a marketing ploy that grew wildly out of hand. Besides, there are ActiveX controls written in C/C++ that perform the same basic functionality of applets.

    One thing that Java has over C/C++ is its cross-platform capabilities. With C, if you want cross-platform you have to work to code it that way. With Java, if you want to break cross-platform, you have to work to code it that way (use non-standard libs, use JNI, etc...)

    As for perl, the fact that it has to be compiled every time it is run kinds of takes away from any speed advantage over Java.

    Yes and no. Perl is slower to start up than a C/C++ native application of similar functionality. Java too is very slow to start up (usually *much* slower than Perl for very small scripts).

    However, long running apps written in Perl and Java both perform very well when compared to similar C/C++. By long-running, I mean "long enough that the startup time becomes a wash". I've written web crawlers in Perl and Java that run for weeks at a time. Comparing their performance to existing crawlers written in C/C++, the performances are equivalent (though the Java and Perl bots suck up more memory).

    Development time for those bots was significantly less in Java and Perl than for equivalent C-based bots. (BTW: the Perl bots were written back before LWP was stable/available)

    The only language in common use that does everything Java does is fricking Visual Basic

    Well...no. VB is stuck on one platform (well, two if you consider MS-Java...though VB.NET is NOT VB).

  • Re:Tcl is good (Score:3, Informative)

    by Directrix1 ( 157787 ) on Monday September 22, 2003 @11:32AM (#7024991)
    I personally don't see Mr. Greenspun's point. Most kids straight out of college don't know jack about shit. I find java to be quite easy to use, and very intuitive. And it has an available toolset the size of Montanna, if one thing doesn't work then another will. With java you know you can get anything done. Its like the swiss army knife of programming languages. Granted .Net has most of these features except the availability of tools. But comparing it to a scripting language, bah humbug.
  • by JustAnotherReader ( 470464 ) on Monday September 22, 2003 @11:48AM (#7025136)
    If I decompile your great JAVA/.NET /ActiveX component that I downloaded, can I get at all your hard-coded passwords, query strings, etc? If so, I don't think you can blame JAVA.

    Yes it is true that you can easily decompile .class files to get back almost the exact source code (without comments). However it is also true that there are code obfuscators that do a really good job of making it damn near impossible for someone to figure out how the code works. Imagine if you overloaded your methods and classes as much as possible such that 70% of your class names were 'A'. i.e.

    setName(String) becomes a(String)
    setAge(int) becomes a(int)
    getName() becomes a() and
    getAge() becomes b()

    It makes it darn tough to figure out what the code does. And you don't have to write the code in this obfuscated manner, you write it using good code practices and the run the obfuscator on the compiled .class files. The output of that obfuscator is a set of obfuscated code and a mapping file so if you get debug messages like:

    NullPointerException in A.c(int) line 147

    then your mapping file will tell you that "A" was actually your class name "Client" and c(int) is actually "stZipCode(int)". Now you can still debug a customer's error without giving away anything about the code structure to the customer.

    However, the place where Java has been excelling (and where I've made my living for the past 5 of my 15 years in software) is in major web applications where the user doesn't have any access to your compiled code. The combination of Java servlets, talking to Enterprise Java Beans or to a database via JDBC and then outputing the html using Java Server Pages is now pretty much the default way of writing a huge data-centric web site. Pretty much all major banks do their on-line banking web sites this way (this is my area of expertise). This is the technology behind Amazon.com and (I believe) Barnes & Nobel.com as well. If you use Quicken or MS Money to do your bill payments and check your financial statements you're either connecting to CheckFree (Java Based) or to an EEI server (Java based) to transfer all that financial info.

    So is Java fat, bloated and wastefull? Well, how fast is your on-line banking? How fast is Amazon? How fast does your Quicken software work? You'll wait far more because of lag in your web connection than with any kind of slowness with Java.

    So what we have here is some academic geek with a web site on the Harvard Law server telling those of us who actually pay our mortgages writing Java software that we don't know what we're doing. Well, that's fine. When I'm done paying off my house 15 years early (as well as all my car, student loan and credit card payments) and I'm retired debt free at age 50 I'll try not to be too upset that Phil Greenspan's angry little blog said I did it by using the wrong tool.

  • Re:Wahhh !!! (Score:2, Informative)

    by StillNeedMoreCoffee ( 123989 ) on Monday September 22, 2003 @12:40PM (#7025597)
    Well it is a matter of when compilations occurs. In C it has to happen all at once before you ever use it. With Java which is a much more dynamic language by design and with the new JIT compilers, compilation of the byte code (which you could think of as object code in the C envirionment) is turned into machine code segments that are cached by the JVM and run from there. This means that there is a little startup time for that delayed compilation but then the code runs close to C speeds. But then if you don't need to complile everything you don't.

    There is some overhead due to the dynamic message passing, but then you have that in C++ as well and is something that would slow both languages down compared to C. The expressibility and re-usablility of the OOPS paragim means that design, and maintenance can be much better with Java than a C program over the entire life a a project for a great savings in time and money for everyone concerned.

  • by Anonymous Coward on Monday September 22, 2003 @02:33PM (#7026554)
    Or use Prevayler [prevayler.org] so you dont need a dbms anymore.
  • by aurumaeus ( 673863 ) on Monday September 22, 2003 @03:24PM (#7027080) Homepage
    I cut my teath in web programming writing perl and javascript. I then moved on to PHP, and led development of an e-commerce app in PHP (with a little C here and there). Then got thrust into some ASP (ech), before becoming diving headlong into Java. I've never looked back.

    Java has drawbacks, but the difference between paradigms such as OO Perl and PHP are so misrepresented it makes me want to cry. As someone who spends a fair amount of time mentoring people in Java programming, I'd like to first support the assertion that nobody learns how to program in college. They learn how to solve algorithmic problems, and maybe know a little about OO.

    The strong typing, file-system coupling, and general stickiness and complexity of Java are all _features_ of a language that was developed in response to a concrete need. I love PHP (do my dev for personal projects in it still), but it doesn't cut it for big-iron app development, and neither does (any form of) Perl. I'm in charge of architecture for an online banking system, and I think I know a few things about application complexity and code maintenance- and I'll tell you that nothing beats PROPERLY WRITTEN Java in these categories.

    1) You can certainly write working applications more quickly in PHP/Perl if you're a novice. The interfaces are easier to learn, the simple stuff is pushed to the top SO THAT YOU CAN do things quickly and easily.

    2) You can do things 'More Than One Way' more easily in Perl / PHP without strong typing and hard-locked OO hierarchies. This is a strength for lightweight development, and an increasing pain in long-term, distributed and enterprise development.

    3) Java APIs for simple things ARE often difficult, because they're designed to do more than your casual user needs. Take a look at SAX (interestingly named 'Simple API for XML') if you want an example of an extremely difficult-to-use interface to a common technology. The spend a few years developing and tuning XML applications, and you'll begin to understand why the guys at Sun did it that way.

    4) Don't confuse Java development with EJB / JSP development, which is the misguided attempt by Sun to provide a MS-like solution for people who don't know enough to be allowed near the good stuff. THAT is a guzzling SUV, and you don't get nearly enough for the price you pay to run those applications.

    5) Anyone wanna compare performance benchmarks? On servers these days where it costs $1000 to get a box with a 2GHz proc & 1BG of RAM? Sure, Java users more of that glut of resources than other languages... because you're paying for two things: platform independence, and JVM-managed garbage collection.

    PHP & Perl will always be the kings of prototyping and lightweight application development, but will never be able to compete with Java-style frameworks for long-term maintainability, complexity management, and scalable & distributed architecture.
  • Re:Swiss Knife, Eh? (Score:3, Informative)

    by Directrix1 ( 157787 ) on Tuesday September 23, 2003 @10:14AM (#7033535)
    Cool. Show me (in C, no libraries allowed), how to retrieve the free space on a hard drive partition. Let's say the C app is running under Windows 2000, just to make it more specific. You know at some point java does have to bind to native methods. JNI is necessary at some point because this is a Virtual Machine. Also, in all the programs I've written, I haven't had a single problem with a user needing to look at the free disk space in their program (albeit, I haven't written any installers, jars rule all). Sure it can be kind of neat and all to see a number, but Exceptions work wonders. Although, I do agree, a Disk class or something similar would seem pretty logical.

An authority is a person who can tell you more about something than you really care to know.

Working...