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).
I don’t follow you here — you’re calling Java “a tool that, in
theory, has a lot of power for handling problems of tremendous
complexity”.
What is this “extra power of Java” that you’re talking about?
Java doesn’t have any extra power over 1980s systems programming language stalwarts such as Common Lisp, but any language with an object system is nice for building things such as computer-aided design tools. So for medium-complexity problems in which an RDBMS is not involved, Java can be much more powerful than a string-oriented scripting language.
You are talking from the classroom project or homework point of view. In this case – yes, Java requires more knowledge than it might seem necessary.
But then again, for any real life maintainable project, you will need clear controller, view and model separation. It is possible, even if a little cumbersome, with PHP. But it has many limitations bringing the project to a complete stop with growing complexity. Perl here is more of a tow truck serving as a taxi. C# is quite ok, though, from the language perspective. There are other problems with it, which might get resolved soon.
Talking from an experience of more than a dozen successfull projects ranging from 50 to 20tsd. concurrent users on my web application, I can tell you that only Java can stand the load, maintainability and scalability of the corporate demands. Given that you do your homework and use correct design patterns to build it.
But I see your point too: Java is not a ‘universal pill’. It has to be used where it serves best – complex, heterogenous, geographically spread corporate environment.
You are confusing Java programming language and whole stack of java APIs SUN offers for enterpise web programming. Your subject should say “J2EE is SUV of programming tools”.
As to your your comment about JDBC API, it is just one of APIs. Other API
could be created, or better yet this one could be extended to extend variable
substitution syntax for prepared SQL queries.
I agree wth Vadim. C#/.NET is very much like Java/JVM and, if it was Java itself that is an SUV, C#/NET would have many of the same SUV qualities.
The difference is tool support. MS did a great job designing and integrating ASP.NET, which is just a web application framework, into VS.NET. And since there is only one vendor, everyone knows about and uses that tool. Plus it’s really well polished and what not.
Java has tool support as well, but usually in the form of many open source projects, so the integration/documentation/polish isn’t as good as with ASP.NET.
Perhaps this diluted tool support does in fact make using Java an SUV-like solution, but it’s not specifically the Java language’s fault.
See http://jakarta.apache.org for a few ASP.NET-like Java web application frameworks (e.g. Tapestry and Struts).
And for your JDBC concerns, see http://www.hibernate.org for a very nice object-to-JDBC data layer that will save you from dealing directly with Recordsets/Connections/etc. and let you just talk to objects.
I can’t imagine writing a Java-based web application without tools such as the two or three frameworks above. And with having to use JSP…eesh.
So, the challenge of Java isn’t that it is inherently an SUV, it’s knowing where to find the tools that MS already provides built in.
Sun has dropped the ball with integrated tools and MS has them beaten (with concern to ASP.NET) by having an elegant, polished tool built over C#/.NET (that they just as well could have built over Java/JVM).
Regarding the binding to query variables (? marks). Can’t you improve your maintainability by using an integer variable that is incremented with each use?
The “Associate the 7th question mark with the number 4247” becomes “Associate the (i++)th question mark with the number 4247”. Regardless, query changes don’t magically propagate themselves into code – c, C#, Java, Perl or whatever.
Margaret, if you have a look at the example at the bottom of http://philip.greenspun.com/internet-application-workbook/software-structure you’ll see that your idea doesn’t get around the main problem. If a clause is inserted in the middle of the SQL statement, that means a ? is probably going to be inserted there too. The programmer will then have to figure out exactly where to insert the “Associate i++” command. If he or she is off by one, the wrong data will be filling the database or being queried out. If you have a database full of numbers (a bunch of things of the same type) the error might not be noticed for months.
Everyone else: the fact that something reasonably good could be built on top of the basic Java language seems clear but in practice it doesn’t seem like a great idea for maintainability to use a bunch of non-standard libraries (and because Java is non-dynamic you can’t do the truly nice interfaces that you could do in Lisp, Python, Tcl, et al.). And C# is a little better, yes, like a “car-based SUV”. But it is still far more cumbersome than necessary for what most people are actually building (e.g., a whole page of declarations to drag in basic libraries to do IO or whatever and no way to stuff those into a one-line macro).
I experimented with Java-platform web tools once. (I should say attempted to experiment; I never got anything working right within a month.) The lure of these powerful tools was that, given all this powerful infrastructure, perhaps I could overcome a quintessential web services tradeoff: you can have either excellence or integration, but not both.
Unfortunately at least in Java they seem to have failed at eliminating the tradeoff and instead have just expanded it: you can have an integrated system of best-in-class pieces, but all of the complexity of integration will have to be understood ahead of time before you can deploy anything. As a result of this initial barrier, just about the only places that can bear to use Java/J2EE/whatever for web services are those with the organizational discipline and resources to beat this: huge corporate IT departments. Another consequence is that there is a dearth of available best-of-class components out there to use, so the payoff is in fact quite low.
My advice: bite the bullet and write your own integrated system. If you can’t reuse a lot of existing good code at least you can imitate it. Pick something simple with a templating system, like PageKit/Perl (http://www.pagekit.org) and a standard RDBMS, and focus on delivering the interactions and pageflow that your users want without extra complexity.
(You could also pick a framework, with a lot of the work done already; but the only one I can think of that’s both tractable and still maintained is OpenACS, http://www.openacs.org. It is programmed in TCL for AOLServer though, so nobody will take it seriously.)
Re: Alex Pakka
Aside from the fact that the tone of the above reply seems to be “you’re just an MIT PhD with experience running and enormous software company – what do you know”, I disagree.
MVC – what language can’t implement this? Yes Java has it in its GUI classes (which no one uses), but when it comes to JSP, you actually have to use a series of hacks to get it to work – Java programmers are simply so used to these hacks that they think of them as an established ‘technique’.
Not that I like PHP, but PHP can implement MVC just as clearly as Java, and there’s no language level problem which will lead to the complexity spiralling out of control.
The common problems that people associate with PHP are largely because many PHP programmers are less experienced (because the language has a low barrier to entry) than similar Java programmers.
The idea of calling Perl a tow-truck, which I assume suggests that Java’s 40Mb resident footprint and multi-second startup times are ‘sleek’, is simply not comparing fairly.
Lots of things will cope with more than 50k concurrent users. Yahoo make extensive use of Perl, C, Python and their own custom Y! languages, and I hear things are going pretty good for those folks.
Java, with its heavy hardware requirements, is infact less suited to do this than lightweight solutions like Perl.
Finally, to close on experience, I’ve worked on several medium sized Java projects for the finance industry. I can’t boast 50k concurrent users, but we handle 5k frequently enough.
I’ve also worked on projects in other languages, my current favourite being Python, which have gone much better, and much worse.
Java’s advantages are that it’s easy to sell it to your boss, and that programmers are very common. It has ‘blue-chip’ credability. It’s an okay language, but let’s not go overboard.
If you consider yourself and engineer and not a coder, and if your problem is better solved with a different language then it’s your job to convince your less technical (but equally opinionated) superiors of this.
The analogy breaks down in that you *can* quite readily get in an SUV and drive it to the local 7-11, but you can’t just quickly and easily use Java to dump something out of your RDBMS onto a web page.
Our solution was to build a whole load of components in Java to make doing this really easy. Our own database interface means no problem with bind variables (everything is referenced by name). Our own templating engine means simple web pages are easy to create, graphic designers can do the layouts if they want, etc.
For simple web apps the power is there but not needed. For complex ones it is there when it is needed. But the big advantage is this means that we can have one common code base for our wide variety of applications. And there are lots of other advantages too. We can use libraries as their required for esoteric stuff, inexperienced programmers can be productive, everybody knows Java these days, debuggers, profilers, etc. are all available and so the list goes on.
So for us Java has become an SUV with a little scooter than can drop out of the back, a couple of high-lift wings which gives us great STOL capability and a big reliable turbofan for the long distance cruises.
The way our folks use Java over here is more like driving a family sedan (think Civic, Corolla, etc) than an SUV.
It’s when you start importing those 250 library .jar files that you start turning your sub-compact into an AutoDuel fighter. But you can start with as little as you need (just the ol’ rt.jar) and add only as required.
Yes, if you use Java app-servers with all their bloat as a hammer, then everything looks like a nail to you. That applies to nearly any other language too, if you start with the heaviest possible set of libraries. But if you do things the other way round, that’s fine!
I wonder how much of the trouble the students had was not with Java, but with the infrastructure required to support JSP. This often done with Apache and Tomcat. Getting a “connector” which is compatible with both your Apache and Tomcat versions, and configuring it so that you actually know where to put your class files is a real pain. Once you have “Hello, Web” working, it’s pretty easy to go from there. One of the things which attracted me to Java was that I could actually read and understand the language spec, back before there were any books on it. To do that with other languages, you have to be a better academic than I am.
To restate, more concisely, is it Java or the configuration for JSP that is the problem?
RE: Aaron Brady
Even if I might want to discuss some statements you’ve made, in general I agree with you on this: every task has a tool best suitable for it and if you know just Java, or if it is easier to sell to you boss, your task is to check for other, maybe more efficient tools and, if necessary, find arguments and convince the executives.
My tone was not meant to offend anyone, I just felt offended by the post stating that Java in general is quite useless with arguments not justifying it (IMHO). Especially if it is told by a teacher. Show the weaknesses, demonstrate power of other tools – yes. But to say ‘Java is a wrong choice at all times’ sounds not right.
BTW, I find Python quite good as well. Even more, I once wrote my own OO language with twisted sematics just to solve the project’s task more efficiently. Classes in it were based on interacting ‘facets’, which in turn contained methods and properties. It was useful for simulation’s 3D visualisation.
Now, this is my general approach about Java (and why I still prefer it for the server-side): if I see that a technology given to me is cumbersome, I extend it or use a different one. JSPs allow for custom tag libraries, I really never need to make any ‘declarations’ at the start of the page. For many other things, where appropriate, there is XML. And XSLT. And, finally, I do write interpreters quite alot. I want to use full power of Java libs available and I want to minimize amount of code necessary to do the job.
Steve: I don’t think it is the configuration per se that is holding back the students using JSP. Everyone set up their tools back in August and warmed up their infrastructure doing the exercises in http://philip.greenspun.com/internet-application-workbook/basics. We really make an effort to ensure that tools problems are ironed out prior to the start of the semester or conquered heroically in the first week.
and here we go… what’s the best language? Python? PHP? Java?…
Philip said it himself: “something reasonably good could be built on top of the basic Java language seems clear but in practice it doesn’t seem like a great idea for maintainability to use a bunch of non-standard libraries” (emphasis mine).
What’s a standard library? Unlike Microsoft, Sun has specifically embraced the library developing community with the Java Community Process. Not using the Jakarta libraries, the ObjectWeb libraries, the OpenSymphony frameworks basically means: reinventing the wheel. If you use JSPs like PHP-pages, cramming all your logic into the “view” your architecture won’t work. Every computer science undergraduate should be able to work with PHP, but it requires more understanding to work with Java. Using JSPs with a decent Taglib from Struts, the JSF effort or at least the JSTL keeps Java-code out of the view-layer. Your post somehow says “if I use a wrench as a hammer and ignore the manual that specifically states that a wrench is not a hammer I get bad results… THEREFOR the wrench is not a valid tool!”.
To the posters above:
– if you have a problem with the Apache-Tomcat connector: use Jetty.
– if you think the Model-2 is a hack, explain all the Model-2 frameworks for PHP (Ambivalence) and Perl and Python… that was a really stupid comment, sorry.
– as for J2EE: “if EJB should be used in a project, the question must be asked whether the problems that need to be solved are transactions, security and scalability – the issues EJB is meant to solve.” (from a SignSoft article).
– 40MB runtime or not, Java scales in a cluster with in-session fail-over, PHP does not. Period.
It should be made clear, once and for all, that web application development has to FIT the job at hand and a teacher at the MIT should then at least make sure that his students have the required level of understanding of the three TOTALLY DIFFERENT TOOLS they’re using to solve the problem. That should be the goal of such a project, because that is a VALUABLE expirience.
Oh by the way: http://radio.weblogs.com/0118231/stories/2003/03/05/clarifyingSomeBindVariableConfusion.html
You can use Oracle-Bind-variables with Oracle. I imagine that you can use SQL-Server-style bind variables with ODBC. I guess Sun used “?” as the standard, because there are rdbms with no bind variable support?
perl already has an object system plus it has all the features of a “string oriented scripting language.” with mod_perl you don’t have the cgi overhead. you can do the sql by question mark bit or you can dump the vars in the query or you can do both.
you can use a ton of objects to make things easier (like ones to generate excel files, make html calendars, do various html tricks, access db’s, do db caching, etc, etc) as well as building your own class libraries. or you can write a quick and dirty script or something in-between.
To hell with OOP (which I’ve been using since 1984 and actually love), I struggle with Tcl, PHP, Java, and C# and long for a backquote.
To hell with OOP (which I’ve been using since 1984 and actually love), I struggle with Tcl, PHP, Java, and C# and long for a backquote.
Have them check out sqlj (http://www.sqlj.org/). It is a pre-processing step for java source files, which preprocesses #SQL statements and converts them into the required database calls, so you end up with fully JDBC compliant java code to compile. It allows things like the following
int count;
#SQL {
SELECT count(*)
FROM mytable
INTO :count
};
or for submitting data you can use
String name = “John”;
int age = 20;
float salary = 20000.00;
#SQL {
INSERT INTO employees
VALUES (:name, :age, :salary)
};
Which gives you almost exactly the support you need. It is an open standard endorsed by Oracle and others (since it compiles to JDBC calls it should theoretically work with any database). It is far, far easier to work with than the base JDBC calls and I am sure your students will find it very useful.
Eamonn
People say I repeat myself too.
JSP != java.
Java really isnt very suitable for generating html.
JSP is not really suited for this because it doesnt support embeded sql.
Nothing that cant be solved by api’s or a tool such a Eamonn suggests.
JSP != java.
Java really isnt very suitable for generating html.
JSP is not really suited for this because it doesnt support embeded sql.
Nothing that cant be solved by api’s or a tool such a Eamonn suggests.
Uh oh. This entry has made it into Slashdot. Phil, brace yourself for the moron-flood…
Clearly, you should take a closer look at JDBC.
If you take a look at the Meta-Data section,
you can easily solve this problem.
Meta data will tell you everything you ever wanted to know about your database and tables.
Java has a higher learning curve, that goes with it’s higher productivity. But, the productivity isn’t free.
Clearly, you should take a closer look at JDBC.
If you take a look at the Meta-Data section,
you can easily solve this problem.
Meta data will tell you everything you ever wanted to know about your database and tables.
Java has a higher learning curve, that goes with it’s higher productivity. But, the productivity isn’t free.
Clearly, you should take a closer look at JDBC.
If you take a look at the Meta-Data section,
you can easily solve this problem.
Meta data will tell you everything you ever wanted to know about your database and tables.
Java has a higher learning curve, that goes with it’s higher productivity. But, the productivity isn’t free.
I tend to agree a bit in the sense that Java is the SUV of programming languages (There are lots and lots of things you shot yourself in the foot), BUT, I don’t see why you’d make the qualification that because it is too hard for an MIT graduate, hence too hard for everyone else.
I believe the problem is with the students not understanding the framework they are given. One course of Java does teach someone how to code in the Java programming language, BUT, it doesn’t explain how a Servlet engine is implemented, how a garbage collector works, how to architect a whole web solution, etc, etc. That comes with time and experience. Of course, one doesn’t need to know all this to implement a solution, but, it does help.
And to add to the ‘?’ char and the number of the column in the query: DON’T use a PreparedStatement. You’ll suffer a bit in terms of performance, BUT, if you don’t know how to use them, then use the simple SQL statement and avoid the confusion (Which a student should be doing anyways).
> Uh oh. This entry has made it into Slashdot. Phil, brace yourself for the moron-flood…
Made a loud, meaningless, generalized, judgemental statement, get twelve thousand loud, meaningless, generalized, judgemental statements in response. I hope someone has been educated here.
PS I use PHP, Perl or Java/J2EE, depending on the job.
Perl is a fantastic language if either the algorithm is a simple one (so there won’t be much code), or if it’s being used in an ephemeral fashion (clean up some data once).
Those who can do; those who can’t, teach. The gentleman expressing his views has not had to experience the practical difficulties of doing a large scale software project INVOLVING MORE THAN ONE PROGRAMMER (or in his case, doctoral student!). Have you ever tried debugging somebody else’s large scale Perl project? Unless you were twins seperated at birth, it’s quite difficult.
As for your students struggling with Java:
THAT’S AN INDICTMENT NOT OF THE LANGUAGE BUT YOUR EDUCATIONAL SYSTEM! Your piece reeks of the McDonald’s coffee-cup spilling, “it’s not my fault!” thinking that permeates our culture today. Most academic programs in computer science training have been a disappointment; that does not lead me to believe that we cannot have REAL comp sci training programs. But for that to happen, teachers like yourself will have to get off your semi-retired duffs and work around the clock updating your curricula to keep pace with the changes the industry goes through…
Philip,
Java supports reflection and invocation, which unless I misunderstand your meaning, would let you do all the dynamic binding you would like. To write a general, reusable class that would dynamically populate objects with the results of an SQL query would be the work of a half hour or so. Using DatabaseMetaData, ResultSetMetaData and the java.lang.reflect package (which is standard) there is no reason you couldn’t do dynamic binding.
As for a whole page of declarations to do IO, what is wrong with:
import java.io.*;
In JSP the same thing is just as easy:
<%@page import=”java.io.*” %>
I do agree with you on one point, which is that using ? for bind variables and having to count them up is error prone, but this is not a failing of Java. It’s a failing of JDBC and is easily fixed by the end user. A general class that maps ? to ::named_variable would be easy enough to write.
Every programmer eventually has their own arsenal of code that they will use everywhere, no matter what the language. I like the fact that with Java I only have to carry around vonnieda.jar and not a pile of web pages with embedded queries and code scattered over the place.
There is a lot to be said for RAD tools that write your code for you, but eventually a programmer is going to have to make a change to that code to get it to do something the designers of the tool didn’t think of, and when that happens it’s good to not only have a language that can be flexible enough to make the change, but programmers who know how to do it.
Jason von Nieda
I think two things might be responsible for this poor opinion of Java. The first being expectation levels. Java is complicated and powerful – the important thing is to use the right tool for the right job. Almost any small project is done much easier with ASP, Perl, PHP, Python or something similar. Java only shines when you begin working on really big infrastructure – where you have myriads of back-end systems that have to be tied together with some kind of cohesive, understandable, standardized architecture. Talking to databases and rendering HTML is only a small peice of what Java does. The discouraging thing about this in the educational environment is that I don’t see any way it would be possible to fit a project of sufficient complexity into a semester to really show where the long-term payoff with java development is at.
The second issue would seem to be about the toolset. I didn’t notice what commercial IDE or Java application server framework was being used for development. Microsoft .NET includes an integrated development and deployment environment. To try and develop java code without commercial tools and then compare it to using commercial tools to develop .NET code is comparing apples & oranges.
So, I agree, Java is an SUV, or perhaps even a semi-truck. You don’t want a semi-truck to go to the grocery store, but they are still very useful.
I think two things might be responsible for this poor opinion of Java. The first being expectation levels. Java is complicated and powerful – the important thing is to use the right tool for the right job. Almost any small project is done much easier with ASP, Perl, PHP, Python or something similar. Java only shines when you begin working on really big infrastructure – where you have myriads of back-end systems that have to be tied together with some kind of cohesive, understandable, standardized architecture. Talking to databases and rendering HTML is only a small peice of what Java does. The discouraging thing about this in the educational environment is that I don’t see any way it would be possible to fit a project of sufficient complexity into a semester to really show where the long-term payoff with java development is at.
The second issue would seem to be about the toolset. I didn’t notice what commercial IDE or Java application server framework was being used for development. Microsoft .NET includes an integrated development and deployment environment. To try and develop java code without commercial tools and then compare it to using commercial tools to develop .NET code is comparing apples & oranges.
So, I agree, Java is an SUV, or perhaps even a semi-truck. You don’t want a semi-truck to go to the grocery store, but they are still very useful.
1) JSP != Java
2) J2EE != Java
3) As already pointed out, there are quite a number of alternatives to J2EE and JSP for deploying/designing web applications with Java, including .NET (yes Virginia, .NET does support using Java as a development language). This is one of the advantages and disadvantages of Java; that there is a plethora of web development frameworks available for it, and that people who should know better don’t understand that there is Java the language, Java the environment, and all of the Java APIs which you can take or leave as you see fit.
So please, before spouting off about how Java is such a bad web development language, please know what you are talking about first and explore the alternatives to Sun’s APIs (Struts, JBOSS, etc.).
BTW, I find Java to be a very easy language/environment to get things done in – but then I am not confusing it with J2EE.
There is some truth to the assertion that J2EE is the SUV of programming languages. Many J2EE projects are foolishly over-engineered (for example, using EJB entity beans when simpler persistence architectures would fulfill the system requirements).
But I wouldn’t say that Java or JSP are SUVs. You can create a simple, page-centric, website using nothing but JSP and some Java scriptlet code.
Just because you have the “option” of using a MVC pattern incorporating Struts, JSTL, EJBs, etc., doesn’t mean you “have to”. It is the developers job to determine which architecture is most appropriate for the job at hand.
By the way, I’ve written an open source JDBC framework called SQLExecutor that simplifies database access in Java:
http://www.softtechdesign.com/media.html
-Jeff Smith
What an unbalanced opinion. I really expect more analysis for an opinion to matter. Haha. One more: haha.
Hey code guy, I can’t let you get away with that. Look what MIT has given to the US economy over the years and look what Java gave to the US economy in return. Philip is right all the way. Read on….
“I read with interest the findings of a recent Standish Group report aptly named ‘Chaos 2003’, which regularly diagnoses the health of IT projects in the US. I was flabbergasted by what I read. Project overruns have increased from a ‘low’ of 63% in 2000 to a staggering 82% in 2003. Over 51% of these projects are in serious trouble with 15% of them failing outright. And of those that complete, only 52% deliver on customer feature expectations. And the cost of this fiasco to the US economy? A cool 38 billion dollars in 2002. Heaven knows how that translates to the rest of the world !
This is not a new phenomenon. So why does this situation persist ?
From my humble observation tower, it’s difficult to blame the customer. I blame the industry. It is simply not performing its primary function; that of serving the best interest of its customers.
So what’s going on? Several things.
First and foremost, project managers underestimate the complexity of the tools with which they wish to work. A complexity that is totally unnecessary for business applications that process data intensive transactions.
Second, they believe vendor performance claims for these tools. It’s hard to think otherwise when high-profile analysts and sections of the press support them too. Remember when you were being told that Enterprise Java Beans were ‘the Holy Grail’ for business application development? Tell that to the poor project manager in a large financial institution that scrapped 6 months of development with EJB because of scalability problems. And where is EJB now? Forgotten. Replaced with J2EE – of course. And two years from now? Replaced by something else.
I am sure you know similar stories. As the Aberdeen Group rightly argues in their February 2003 report on Programmer Productivity: ‘to bridge the object-relational mismatch, developers must perform an awkward translation between objects and databases’. In layman’s terms, this is not a marriage made in heaven.
Finally, like every human, project managers forget. They forget about their failures and insist that ‘this time, I’m going to get it right.’ But they don’t, because they refuse to believe the truth of the matter; that the tools they are using neither fit the purpose, the skill set, the timeframe nor the budget that executive management has decreed. And so the cycle repeats itself. And the result is the waste of valuable corporate resources.
Some businesses can afford this waste… most cannot.
So, welcome to the increasing numbers of you that have ‘seen the light’. The fog is beginning to lift and you join the ranks of those with an increased sense of responsibility – to your customers and to the company that pays you.”
Jean-Georges Schwartz
Philip wrote on 9/21/03; 10:45:44 AM:
>e.g., a whole page of declarations to drag in basic
>libraries to do IO or whatever and no way to stuff
>those into a one-line macro.
Completely incorrect. Going against an emerging “correct” way of importing, you can use java.io.*, rather than import each class separately. And of course, the ‘one line macro’ is accomplished through either of the include methods in JSP. (directive or action).
Mmm, just give me my nice XSLT pipelining solution. AxKit works MUCH MUCH MUCH better than all the JSP/Struts/Tiles/J2EE muddiness. Anyone that claims they have a Java servlets implementation that can carry a load equivalent to a well-designed mod_perl based installation is just plain a fool or making money selling you bricks. I’ve been building web applications since 1992 (yes, that is actually accurate, the first ones were hacked CERN web server implementations of annotation and message base systems).
The truth of the matter is MVC is a square hole in a round peg when it comes to webapps, so the entire paradigm does nothing but get in your way. Separate data, content, and logic with tools like XSP and XSLT, build good coherent taglibs on top of a solid OO ‘Controller’. JSP is noplace anywhere near this kind of tech, and neither are all the ‘tags-in-templates’ based solutions like PHP (though PHP can be adapted to more modern methods as presumeably most similar languages can).
Keep your projects simple, make sure all your team members understand all the parts, and take your XP methodology pills every morning. Trust me you’ll be OK, and if not, just call me, my rate ain’t all that bad ;o).
A little off-topic, but this touches on a pet peeve of mine, namely the misapplication of Java for web applications.
I’m surprised nobody has mentioned Zope yet (perhaps because it’s lumped under the general “Python” category), a mature, scalable, integrated web app platform that incorporates the nicest, cleanest template language I have ever used, TAL, and its macro extension, METAL. (There are several implementations.)
Like Visual Basic, it’s a great platform for teaching. After installing Zope (itself a simple process, especially on Debian and on Windows) getting something up and working, even a complex RDBMS report, is a matter of a few mouse clicks and a little typing, and all through the web interface.
I’m not a car person — you Americans sure seem to think about cars a lot — so I’m not sure what kind of vehicle Zope is. Maybe something futuristic and powered by alien zero-point energy technology.
“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).”
Yeeesh! Care to comment on what you mean by “tools such as Visual Basic?” Do you mean any Microsoft product or was there some aspect of programming in Visual Basic that makes it a superior language for getting jobs done on time and under budget? Or was this sentence just lifted out of some Microsoft brochure?
Also, I would love to see a reference or citation or URL for any substiantion of the statement that Visual Basic “controlled all the machines that decoded the human genome”. I mean, you did read that somewhere, or someone told it to you, right? It’s not just an invention out of whole cloth?
I cannot agree with the “people who want to get things done use VB” statement, as I have been involved with numerous projects designed to recover from exactly that situation. Oftentimes, it was easier to consider the VB project as a mockup, and then throw it away.
A small project is easy to architect in VB, .NET, JSP, Perl, or whatever tool the author knows. If the project is only going to take a few days of a professional’s time, or a few weeks of an eager but inexperienced student, then the simpler the language, and the more it allows hackery, the better. It is when the project lives on for a while that it gets ugly.
I find Java a very good tool as the project ages. It seems more maintainable, especially with multiple coders in serial, than Perl, and more scalable than PHP. JSP and even more J2EE are overengineered in many cases, but using xdoclet to generate your tedious classes civilizes things a great deal. Unforunately, these tools do have a learning curve.
It is similar to testing – if you use JUnit tests, you can make a very bulletproof project, but you have start using them at a very early date. When you first start, it is not clear that these are helping.
Consider – a perl script is almost certainly a better way to solve a simple build script problem than some kind of Java or C program. It is not the right way to create a word processer designed to compete with Word. The problem with the fundemental thesis of this thread is that many web apps do grow with time, and when they break, they break hard.
Scott
Phil, if students have a Java infrastructure set up but are getting bogged down in JSPs, they can just toss in a couple more JAR files and start writing pages in Scheme instead, using BRL. They can keep Oracle, Linux, their servlet container, connection pools, etc. Just use a more suitable language in the individual pages. BRL’s one-step declaration and validation of user input will address the security concerns mentioned in your workbook as the main reasons for using PreparedStatement.
I am encouraged that I will always be able to find work, if MIT seniors have trouble writing a JSP page to talk to Oracle.
I have a really hard time believing things are so difficult for your students in working with java. It’s a very simple langauge, binding to the database isn’t even as tricky as setting up ODBC bind variables and JSP is way straightforward! Ihave been coding in Java since 1996 and am amazed that the quality of minds at MIT is having this kind of difficulty with something as straightforward as querying a database, and displaying information on a web page. Have you thought that you may not have taught your students as well as you think? Or that perhaps a desire to teach programming as a functional process may have caused your students a hard time to work with the OO that lies underneeth everything in the language. It seems that too often do I see individuals dismissing java as a “difficult” or “slow” language when those individuals have not either spent the time to really understand the basics of the language or the properties that it works out of. I can tell you for certain, that Java does not cost “5 times as much” or take “twice as long” as a project done in any other 3gl language. Scripting may be faster, but it is often harder to maintain and not nearly as sacalable. Anyway, I’d love to hear back from you.
Philip, I realise you have a long history of bad Java experiences and your dislike of it is reinforced every time someone tries to use it the wrong way, and fails. Even ArsDigita got stung trying to use it the wrong way. As you may remember from the old photo.net/wtr days, I love Tcl and good technology like AOL server. Pure JSP is not the way to do it, it will be a mess. Something you should realise this as ADP is also not a good way to do it in AOLserver. The “problem” is that working with strings is a real PITA in Java. This is why Java is not the best choice for one-off websites, likely the ones your students were creating.
If you want to design something like the ACS in Java, J2EE is a very good choice. But don’t work against it by trying to put too much logic (any) in the database, it is not needed, nor desired. Then create many classes/session beans that do the actual work and put the results in a very simple JSP page. Next, you use OpenSymphony SiteMesh decorators to put the fancy HTML around it. No Java code here, just some JSP tags that pull in the information from the simple HTML. Want to make the site look completely different (ie: customizing the ACS for a client) all you need are new decorators. This is what my company does, and it works. (and I am a sceptic!)
Yes that does take a long time, but it is very reusable. So that makes it great technology for an ACS type system. But not for a simple website.
As for Java in general, it is so easy to develop things fast. And with much better exception handling than Tcl/Perl/PHP/etc which makes it fantastic for banking back-end applications like I am working on now, and many other situations.
Don’t discard it so easily because it is not well suited to one-off websites.
Folks who are critical of MIT education: MIT doesn’t teach Java or any other computer language. The students learn Scheme (Lisp) as a notation for computational ideas in 6.001. They learn and use Java to get their work done in the software engineering lab (6.170) that is a prerequisite for my course. So all of the students have experience building 10,000-line applications in Java even though no MIT staff member has ever given them a lecture devoted to Java syntax or language features.
Similarly in 6.171 we don’t teach any of the imperative languages that they may have chosen for implementing their presentation layer. We don’t teach SQL either, for that matter, expecting students to pick it up as they do the problems. To the extent that 6.171 has lectures they’ll be on topics such as how the RDBMS uses locks to control concurrency, what the index structures inside the RDBMS look like, etc.
I don’t think the students’ education is deficient because the teams that are using C#/ASP.NET aren’t having any trouble with the tools (none of them had seen C# or Microsoft .NET before the class started). The PHP/Oracle and PHP/PostgreSQL crowd doesn’t seem to be suffering either.
The fact that a professional programmer, after a lifetime of experience and months of talking to friends and Googling, can find some Java libraries that make building an Internet application possible in what is after all a Turing-complete language doesn’t surprise me. But that doesn’t help a student who has 13 weeks in which to build a fairly substantial application (see http://philip.greenspun.com/internet-application-workbook/ for what the students must do in 13 weeks, never having used a SQL database before).
Two questions for you. Have you tried Struts? and How
come the students didn’t use Servlets? Once you and your
students do some research on those two question, I bet you
will change your statement about Java being and SUV of the programming languages. But for now you should be ashamed for calling yourself a teacher. One more thing, get a book on JSP/Servlets and Struts, read it, do the examples, and then make your statement.
James Welcher: Where did I learn about the use of VB for the Human Genome project? On a visit to the Whitehead Institute, a few blocks from the main MIT campus. They have a huge warehouse full of gene-sequencing machines running 24/7. The fellow giving the tour proudly noted that “All of these are controlled by Windows machines running Visual Basic”. Of course there are various other genomics tools applied farther upstream to the collected raw data. I think the 1990s when this was a really dynamic field they were mostly done in Perl (at least that’s what my friends were using and http://www.stanford.edu/class/gene211/handouts/How_Perl_HGP.html seems to back that up). Perhaps now that the field has calmed down to some extent they have enough time and money to spare to use non-scripting languages (and given a solution mapped out by an American biologist in Perl a low-wage foreigner working in C or Java could probably build a functional equivalent).
Folks who talk about how Java implies better maintainability: Let’s assume that 500,000 lines of Java code is easier to maintain that the 100,000-line equivalent Lisp or PHP program. For a first pass at building an Internet application, I’m not sure that incurring a huge initial cost in time and money in exchange for easier maintainability 10 or 20 years later makes good business sense. Most organizations, after just a few years, decide that they can improve substantially on their initial ideas and tear the whole old thing down and rewrite it from scratch, regardless of the initial language of implementation. (Actually most IT projects never see the light of day at all so perhaps it is better for the customer to fail cheaply and quickly rather than drag out the failure for many years with a complex set of tools! (Might be better for programmer job security, though, to fail expensively and slowly.))
Hmmm.. maybe I’m convincing myself that the right thing is to build the first launchable version in a scripting language and then send that off to India, with desired changes, as a spec for the v2.0 version that can be built in Java or C#.
I divided a class of mechanics into three groups. I required they develop basic knowledge of the operation of the tools at hand before beginning and before the full scope of the task was conveyed.
I then gave one group 6 inch butter knives, the second group a variety of screwdrivers, and third group a full set of Craftsman tools. I then tasked each group to assemble a doll house fastened entirely with flathead screws.
Amazingly, those with butter knives, faced with no other choice of tools, completed the task most quickly. Those with a range of screw drivers completed the project nearly as quickly. Unfortunately, those with the Craftsman tools spent a lot of time learning the basics of socket wrenches, ratchets, torgue wrenches, and screwdrivers.
I therefore conclude that the best tools for construction are butter knives and any investment in time or resources to learn a more complete set of tools is wasted effort. Those who master Craftsman tools are like SUV drivers driving to 7-11…
Where can I pick up my government grant?
Re: Jack Frosch
Fascinating. Where could I see the write-up on this study?
The title of your aritcle has nothing to do with its content. Your title suggests your are writing about Java and programming languages, while the content is basically a question of which is the best scripting environment, JSP, ASP, or PHP. It is worth noting that PHP, ASP, and JSP are not programming languages. The article has nothing to do with programming or programming languages such as Java or C#.
I can guess why the ASP students are doing well. It’s probably that the fancy GUI they are using has written most of the code for them. Ask these same students to write a controller based MVC app and watch their work grind to a halt. PHP scripting probably has a little better support for SQL but do you really want to write a large project with humungous PHP files filled with SQL. I am a long time Java developer and I’d be the first to tell you that JSP in its raw form may not be the best scripting environment. But combined with a few tag libraries JSP is very powerful.
The title of your article should be “JSP not as good as PHP or ASP”, but that doesn’t sound that exciting. The title you gave the article indicates that your have some axe to grind with Java.
Agreed – VB is an excellent prototyping tool and does work well for RAD-type environments. PHP and such are great tools for whipping up prototypes and first pass runs at applications. There are ALWAYS incremental changes to the “frozen” spec that end up included anyways to the chagrin of the devs. Fact of life.
For intense crunching, solid-spec systems or environment-limited situations there are better tools.
I like Java for one single reason – portability. It doesn’t tie the user down to any given OS. While most are still tied to the MS franchise there’s an increasing proportion of OSX and Linux users. Webapps take the brunt of this for now. They may be replaced by Java-ish builds later if Java can handle the UI portion well. (UI seems to be the largest complaint I’ve heard – it’s not polished or as fast without OS-specific kits.
Maybe C#/.Net/Java will all die and we’ll all be running webapps running some as-of-yet undeveloped PHP-meets-javascript-meets-MFC client-side code in a web browser.
Until then, pick your tools on a per project basis.
IMHO, SUVs are incredibly usefull. However…minivans generally hold more people and have more cu.ft of cargo room. (Check it out if you don’t believe me.)
-Mike
Wow.
I don’t have a PhD. in CS, I’m not a professional coder, just a casual one, and I’m not even that particularly good at it…but it strikes me as odd that the MIT graduates, which are supposed to be the future of computing choke on creating a half decent, database backed web application in JSP…even I can do that, and it won’t take me 13 weeks to finish it either.
You know, putting database access code in a webpage is in general pretty bad form, and it dissapoints me that you seem to be encouraging this practice…what do those students do, copy and paste whole blocks of code every time they need it? That’s what you have servlets or javabeans for. I’d expect an MIT graduate to be able to abstract functionality from layout, and treat it as such when designing a web application. From what I read in your blog and from some comments above it seems that the overal design part of the whole application is sacrificed, and that the students seem to be forced to approach the whole course one block at a time, without looking at the big picture of the whole app. Bad software design, bad project management and in general a bad outcome (product). And it’s true that the tools and languages you seem to admire actually support this kind of approach. That doesn’t make the tools any better, mind you, it just makes the one using it worse for falling into this very dangerous trap. Perl, PHP and VB are notorious for this, and apparently C# too (never looked at it).
On a side note: If you take away all the good things about VB (which is really only one: direct and unrestricted access to the underlying OS), all you have left is a backwards implementation of an OO language…as long as you’re on a win32 platform it can be a pretty nice language to work in though…luckily the world doesn’t solely consist of win32 platforms.
And you know what they say about opinions. You’re entitled to yours, and I reserve the right not to agree with it.
I have gone through MIT and several web apps for start-ups and huge enterprise software vendors. I don’t blame Java, C#, Perl or PHP. The real crappiness comes from SQL and especially HTML. I would rather write Java code that generate LaTex. And I would rather write Scheme expressions than XML.
I can’t believe you people are arguing over Java/Perl/PHP/C# when you clearly should be boycotting and overthrowing HTML.
you’re an idiot, this is bullshit
Phil: “A project done in Java will cost 5 times as much, take twice as long.” Putting out such strong statements without hard data to back them up is just trolling. Do you have a cite?
*I* should do real systems development in PHP or PERL?
In PHP? This is ridiculous.
In PERL? This is quite possible but needs far more knowledge, and dont forget geekdoom, to do than in Java.
Most of your article really makes no sense. You talk like a biologist about nuclear reactor safty, or like a lawyer about computer science, oops, you are a lawyer.
No wonder … I hope you prepare your cases in court better.
angel’o’sphere
P.S. what do you think why *I*code in Java and not in Visual Basic? Correct! Because I know 10 times more than the average VB coder.
If something fundamental like PreparedStatement is really biting you, there a good chance other people feel the same way, and have solved the problem.
I have used PHP, Perl(mod_perl), C#, and Java professionally. I have found in my experiences that using PHP, Perl, C# are easier for inexperienced programmers to pick up and use. This does not mean these languages are superior by no means. Java for real life applications developed by a competent group of programmers is much easier to maintain, scale, and extend. However, putting a group of incompetent programmers together with Java will never get the job done. I don’t think having a degree in CS from MIT really provides much real world experience. I graduated from CalTech and although I found the education to be world-class, it did not season me as an experienced programmer. I’ve also found your comments about Java to be those from someone who probably does not have very much experience or knowledge about using it correctly. JSP should not be the only tool used for making a web app. The savvy Java professional will tell you right off the bat that the JSP pages should NOT be used for anything other than dynamic display. Business logic and application logic would be better served implemented into plain Java classes (sometimes done instead w/ EJBs but that’s not always necessary) that are invoked from within a form handling (controller) Servlet. Between the display layer and the logic layer, simple value objects (beans) act as communication between the two layers. In many ways I am describing MVC2. With all that said, Java really is the most used solution in the enterprise. You are doing your students a disservice by not understanding how to use Java correctly and ignorantly discouraging them from using it. MIT is supposed to prepare students for the real world and that you clearly are not doing.
Seems the discussion here is being blurred between Java and J2EE. IMHO J2EE is the work of satan, but Java is a fantastic programming language. In fact, I’ve even written a whole new web development framework to avoid the complexities of J2EE. http://www.puakma.net This allows me to integrate with a RDBMS easily and generate dynamic web content with relative ease.
The sooner J2EE is put out of its misery, the better 😉
My 2c.
Brendon.
Write all logic in DB stored procedures.
And thisdiscussion is irrelevant
Write all logic in DB stored procedures.
And this discussion is irrelevant
Having developed web applications in most of the major scripting languages (Cold Fusion, ASP, PHP) and in Java, I’ve gotten a pretty good perspective on all of them and their uses.
In general if you want to make a simple site that won’t be upgraded or maintained – use a model 1 development model with a scripting language (yes this includes JSP – JSP is not even close to what Java is on the web), but for anything serious you need to use a model 2 dev model – involving a framework like Struts. Maintenance in anything model 1 becomes pure hell (I learned this the hard way as a freshman) because the error messages just aren’t as detailed as opposed to using something like a servlet (in model 2). Yes there is a learning curve, but it does pay off. Development time is actually quicker in the long run as the project matures, since you’re not ‘shooting in the dark’ – just guessing as to what is wrong with your script and you dont pull nearly as many hairs out (I noticed that Phil doesn’t have much of it).
I don’t really think Phil has much experience with web development, especially with maintenance… to be posting something really stupid.
Having just gone through the horror of writing an application in PHP which I should have written in Java (likely utilising Struts), I can affirm that this article is, in fact, speaking bullshit.
Of the expected couple of days I was going to take in Java, I expected a little more time to get it working under PHP, and I thought this was going to be acceptable due to the fact that I wouldn’t have to run a Java web server on my machine, which would free up a few resources.
Five days later, I’m starting to think I might just go back to Java and rewrite the rest of my site to use Java on the whole. PHP’s ability to have class instances handle database logic is no better than Java’s ability to have JavaBeans handle database logic, and in addition to this, there is no ability to catch errors in any reasonable paradigm, and the whole thing suffers from being weakly typed.
The horror.
Apparently he’s lamenting MIT students’ inability to program in Java, and blaming the technology rather than the users. He also doesn’t seem to be writing about Java at all, but rather JSP pages with “pages of” Java embedded which is horrible form, but typical of students in my experience. Ok enough trolling.
You are lucky considering the sweeping statement you made and being slashdotted that you haven’t been hit worst then you have been.
Java, SQL, C#, Perl, PHP, application servers, OO design all of these are powerful weapons that require time and training to use correctly. From what you’ve said, the students were given a project that forced them to implement these, without necessarily having the training first — other than what they picked up on their own.
I can’t help thinking that this is a project that will only generate the skills that I used to see in the fresh college graduates, and that we had to retrain — quick high pressure hacking, code slamming, and really poor N-tier design and database access.
I’ve worked, professionally, with C#, Java, PHP, Visual Basic (even the NET stuff, which I can’t stand), Perl, and about ten other programming languages. Each has their strengths and each their weaknesses. I like them all, and can work with them all, though after 20 years, I grow tired of code hacking. I can give you a dozen reasons to use any one, depending on the circumstances. There is no universal ‘right’ language or ‘wrong’ language, but there is good and bad uses of any language. SUV applications are more a product of inexperience and over engineering than programming language.
I’m sorry that your students exposure to a Java application was soured by the what sounds to be a pretty loaded situation. However, Nick Chalko had the bottom line on this — if your students want to get hired, they better have a good grounding in Java, C#, PHP, NET, and you better throw in Python and two databases, and at least two operating systems. Because even a MIT degree can’t help in an industry that’s pushing double digit unemployment in some states.
You’re not just teaching software engineering, you’re also teaching attitude.
Least scientific thing I’ve read in a while. And I do read the back of the cereal box while eating breakfast. Classic “part for the whole” rhetorical switcheroo. Java sucks because other tools are a little bit easier for making tiny, little web interfaces. There’s a lot more that is still being done with classic programming languages than yanking crap from a database and slapping it in html.
I could go on. Or I could eat grass.
You know, with your resume, I can see why you wouldn’t like Java. Still, one can adapt until one’s kicked the bucket. And cute puppy.
Last comment on Java — last time I worked on systems at Harvard (MBA applications for business school), they were pure unadulterated Java, using Dynamoc as a app server, servlets, beans, and the whole bit. And that courseware app was the most overengineered thing I’d seen, though there were some bright, scary smart people involved in building it.
Just though I’d note that, this being a Harvard weblog and all…
Harvard: The ‘SUV’ of Higher Education?
Just a thought from a friendly MIT student.
I have my years working with web apps, but this last year has been a really fun one. I was hired to do a consulting job and I ended up building a new site. The problem the company that developed the old site, didn’t have a clue on how to do a thing. I’m collecting so many examples on how to do the wrong things and I pretend to use them as a learning tool.
The old site was built using Microsoft DNA, and it had a life expectancy of 5 years but it only lasted 1. We migrated everything to Java (MVC2), Tomcat and now we have a very clean site, deployment is unziping a file, no reboots, no registry, no ini touching. We are still using SQL Server but I’m advicing on moving to Oracle or DB2, because we are suffering of contention on the database (we already had to create a new model, witch we could migrate, because the old one was imposible to move because of bad design).
I’m a die hard fan of Java, but I believe that all tools are good as long as you know what you are doing (even microsoft tools).
PS. With this application we could in the future migrate to a UNIX based OS and this is a big plus for anyone
I have 8 years VB, asp, SQL Server experience, and 3 years Java. I’m also
a SCJP.
Java may be an SUV but if you are running a business would you rather have an SUV or a car? We are not talking about going to the
store to buy milk…we are talking about running a hopefully growing business. So what you are talking about is an SUV
that can run on a very affordable but powerful engine (Linux/AMD) which can later be upgraded to a monster truck (HP Superdome 128CPUs).
With .net on the other hand you are stuck with only growing to 32CPUs (Unisys ES7000 is currently the only >16 CPU box for Windows and that is not in my experience a trusted option.)
I don’t know many business’ that don’t plan on growing so the option to grow and the option to choose engines from various makers is very nice.
You only get those choices with the SUV. But I would agree, for small and medium sized business’ that don’t plan on growing too fast .net is a great choice…especially if you don’t have experienced developers or they are lazy.
And even though these are MIT students, which I think the world of, that doesn’t mean they know Java for business dev. That’s not what MIT is best at anyway.
I don’t understand why the students there can’t grok how to connect to a database using Java and SQL. My very first Java project (real world use, not a school project) was to use Java, servlets, an JDBC/ODBC bridge and an MS-SQL server to create a database for localization strings. The UI was HTML served up on an intranet. Myself and another software engineer (this was his first real exposure to OOP) completed this project in 45 calendar days. The company has been using it ever since (about 5 years). It has been refactored a bit since then, and it is a bit crude (I doubt it would scale up very well), but it works and more to the point, if I and my partner in crime can figure it out (neither of us have CS degrees, mine is a EE, his is an ME IIRC), then surely the Brainiacs at MIT should be able to figure it out.
I can’t be sure, but the problem sounds like inept instruction to me. If the instructor/professor/teacher can’t figure it out himself, then why throw the students into the deep end and watch them sink or swim? After reading this BLOG, I wouldn’t go to MIT for a CS/IT degree (or send my kids there) – sounds like I have better teachers on the job than I could ever get there.
Scripting languages are optimized for the web.Perl evolved from a shell scripting langauge to an entity suitable for both web apps and sys admin, whereas PHP evolved from web specific to an all purpose toolkit, matching Perl in many areas.
Maybe those that do comment should make the effort to read the book ‘Philip and Alex’s Guide to Web Publishing’ first.Strings are manipulated most of the time in web apps, as demonstrated by the TCL examples and pratical insights covered in this book.
This blog entry was spawned from practical classroom examples, where most projects are likely not to exceed 20 000 lines of code.
Using a scripting language, a great deal more of application specific logic ( read ‘excluding standard libraries provided with the language/environment chosen’ ) would most likely have been implemented after x lines of code, compared to a .NET / Java implementation.
Example to prove quicker time to market for non-enterprise web applications …
Using PHP 5 with the Smarty (http://smarty.php.net) template engine together with, say, Turck MMCache (http://www.turcksoft.com/en/e_mmc.htm) = MVC architecture, OO business logic, speed compareble to JSP and mod_perl topped off with extremely easy maintainability and extensibility.
HOWEVER, for enterprise, geographically distributed systems a .NET or Java implementation, coupled with experienced programmers, would be the best solution.
Why use Java to do something as simple as connect to a database and dump data onto a web page? It’s tremendous overkill – in fact, most programming languages are horrid complicated bloat-ware for something so simple (save for possibly Escapade, which does a beautiful, simple job of doing tasks such as these). But I guess people still believe that if it’s complicated, it must be sophisticated. Maybe so, but maintaining a PHP, Perl, or Java application for the next guy to come down the pike is a complete and utter nightmare.
1) A company that can’t tell the difference between a computer and a network might be forgiven for not knowing the difference between a programming language and an operating system.
2) Java is the programming language for people that shouldn’t be programming in the first place.
The comparision did not take into account of
the other factors like IDEs used.
.Net folks have the ease of Microsoft powerful
IDE with all the drag and drop feature .
The Java folks probably used the Java SDK with
text editors only. A fairer comparision would be with
students who are already familiar with Java based IDEs
like Weblogic Workshop or at least JBuilder
In short Java = Programming Language
Project duration involves other factors
like programming language tools.
The comparision did not take into account of
the other factors like IDEs used.
.Net folks have the ease of Microsoft powerful
IDE with all the drag and drop feature .
The Java folks probably used the Java SDK with
text editors only. A fairer comparision would be with
students who are already familiar with Java based IDEs
like Weblogic Workshop or at least JBuilder
In short Java = Programming Language
Project duration involves other factors
like programming language tools.
I agree with Vadim, too.
Your big complaint here is about a lousy implementation of J2EE/JDBC, and has nothing to do with Java itself.
If I judged a language by the first few lousy libraries I ran across, none of them would merit use.
Phil,
You just sound bitter. Grow up already.
-A
I could of told you the same thing 3 years ago. I maintain a site for a fairly lage SV company. The site is basically used for marketing an support purposes. Take a look ate just about every company website and you’ll see the same.
If we used java and had to go through the code write, test, rewrite cycle etc used to write applications, their widget for the launch in one month would showup sometime the next year. PHP and Perl are used a lot an work well, have few bugs and not so many suprises.
Face it most people are rearranging bits for the most part and are not trying to solve a system of differential equation on website or schedule an airline.
Can I teach at harvard now?)
Your logic is flawed. Let me try to summarize:
1)Given: A group of very bright, but nonetheless novice programming students had trouble doing a simple class project in java to display a database driven webpage using the jdbc api
2)Therfore java is a bloated, gas-guzzling, unwieldly programming language for all database use and should be avoided like the plague and will cost compaines $$$ if they are stupid enough to use it.
I would not conclude 2 as you have, but rather that the java jdbc api is ill suited to the purposes of instruction of novice students about database interaction using a programming language.
I really dont follow your logic from 1 to 2. *scratches head*
Ever code a large scale multi-year many person project in PHP? or Java? How’d these groups fair? This would be a more valid question to answer to leap to point 2. {even then I’d like to see more than a single data point}
Anyhow for real work you should look at castor for easy db to object mapping in java.
http://castor.exolab.org/
Perhaps it’s over kill for a simple class project [which as you mention is the impetus for you epiphany] however for larger software development effort, OQL is both simple and powerful. It abstracts the whole database garbage to a simple xml mapping file, queries can be performed on the fly with arbitrary arguments via OQL (even simpler than the scripting languages because your not tide directly to the DB)
Its pretty darn spiffy.
Cheers,
chris
Re: James Welcher
>Also, I would love to see a reference or citation or URL for any substiantion of the statement that
>Visual Basic “controlled all the machines that decoded the human genome”.
Philip may be many things, but accusing him of fabricating evidence is pretty serious….maybe he slightly exagerated, but only slightly.
I searched for a universally available citation, but honestly didn’t have the time to spend. So, I can do better. If you’re in cambridge sometime, drop by the MIT/Whitehead Genome Center and see for yourself(Philip has). It’s shockingly true, the majority of our robotic automation is -gasp- VB controlled! Though to be fair, VB is unused outside of automation.
Cheers,
john
For those students using J2EE that are having problems futzing with server setup and waiting for them to startup, check out Glider. It allows one to run and debug web and EJB apps simply, directly, and quickly like regular java apps.
(ObConflictOfInterest: I helped write it)
For those suffering the JSP/JavaScript/HTML pain for interactive web apps, check out ULC, a rich client API for J2EE development that lets you program web apps as easily as regular swing apps. Much *much* MUCH easier than doing the contortions of usual web development: the all machinery you used to need to make decent responsive, flexible apps just goes away.
(ObConflictOfInterest: I had nothing to do with it)
Sigh. That’s Glider and ULC.
I agree the Java platform currently (in its “standard” form) lacsk entry to mid-level ease-of-use that PHP and other scripting based platforms allow, and also .Net allows.
However, check out WebObjects (Apple’s Java SE based Web development and deployment environment). It blows away PHP and the others, and .Net, and Java2 EE for everything but high-end enterprise apps.
If it doesn’t blow your mind (particularly the DirectToWeb and DirectToJavaClient frameworks) then you’re probably dead already 🙂 It gets MVC right, persistence right, ease-of-use right etc.
Seriously, check it out (in fact, run don’t walk to get a copy). It enables development on Windows and MacOSX and deployment on any Java 1.3.1+ environment (pretty much).
Cheers,
Ashley.
PS I am not an Apple employee although I have done some WebObjects training for them and received educational grants (ie Macs to use in research etc).
Hi Phil, I’m a CS student from Buenos Aires — so my English is not good 🙁 — and a Java/J2EE programmer since 3 years now (before that I have worked with VB, ASP, PHP, C++ and Perl).
I think that the problem with Java (and may be with C# too) is that current tools are very oriented to procedural programming and RDBMS.
That is because RDBMS system are the core of the 99,9% of business applications, and because taking advantage of object oriented programming requires a big learning curve.
So if you are making a small site (like a web page with a shopping cart) the use of simple tools (like PHP) is more appropriate for the task, unless you are very experienced with Java, and MVC frameworks for the web.
The power of using OO tools comes to play when you need complex domain logic or a more robust (in terms of evolution) platform.
For example, in your blog you are talking about the problem of variable binding to SQL statements, this problem makes me think that you are missing the point in the use of OO technologies.
The way to go in OO systems, is to use some persistence mechanism, so you can think in the domain of the problem without all of these ugly database details.
The sad part of this is that current O/R mapping frameworks for Java sucks.
EJB’s CMP looks good, but problems with re-entrancy and inheritance doesn’t allow you to make rich domain driven design with entity beans 🙁 unless you use them as simple Row Data Gateways (see the EAP book of Martin Fowler), and the deployment is very difficult too.
Hibernate is nice for O/R mapping… but the transaction management is horrible (compared with EJBs).
In other hand C# “recordset oriented programming” is horrible too. And C# still doesn’t have good frameworks for enterprise applications (a year ago I was in a presentation in Microsoft Argentina, and they show us — I was working for a bank — a horrible framework called MBI -Microsoft Business Integrator- to compete in the bank services area, I don’t know the current state of this project… but J2EE is much more standardized and has more support from different vendors and open-source projects like JBoss)
The problem is that enterprises buy marketing, not good technology.
For example, if you want to take advantage of OO technology, the ideal is to use an OODB (like GemStone). Sadly Smalltalk it’s difficult to learn for a programmer with a heavy procedural background… (It’s incredible that ST that comes from the 80s still has cool things with no equivalent in Java or C#…)
I know no one is reading this anymore this far down on the page, but this blog entry really ruined my day … how incredibly self-centred are these MIT people??? If MIT students can’t deal with a programming language, the programming language must be at fault? Oh I want to cry. If this was Slashdot I would say YHBT but I’m afraid this is for real. Ironically, MIT seems to be the SUV of universities, expensive but utterly useless. This irony hurts even more. I will go and sob now.
not that this matters to your argument, but …
if you air down the tires (10-20psi), most vehicles (even 2WD) will navigate sand without much trouble.
Not directly relevant, but I’ll point out that the ‘?’ parameter problem occurs in both of the .NET Framework’s general database access command classes, System.Data.OleDb.OleDbCommand and System.Data.Odbc.OdbcCommand (Framework version 1.1).
@ named parameters are only available with SQL Server using the System.Data.SqlClient.SqlCommand class. If accessing Oracle with .NET Framework 1.1, you can use the System.Data.OracleClient.OracleCommand class and use the :NamedParameter syntax.
If the primary thing that is being taught in regard to web programming is hooking a DB up to a form then we’re in for a seriously dull future.
I am a 3rd year Comp. Sci. student. Having used Java almost exclusively throughout my degree, I must say I have found it a very impressive language, able to tackle complex algorithmic problems and medium-scale web-applications.
In second year two other students and I implemented a slightly cut-down version of the D3E (http://d3e.open.ac.uk/) using Java Server Pages coupled with JavaBeans, XSLT and an Oracle database. The actual implementation we found quite painless.
Next week I am about to launch into the implementation of another web-application for another assignment. We are using the Apache Struts architecture, which I conceed that is probably overkill for this project, but the learning curve was not that steep. I think that when coupled with a framework such as this, Java is a fantastic platform for larger-scale web-application development. It’s probably not as well suited to small-scale development, but then, that isn’t it’s intention. Once you have cleared the inital overhead of taking some time to *really* design the thing, implementation is a snap (in my limited experience).
I can’t understand why the students using Java would be struggling where the C#/.NET/ASP students aren’t.
It’s a fool’s quest to try to argue that one tool is, in general, any better than another. What the author *should* be teaching students is how each tool is best suited for specific problems. I think his position reflects nothing more than a lack of breadth in his experiences in software engineering.
I agree that Microsoft’s environment is easier to use. But having jumped into web development with JSP/Java more than two years ago, I believe it is the best tool for corporate enterprise applications. When I first began using JSP after starting web development in ASP, I hated JSP and thought ASP was much better. Now that I have some experience and have seen several J2EE applications go into production, I see the beauty of design patterns. Once the framework in in place, enhancements can be made and maintained by anyone who can follow a Rational Rose low level design model. JSP when used with Struts and a framework built with the MVC design pattern may take longer to build up front, but the maintenance cost down the road is lower.
And as others have commented, Java isn’t the solution for every problem. Every project’s target environment should be suited to that project’s complexity.
Phil,
For what it’s worth, most of my 23-odd years of programming has been in C, but I’ve also done C++, Perl, and, for the last three years Java. I’ve worked in both UNIX and Windows.
My own experience is that it’s significantly faster and easier to get things done in Java. The APIs are simpler than the MS libraries, the single-rooted class ontology and automatic garbage collection makes it easier than C++.
Also, the question mark issue you raise would also be an issue when using “embedded SQL” with C or C++; it’s not really a Java problem.
Cheers,
Bob
What is scary is the thought that MIT grad students
are struggling with a relatively simple concept of
using a JSP page to render database data.
Could there be something wrong with the driver(s) and
not the SUV?
Interesting. It’s a bit ironic that many of the pro-java rebuttals may provide the reason that many of his students using Java are struggling. Seems that they’re using the “wrong” library. They should be using library X or library Y instead of the “standard” library provided by Sun. So, with a limited amount of time, the first thing these students should do is evaluate several third party solutions and choose the “correct” one. Really.
But that answer is the major problem with Java solutions IMO. You need the knowledge of which solution to choose and then the knowledge of how to use it. That knowledge is only gained with real world experience. It’s reasonable for his students to use J2EE/JSP given their limited time frame and experience.
In contrast, the ASP.net solution is one stop shopping. It’s a reasonable solution with a fabulous IDE. And yes, that IDE does make it easier to build solutions quickly.
Aaron Brady wrote:
“The common problems that people associate with PHP are largely because many PHP programmers are less experienced (because the language has a low barrier to entry) than similar Java programmers.”
I agree with this 100%. Security, Performance, Maintainability are all problems because PHP simply allows poor coding.
He also said:
“Lots of things will cope with more than 50k concurrent users. Yahoo make extensive use of Perl, C, Python and their own custom Y! languages, and I hear things are going pretty good for those folks. ”
Yahoo abandoned the mish-mash of their custom languages and switched to PHP.
When SUN goes out of business, what will happen to Java? I am not trying to insinuate something, I truly want to know.
I recently started doing JSP projects and spend 90% of my time untangling server configuration issues (xml, classpath, package, .jar, .war, CATALINA_HOME etc.) and 10% of my time coding. Hopefully I can get this up to 20% soon.
Tim McGuire,
Twin Cities PHP Users group
You’re just a little bit off in your analogy: The Java language is a very nice car. Power everything, gets good mileage. Unfortunately, it’s hauling linked semi-trailers, which contain the libraries.
I like Java, but I don’t use it because of that configuration. Professionally I write lots of PL/SQL. At home I have Postgres and OpenACS for play. Everything of mine on the public Web is written in PHP or Perl, because that’s what the ISPs involved use.
All right, I think people, you are actually loosing focus here.
I
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
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
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.
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…
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
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
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
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
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.
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.
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.
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
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.
<sarcasm>I think the real crime here is that Lofi makes his students use NetBeans! Yikes! Now there’s the real crapper product.</sarcasm>
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.
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.
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
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!
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!
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
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 🙂
Love these web interfaces –
the comments window opens up and it is
too *small* yeah! love the web
its so sad
Mark
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.
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
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
What a waste of time for so many people.
Hey ya’ll,
After reading:
http://philip.greenspun.com/blog/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
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.
Phil are you talking thru your ass again
Are any of you familiar with Cocoon? If so, what are your thoughts within the context of the previous comments?
Regards,
RBP
Hey:). I hate Java, it sucks.
K
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
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. 🙂
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
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.
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
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.
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/
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.
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.
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.
Have a look at WebObjects from Apple. It
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!
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.
Java is great. and Ecmascript is even better.
the two together give us a good tool.
combining the flexibility of javascript with the reliability of java to build applications in a very modular way.
http://www.seppia.org/
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.
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.
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.
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”.