Phillip Greenspun: Java == SUV 974
lateralus writes "In his blog, Philip Greenspun re tells of his epiphany that Java is the SUV of programming languages. An interesting point brought forth in his typical extreme style."
"Being against torture ought to be sort of a multipartisan thing." -- Karl Lehenbauer, as amended by Jeff Daiell, a Libertarian
Agreed! (Score:3, Funny)
Re:Agreed! (Score:4, Funny)
not only that if you have to change direction quickly it will roll over and burst into flames
Tcl is good (Score:4, Informative)
The "problem", if there is one, with Tcl is that it is not fashionable. Instead, lots of people just use it to get their jobs done quickly without lots of chest thumping, willy waving, and enterprise enabling.
Re:Agreed! (Score:5, Insightful)
It's not a volvo XC, or auidi quatro. It couldn't possibly hang through a world cross rally with the subaru's and the big "P" dogs.
I'd call it something like an 4-runner with a stick shift. When you need it, it's there. But... wait a minute. Sun doesn't think linx is worth the disk space anymore... Why am I pushing Java? Perl! It's got to be PERL!
Thank linus for this cup of coffee...
Re:Look what it's competeing against. (Score:5, Informative)
Agreed.
Well...no. C is used for system development (i.e. hardware banging). Java cannot be used in that environment without direct support of the libraries and the JVM (or by JNI calls to libraries written in C/C++).
Well...no. C can be used anywhere that Java can be. On the server side, most servers (including web and proxy servers) are written in C. There's nothing stopping people from writing "app servers" in C...in fact there may even be a few of those too.
On the client side, "applets" are not a valid use of Java. Applets was a marketing ploy that grew wildly out of hand. Besides, there are ActiveX controls written in C/C++ that perform the same basic functionality of applets.
One thing that Java has over C/C++ is its cross-platform capabilities. With C, if you want cross-platform you have to work to code it that way. With Java, if you want to break cross-platform, you have to work to code it that way (use non-standard libs, use JNI, etc...)
Yes and no. Perl is slower to start up than a C/C++ native application of similar functionality. Java too is very slow to start up (usually *much* slower than Perl for very small scripts).
However, long running apps written in Perl and Java both perform very well when compared to similar C/C++. By long-running, I mean "long enough that the startup time becomes a wash". I've written web crawlers in Perl and Java that run for weeks at a time. Comparing their performance to existing crawlers written in C/C++, the performances are equivalent (though the Java and Perl bots suck up more memory).
Development time for those bots was significantly less in Java and Perl than for equivalent C-based bots. (BTW: the Perl bots were written back before LWP was stable/available)
Well...no. VB is stuck on one platform (well, two if you consider MS-Java...though VB.NET is NOT VB).
Don't forget XML. (Score:4, Insightful)
However, 1/2 million lines of C/CGI scripts written 7 years ago compile on Solaris, AIX, and Linux with only one person spending two-weeks porting code that is still run in production today. Because ANSI C is a mature standard it is far closer to "write once, run anywhere" than Java is if the authors of the C code know it needs to run on multiple platforms and stay within the ANSI C/ POSIX universe.
JAVA is the suv? (Score:4, Insightful)
Programming lesson 101 (Score:4, Insightful)
Re:Programming lesson 101 (Score:5, Interesting)
I am genuinely interested by the way...
Re:Programming lesson 101 (Score:5, Interesting)
1) It would prevent people from decompiling my code and just "seeing" exactly how the database is set up. Yes, you could still figure it out, but it would be less obvious.
2) More importantly, as things change, the queries could easily change with the system without having to go through and change every single instance in hard-coded strings.
There are easy and hard ways to make an automatic SQL generator: the easy way, as it most always does, would yield a larger, more obfuscated generator, while spending more time in design should yield a more optimized and quick generator. If you want source, hire me.
Re:Programming lehttp://developers.slashdosson 101 (Score:4, Insightful)
> those useless reports the bosses always want
> comparing apples to porcupines. Most database apps
> I've seen use pretty simple queries;
> it keeps your memory overhead down, and makes your
> app run more smoothly.
A few thoughts:
1. If you think reports are useless, then you probably put tape over the guages on the dashboard of your car as well. I can't help you there.
2. And you deliver customer portal, don't you want to show info about sales they've made in the past, credits they've accumulated, savings they've made via your 'preferred customer program', etc? if not, then you're behind the curve on portal design. if you do - are you going to send them a separate application? Or are you going to run some of these queries from your portal. Hint: pick the last option.
3. Most database apps only do simple queries. You're right. That's because the average developer wants to keep the job simple, can only write basic SQL, and doesn't have experience with usability.
4. Yep, it can take more memory. Then again, memory's cheap.
> If you're using multiple outer joins for
> anything other than reports, your schema's
> probably screwy.
5. The schema shouldn't be limited by your inability to code multiple outer joins or deal with optional data.
6. See #2 above. The concept of a 'report' being something that somehow is done in other applications is antiquated. Transactional apps have a choice: deliver only transactional views of the data - and force the user to guess what the heck's going on or go to another app, or encompass some basic reporting in the transactional app.
> All that stuffs fine if you're working for the
> government, and they can buy you a billion
> dollars worth of hardware,
> but if you're putting together an app for
> accounting and inventory control for a
> relatively small company, and you're
> using those types of queries, you're going to
> make their hardware scream for mercy, and them
> very unhappy with the speed of your fancy new
> app.
Don't know where to start, but here's a try:
1. Use a real database
2. Tune it right
3. Put it on reasonable hardware
4. Identify the performance needs (based on usability objectives) for each step in each use case. Some queries will have to be lightning-fast, others won't. Learn the difference.
5. Redundancy in the database is your friend, just got to manage it right. It will allow you to take queries you would have thought would be very slow, and run them at blazing speeds. This is also best-practice.
I do this all the time and it always results in fast applications that users *love*. There's no need to limit your use of the database to trivial queries unless you're just prototyping, aren't being paid enough to finish the work, or are using ISAM files.
Re:Programming lesson 101 (Score:5, Insightful)
Re:Programming lesson 101 (Score:3, Informative)
Daniel
Re:Programming lesson 101 (Score:5, Interesting)
Well, I worked at a project with no hardcoded SQL. It was a bitch. It happened because the client would NOT provide ODBC link to the DB. Therefore, we needed a middle server that got "request for X service with Y parameters", looked up in it's own service table what query that was, made it to the DB server, and returned the results in XML.
The biggest drawback is the fact that the queries are stored in varchar fields in a table. All the queries used by the system (a nationwide chain of gas station managers). So, when you where inserting or modifying a service, you where doing things like "insert into services values ... 'select blah from blah where blah=''... " and you had to start escaping characters like mad. And a missescaped quote would leave LIVE SQL in the SQL command... I saw a case where somebody had a bad escaped ", so the "where" clause was included into the string... he wiped out ALL the functions :o
Re:Programming lesson 101 (Score:5, Insightful)
SQL is a much higher-level language than C or Java or even Perl. This is why people who talk about 'database abstraction' are usually missing the point. SQL is an abstraction, and a much more expressive one than some object-based mapping full of get_x() and set_x(). But unlike many high-level languages, the extra abstraction of SQL gives you _better_ performance by letting the database optimize your queries for you.
Re:Because, prudence (Score:4, Insightful)
One point - the 'nonportable SQL verbs' you mention can in some cases be the only way to tweak the best performance out of an RDBMS. Using a nonstandard extension to SQL is not a decision to be taken lightly, but it's good to at least have the option.
Re:Programming lesson 101 (Score:4, Informative)
Well you could,
- Use Java Entity Beans with Container Managed Persistance.
- Use JDO
- Use TopLink
All of the O/R mapping tools automatically generate the SQL queries for you based on your Database Schema. No SQL necessary, hardcoded or otherwise.
Re:Programming lesson 101 (Score:5, Insightful)
Re:Programming lesson 101 (Score:5, Informative)
Yes it is true that you can easily decompile .class files to get back almost the exact source code (without comments). However it is also true that there are code obfuscators that do a really good job of making it damn near impossible for someone to figure out how the code works. Imagine if you overloaded your methods and classes as much as possible such that 70% of your class names were 'A'. i.e.
setName(String) becomes a(String)
setAge(int) becomes a(int)
getName() becomes a() and
getAge() becomes b()
It makes it darn tough to figure out what the code does. And you don't have to write the code in this obfuscated manner, you write it using good code practices and the run the obfuscator on the compiled .class files. The output of that obfuscator is a set of obfuscated code and a mapping file so if you get debug messages like:
NullPointerException in A.c(int) line 147
then your mapping file will tell you that "A" was actually your class name "Client" and c(int) is actually "stZipCode(int)". Now you can still debug a customer's error without giving away anything about the code structure to the customer.
However, the place where Java has been excelling (and where I've made my living for the past 5 of my 15 years in software) is in major web applications where the user doesn't have any access to your compiled code. The combination of Java servlets, talking to Enterprise Java Beans or to a database via JDBC and then outputing the html using Java Server Pages is now pretty much the default way of writing a huge data-centric web site. Pretty much all major banks do their on-line banking web sites this way (this is my area of expertise). This is the technology behind Amazon.com and (I believe) Barnes & Nobel.com as well. If you use Quicken or MS Money to do your bill payments and check your financial statements you're either connecting to CheckFree (Java Based) or to an EEI server (Java based) to transfer all that financial info.
So is Java fat, bloated and wastefull? Well, how fast is your on-line banking? How fast is Amazon? How fast does your Quicken software work? You'll wait far more because of lag in your web connection than with any kind of slowness with Java.
So what we have here is some academic geek with a web site on the Harvard Law server telling those of us who actually pay our mortgages writing Java software that we don't know what we're doing. Well, that's fine. When I'm done paying off my house 15 years early (as well as all my car, student loan and credit card payments) and I'm retired debt free at age 50 I'll try not to be too upset that Phil Greenspan's angry little blog said I did it by using the wrong tool.
Re:JAVA is the suv? (Score:4, Funny)
Re:JAVA is the suv? (Score:4, Insightful)
With all respect, that's crap. Java is the _managers'_ programming language of choice. It enforces a particular style of programming (right down to naming convontions), it takes a specific programming 'paradigm' (OO) to an unnecessary extreme and it's chock full of trendy buzzwords and BiCapitalised MumboJumbo. Perfect for PHBs.
JAVA may be slightly slower than other languages,
Says the Iraqi Information Minister.The fact is that, thanks to it's use of garbage collection and because it stores non-primitives on the heap, Java will always be _significantly_ slower than C/C++, no matter whose JIT you are using.
This article explains it well. [jelovic.com]
Re:JAVA is the suv? (Score:5, Interesting)
I've written software in C that has been ported with little effort from one hardware platform to another with less effort than I have seen of many Java applications. I might suggest C is the language of choice for programmers.
Re:JAVA is the suv? (Score:4, Interesting)
I know with Java I can write an application with DB connectivity and a GUI and have it run on AIX, Windows, and Linux. Without having to change a line of code.
Now I know it's possible to do this with C (Actually, is it? Is GTK available on AIX? Is GTK any less horrible on Windows than it used to be), but it'd take much more time, and I'd end up with all sorts of conditional code based on OS.
I might suggest Java is the language of choice for programmers who have jobs to do, need to write tight code, and don't have all the time in the world.
Re:JAVA is the suv? (Score:5, Informative)
I've got to agree with this. Reading Greenspun's blog I was left pondering how to start responding to something so completely wrong.
The article implies a lack of understanding of the JSP paradigm. Sure, binding variables to a relational database is tough. So if you insist on doing that, use JSP tags. But that's not the point of Java -- you should be access instance methods from a JSP page, and those instances can access any data source they choose.
VB and ASP are intended for developing front-ends to primarily relational data, so they make it pretty easy to accomplish. The fact that they make it easy doesn't mean that you can use the same design and technique to deliver a scalable, maintainable web site. All the current theory says take the pain up front and put in a decent template system, and never put code in your page.
"People who are serious about getting the job done on time and under budget" will get the requirements first, and not making sweeping bullshit generalisations. There is a huge problem in the industry at the moment with IS departments trying to coalesce the functionality of dozens of specific-purpose VB applications into one enterprise system. The size of the project, requirement for scalability, expected lifetime and regularity of changes, systems integration issues, cost, stability, customer technology preference and other technical and non-technical issues will all influence the choice of a development environment.
Re:JAVA is the suv? (Score:5, Insightful)
Re:JAVA is the suv? (Score:3, Insightful)
Has anyone ever considered where you might cut costs in one place you might end up losing those gains in another? Like robbing Peter to pay Paul sort of thing.
Yes I've heard It makes for a rapid devel environment from many a developer/programmer as it facilitates ease of coordination efforts etc. The last company I worked for decided to become a fully accreditted registrar a few years back just in time for the release of the
Re:JAVA is the suv? (Score:3, Insightful)
Re:JAVA is the suv? (Score:5, Informative)
Re:JAVA is the suv? (Score:5, Funny)
Plus imho Tomcat is a pain in the ass to configure, and you gotta keep javac'ing, and so on. Just give me a language where I can throw in a little bit of code in the middle of a webpage, in the regular web directory, and be done with it.
Boy, what da HELL you talkin 'bout? Looky heah:
Now, what so hard 'bout dat? Looks like code t'me! Looks like it's in the middle of a page! Hit it, load it, be done with it. Need t'change a value? Change it, save it, reload it. You all needs t'pull yo cranium outta yo backside, mmmhmm.
"Gotta keep javac'ing." I declare, that's the DUMBEST thing I done heard all day.
Re:JAVA is the suv? (Score:3, Insightful)
For a big, enterprise-class db-driven web application, though, J2EE is a treat (there's a reason why it's called Java 2 Enterprise Edition).
Daniel
Re:Wahhh !!! (Score:3, Informative)
Java has not usually been "interpreted" for years. And in its JIT compilation, it can use optimizations based on data available only at runtime, which could in some cases make it faster than precompiled C code. Admittedly, that's rare and most of the time Java is slower.
so I guess that would make C# the.... (Score:4, Funny)
Finally (Score:4, Interesting)
Re:Finally (Score:4, Funny)
It's cross-platform feature has been tainted by the agenda of the forces that dominate the respective operating system (BeOS, Windows, OS/2, Mac OS, and AIX). That is a pity since Sun had done such a phenomenal job in releasing the first public Java release back in 1985 which at the time would run on Commodore 128 and my Amstrad PC. About a year later they released a IBM PC version but unfortunately it required 256k of memory which made it dificult to deploy at the time.
Re:Finally (Score:5, Informative)
It's cross-platform feature has been tainted by the agenda of the forces that dominate the respective operating system
I am currently employed on a project with roughly one megaLOC of Java. It has a Swing GUI, EJB middle tier, and Oracle at the back. It currently runs on Windows, several flavors of Linux, and Solaris, without recompile. I do the production builds on a Linux machine and we distribute them to roughly 2000 Windows and a few dozen Linux workstations. Likewise I do the production middle tier on Linux and deploy to Solaris, and the development and testing versions of the middle tier go to Windows, Linux, and Solaris.
Would it fit on a wristwatch? No, it's too big. Would it run on BeOS or Mac? You betcha.
Re:Finally (Score:5, Insightful)
It's all about horses for courses.
There is an "overhead" in Java, because it's not designed for quick-n-dirty deployment of something trivial. Getting the whole J2EE thing together to deliver a mail form is obviously going to take you 5 times longer in Java than it will in, say, perl or PHP.
But that's obvious, isn't it?
Re:Finally (Score:5, Insightful)
Re:Finally (Score:5, Insightful)
Now, I use Java on my prime contract (large contract for the SEC) and it's a blessing...interoperable over both our platforms (Solaris/NT), works great with the CORBA base we have, we can patch stuff in easily and bounce our processes to reload individual components, etc.
Java was never meant to be used as a scripting language...it got adapted as such because of the Java zealots. It was designed to be a high level, cross platform, portable language. Any other application of it is as silly as putting Linux on your toaster...sure you could do it, but it's not the most efficient solution.
--trb
Re:Finally (Score:5, Interesting)
However, I currently am working to migrate our PHP web application to Java and it is going well. I am using Servlets + FreeMarker templates. Using a template system allows me to change some of the presentation details without recompiling and Servlets prevent me from killing myself because of the giant nasty hack that is JSP...
Yes, I might seem bitter but I can see no real reason to use JSP. The only argument I can get from anyone on for it is "You don't have to recompile and deploy it". That was a good point before application servers accepted changes on the fly to the code. Now I just recompile the one servlet and Tomcat reloads it. Simple...
JSP is OK (Score:4, Insightful)
It has one advantage (I tried freemarker etc too), which purists might find a disadvantage: sometimes you can "sin" and use a tiny little bit of Java code on your JSP. Also most template engines have some built in logic for if/else or some even have some simple loop structures. Why learn yet another language (even if simple) when you can also use Java. Just restrict yourself and confine your JSP-java to the simplest possible use. It works well and is a practicle solution, while still giving a clean MVC structrure (which template engines try to force on you).
Re:JSP is OK (Score:3, Interesting)
Re:Finally (Score:3)
I choose what objects to expose to the template engine, and the template engine then merges the objects with the template. For example, when a user logs in, an object is created that contains personal preferences like font size, colors, what content they want on their front page. Lets call this object "blah" though I can expose it to the template using any name I want. In the template, if I want to get information
Re:Finally (Score:3, Insightful)
Secondly, if you are building large web applications with a scripting language then you are not doing it right. I do not believe you came up to an overhead problem in Java and not PHP. Java outperforms PHP, period.
Actually I think you are talking bullshit.
Re:Finally (Score:5, Insightful)
A prototype is something quick and dirty that just has to look right. Unfortunately, many people mistake it for the real thing. They claim to have written the program when they barely have a prototype.
Sure, it sorta works now, but it's piss-poorly documented and a nightmare to maintain. It's also already bursting at the seams, so when (not if) the requirements grow any larger, it'll be a flipping disaster. As the monster grows, it quickly becomes far more expensive to change anything in that spaghetti code mixture of logic, presentation and hard-coded values, than it would be to throw it all out the window and start again.
I've had the mis-fortune of having to maintain a project which had been thrown together by unskilled monkeys in PHP. Guess what? It was a fscking disaster.
One problem was precisely PHP's weak typing. Sure, it's neat if all you've ever made are small simple sites, but past a point it becomes a liability.
After having went through several maintenance and change cycles, obviously the programmers of that application had obviously lost track of when something is supposed to be a string and when it's supposed to be a value. The fact that in PHP if (x == 0) is true when x is "", or for that matter when X equals "OTHER", didn't help either.
In a strongly typed language, this just means gracefully getting a compile error, which is solved in 1 minute. In PHP it was just that the program sometimes mysteriously malfunctioned, even though most of the time it worked right. What would have been a few minutes of debugging in Java, was several days of debugging in PHP, on top of the cost of corrupted production data.
And that was only one of the many problems that that large application had. (A second one was the exact same mistake in reverse: if (x == "") is true when x = 0.)
Basically every single attempt they had made at reusing code was littered with this kind of mistakes. It was like it was the poster program for Murphy's Law: If it was possible to pass the wrong data type in a parameter, somewhere they had actually done so. And that weak typing just let them shoot themselves in the foot without any warning.
So you know what? I'm sick and tired of these blogging monkeys, making judgements they're simply not qualified to make. Just because any unskilled burger-flipper could quickly throw together a 3 page site in PHP, doesn't mean they have _any_ clue how to make a complex enterprise system, that can also be maintained and extended later.
Penis extension? (Score:4, Funny)
Nobody ever started using Java because they wanted to compensate for a small penis, which is the only possible reason for buying an Hummer.
Missed points (Score:3, Interesting)
The point is that most programmers use Java because of its premise of programmatic power. While the metaphor may not stretch to every use of Java, Greenspun talks particularly about WebApps in general, and JSPs in particular. His only point was that while Java *is* powerful, for a low or mid-end Web application system, most of the engineering has to do with designing the database correctly, and integrating everything tightly. Perl and PHP a
Complex programming (Score:4, Insightful)
At any rate, from the article: "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)."
This is all fine and good, but the machines that "decoded" the human genome were performing a simple task really and did not require much in the way of alternative paths or any complex programming. For simple tasks or projects, yes VB is pretty handy. For other tasks, or requirements that may need a bit more complex programming, VB will not cut it.
Whatever dude. (Score:5, Insightful)
This guys is a troll. With all my respect, he doesn't bring any actual arguments with the exception of how difficult binding variables is. Should I also add that he's looking only in a matter of web based project's depending on a SQL-type DB????
Oh and last:
take twice as long, and be harder to maintain than a project done in a scripting language such as PHP or Perl..
Java has never been intended to substitute scripting languages. Of course a project done with PHP and/or Perl will go much faster!!! Both are able to execute almost eveyrthing you throw at them, but you may say exactly the same thing about C++ and PHP/Perl and it will be evenly unfair.
PS: And this said from a C++ zealot;oP
Re:Whatever dude. (Score:5, Insightful)
And you can't say the same thing about C++ because, at least last time I checked, there weren't very many web pages being written in C++.
Re:Whatever dude. (Score:3, Insightful)
That's the thing... most people who develop dynamic websites are developing rather simple applications that are fine for scripting languages such as Perl or PHP.
That really doesn't mean that Java doesn't have it's place as a Web/HTML/XML language. When you start to develop Enterprise level webapps you'll soon start finding yourself with a bunch of spaghetti code to ma
Phil Greenspun is not anti-Java (Score:3, Interesting)
"You should learn Java. I predict that it will gradually supplant C over the next ten years. Java is going to be big. You heard it here first."
In this particular post, he is not saying that Java is not ever useful or practical. He merely states that people who develop in Java are often using a tool that is not especially suited to the task -- that it's not always the right tool for the job. This is exactly li
Phil's not a troll (Score:4, Funny)
Someone at Harvard wanted to load test their server configuration, so they turned to Phil and said "can you post some flame bait and then get it posted to Slashdot for us?"
So you see he's not a troll, just a resourceful engineer
Jeep is better than SUV (Score:3, Funny)
Re:Jeep is better than SUV (Score:5, Funny)
Java's not an SUV! (Score:5, Funny)
Like a SUV huh? (Score:5, Funny)
Weave's rushed tongue-in-cheek SUV vs JAVA comparison:
Java's Cover (Score:5, Interesting)
Paul Graham [paulgraham.com] (of Bayesian filtering [paulgraham.com] and Lisp [paulgraham.com] fame) wrote an excellent article called Java's Cover. [paulgraham.com]
It is about why he thinks Java is bad technology -- despite never having used the language. Very interesting read.
Thomas
Re:Java's Cover (Score:5, Interesting)
1) It's bad because it's energetically hyped. Unlike Lisp, where no one uses it because everyone is too busy posting on comp.lang.lisp about how wondeful a language it is?
2) It's aimed low. Gosling has already called bullshit [java.net] on this argument.
3) It has ulterior motives. So what?
4) No one loves it? Well, those of us who used to use C++ appreciate it a hell of a lot.
5) People are forced to use it. Wrong. Countless companies choose it because it is an appropriate technology.
6) It has too many cooks. I find this a huge advantage to Java. It means their API's very well thought out. It's why Java is nicely internationalizable, for one.
7) It's bureaucratic. Their API's are no more verbose than many languages. Any "bureacracy" that exists is to promote flexibilty.
8) It's pseudo-hip. Like quoting Paul Graham.
9) It's designed for large organizations. True, because large organizations have to do somethign more complicated then the typical perl script can handle. His arguments here are debunked by Gosling in my previous link.
10) The wrong people like it. That is, Paul Graham's friends don't like it, people Paul Graham doesn't know like it! What an argument!
11) Its daddy is in a pinch. I fail to see how this is relevant.
12) The DoD likes it. The DoD also likes the internet, they were one of the first government agencies to really take to it. Does that say something bad about the internet now?
Comparing Java to Lisp or (ugh) Perl is a joke. Well, I think perl is very ugly and counter-intuitive, so let's take Python as an example. If I were to make a simple website, i'd use Python instead of Java. If I were to do a hacker type of activity, something that may not be around 3 years from now, I'd use Python. Or even Lisp if it was something just for me. They'd be wise choices. However, for an enterprise app? Java is an excellent choice.
Re:Java's Cover (Score:3, Troll)
In fact, strong typing is stupid. If you want to treat a byte as a char in one statement and as a bit vector in the next you shouldn't have to beg the computer to let you do exactly what it does on its own. (Study the bit structure of ASCII sometime, and you'll understand.)
Nah... (Score:3, Funny)
http://www.cliki.net/Database
I personally use Pg most of the time now, but I used to use CommonSQL (that comes with Lispworks), on which UncommonSQL is based. That really makes database access dead easy in Lisp.
Thank You (Score:4, Funny)
Sun really beat M$ in THAT game. If you want to do anything in Java you need a hundred classes, calling a million methods and passing them several times.
PHP and ASP are much more simple.
Java joined the complexity of the Windows API with the speed of an interpreted language, along with some bitches as strong-typing, millions of similar classes.
PHP
cut(bread)
ASP
bread.cut();
Java
knifeh = new KnifeHandle
knifeb = new KnifeBlade
k = new Knife
k.Attach(knifeh)
k.Attach(knifeb)
_try()
{ bread(k.cut)
}
catch (Outch)
{
dial.dialnumber(911);
}
Re:Thank You (Score:5, Insightful)
ASP would randomly write some data into weird places, and put up a pretty page telling the world that it had a problem...
PHP would just return a plain, white page saying, "PHP: Warning: could not un-recut in
and Java would call 911 for you.
Right tool, right job. If you don't need complete production stability for a moderate webapp with a short lifetime, by all means use PHP. For a production control system, I'd pick Java.
-Richard
No, Thank You! (Score:3, Funny)
Harvard: The 'SUV' of Higher Education? (Score:5, Funny)
Ummm... RTFA? (Score:5, Insightful)
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.
Phillip Greenspun (Score:5, Funny)
Re:Phillip Greenspun (Score:4, Funny)
Clearly your anagram generation routine is broken. Here's one:
Phillip Greenspun = Gel slipper, hip nun
or
Phillip Greenspun = grep hep ills, unpin!
Obligatory: ... then C++... (Score:5, Interesting)
True story: I was working for a startup in 1992 that needed to get a product to market in record time with minimal resources. The product was not a piece of software, but a simple Windows utility was needed to control it.
The utility was not very large and manipulated only very small amounts of data, but it needed to be easy to use, reliable, and look and feel like a good "commercial-quality" Windows application. The total number of hoped-for installations was to be in the low two digits.
I chose VB as the development system, which at that time was almost brand-new, to implement the software. I got it done in time--about nine months. It was a beautiful candidate for rapid application development. During the development, we added many features and change the UI many times in response to user testing and management requests.
It worked well. I am not aware of any problems with it, with respect to performance or UI, other than a rather slow startup time (about 30 seconds on the hardware of the day--which was an 80386SX running at, IIRC, 33 MHz).
I left the company, the company was bought by a new set of VC's, they hired a new software developer (who was absolutely first-rate).
The VC's insisted that the software be rewritten in C++.
There's no real punchline, because after two years of work the new developer succeeded in converting the program, and adding some new features (relating to minor changes in hardware capabilities). Neither I, nor the programmer, nor anyone at the company was aware of any real gains from the recoding, other than the ego satisfaction of knowing that they were using a "professional" programming language.
In my next few job searches, the hiring manager looking at the part of the resume where I described this work experience skipped over the "successfully completed on time" part and focussed on the "Visual Basic" part. It seemed as if the appearance of VB on a resume practically erased all my experience with other languages.
Of course, PERL and friends, being associated with the academic and UNIX communities, don't have quite the same aroma to them.
Nevertheless, I was very struck with the amount of damage to one's career that one can do by doing topnotch work, but using the "wrong" programming language in which to do it.
Re:Obligatory: ... then C++... (Score:5, Insightful)
True, but Perl is hardly the Unix analogue to Visual Basic. Visual Basic is very easy to learn and use, so "VB Jedi" doesn't have much weight. VB exists to make complete applications rapidly. On the other hand, Perl's strength is in text processing.
A function to reverse the order of the words in a sentence is a single line of Perl, but could be a hundred lines of C or VB.
A program to display a form with two text boxes, and display the sum of the numbers in those two boxes, would take seconds to write in VB, but hours in Perl or C.
A program to perform a numerical simulation would take about the same time to write in all three, but the Perl script would run considerably slower than the C or VB program.
I do believe Borland Delphi has a considerable edge over Visual Basic. No runtime libraries, and the language (Object Pascal) is as featureful as C++. To remain topical, I don't think there's any reason to ever use Java, save programmer-masochism.
Choose your tools wisely.
Godling's Glossary for Java (Score:3)
Java, n.
The Philosopher's Stone of the alchemists, the Second Coming of Christ, the Maltese Falcon, and the fourth Star Wars movie, all rolled into one. A technology for developing programs that will run on any platform, and crash in a different way on all of them. A mighty acorn that grew from a tiny Oak. An idea whose time has come, leaving General Magic to sleep on the wet spot.
-Godling's Glossary
i'm sorry but.. (Score:3, Informative)
but they should be able to do them in all three of the choices they had, or was the course subtitled: "gaining profiency in one of 3 systems for doing one kind of a web project"?
and jsp is simpler than j2ee? jsp is part of j2ee, heres a clip from somewhere
***"What Is JSP?
JavaServer Pages (JSP) is a Sun Microsystems specification for combining Java with HTML to provide dynamic content for Web pages. When you create dynamic content, JSPs are more convenient to write than HTTP servlets because they allow you to embed Java code directly into your HTML pages, in contrast with HTTP servlets, in which you embed HTML inside Java code. JSP is part of the Java 2 Enterprise Edition (J2EE).
JSP enables you to separate the dynamic content of a Web page from its presentation. It caters to two different types of developers: HTML developers, who are responsible for the graphical design of the page, and Java developers, who handle the development of software to create the dynamic content.
Because JSP is part of the J2EE standard, you can deploy JSPs on a variety of platforms, including WebLogic Server. In addition, third-party vendors and application developers can provide JavaBean components and define custom JSP tags that can be referenced from a JSP page to provide dynamic content.
"***
and are we a little generic here (from greenspun)**A project done in Java will cost 5 times as much, take twice as long, and be harder to maintain than a project done in a scripting language such as PHP or Perl. People who are serious about getting the job done on time and under budget will use tools such as Visual Basic (controlled all the machines that decoded the human genome).**
that's nice, what kind of a 'project' is this project in this? the whole point in using java in projects like this is that you can reuse the code in other parts straight(heck, make a game for a java phone, then use the _same_ compiled classes on the server to determine if the uploaded scores are legit that you use for game engine on the j2me device). sure there's other points as well, like not tying yourself to microsoft(though, that is a point for php as well).
and really, people who use visual basic for big projects don't except to live long.. or be taken seriously on slashdot. surely you can do it seemingly cheaper when anyone can do it(but if mit produces people who aren't able to learn any language that suits the job best in reasonable time i've kinda lost my respect for them).
Modern PCs are more like SUVs (Score:3, Insightful)
If the auto market were like the PC market, though, then you wouldn't be able to buy anything except a SUV.
Wow (Score:3, Insightful)
Wow! You're right! I guess because Java has a minor annoyance that supposed to be fixed in the next release of that specific API, that the whole language and libraries are worthless and we should all go back to C for everything! How brilliant! I will never trust Sun again when they say "Java is a revolutionary new language whose main feature is that you do not have to set variables in PreparedStatements by ordinal value! We are basing our whole language on this!" Big fat liars.
I think everyone is missing the point... (Score:5, Insightful)
Java is like Windows XP, can anybody say bloatware (Score:5, Insightful)
Server cross platform apps
Server cross platform apps
Server cross platform apps
Its slow as fuck (all that crap about JIT optimization looks good on paper, but its CRAP), bloatware, and just generally unfriendly to use. Java is one of those, looks good on paper, but fails in implementation. One nice thing to say about it is that it is a very clean programming language, very nice to code in (I'm forgetting about the explicit exception handeling of course).
PHP on the other hand knows its job, and it does it exceptionally well, and if you don't like it you can always extend it.
Nuf said, php for web stuff, java for server apps.
JSP type 1 applications (Score:5, Informative)
You will typically
I tend to agree with his problems with JDBC being quite cumbersome to use. This is why one will typically use data access Java beans which encapsulate data access. Also there are several object-relational mapping frameworks (e.g. CastorJDO) which will even isolate you from SQL and database details completely.
I would even tend to agree with him on terms of how quickly one can hack some web application. One will be faster with a scripting language like PHP, but when it comes to extending/maintaining a JSP type 2/3 application will win.
My language comparison (Score:4, Funny)
Discredited (Score:5, Insightful)
"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). "
He suggests that Visual Basic is better than Java. I will refrain from comment, the quote speaks for itself.
Re:Discredited (Score:5, Insightful)
That fact is unasailable. It will run faster, and can be written in a fraction of the time by a VB developer who has a clue at all.
Re:Discredited (Score:3, Interesting)
Faster? Maybe against Java running on windows, under IIS. Faster to code? Could be. Point and Drool is hard to beat...for time.
Re:Discredited (Score:3, Funny)
Rootbeer's Corollary to Godwin's Law:
On Slashdot, the terms "Visual Basic" and "Hitler" shall be interchangeable.
Warning: Knucklehead (Score:3, Insightful)
Plenty of legitimate criticisms can be formulated against Java, JSP and JDBC, but I think we can safely ignore what this guy has to say about it.
business computing with Lisp (Score:3, Informative)
Who do you think keeps Franz [franz.com] and Digitool [digitool.com] in business? Hobbyists? I don't think so; they'd be using one of the free implementations. [lisp.org] Your "no one in business computing considers using Lisp" comment shows you don't know what you're talking about.
I myself use Scheme [schemers.org] in my employment, and it's helped a lot.
Re:Warning: Knucklehead (Score:5, Informative)
AMD also uses GNU Common Lisp and ACL2 internally, though they can't reveal any specifics - this is of course the problem with a language that's suited well for the research and development part of the product phase. Who wants to give away what they're doing just to advertise that they're using Lisp?
Of course, if you wanted pretty pictures and "yet another database web interface", try the Stargreen site [stargreen.com]. But you won't find a lot of people using Lisp on those, for the simple reason that most of that work is cut and paste from a previous project.
Ummm??? (Score:3, Funny)
Maybe Java.equals (SUV).
Java includes all the libraries/C/C++ use Unixs (Score:4, Insightful)
C also have a large library that is provided by the OS that you #include. C++ has the STL and some other libraries
I believe thats why java feel awkward to a lot of programmers not familiar with its class libraries who want to use c system calls or shell calls to get the job done. The java folks created this because cross platform compatability is hard without this.
However the argument that java is significantly slower than c is pretty much moot. For test and XML processing its almost right there, and significantly easier to write code. All the extra data structures and types allow coders to use more efficent structures easily, usually resulting in faster code. (Similar to the way Perl coders can write blindly fast code easily using the built in Hash functions)
I'm not saying Java is better than everything else, just use the right tool for the job your doing.
I used to think Greenspun was a pompous ass (Score:5, Insightful)
To the contrary, it seems that it was -I- who was wrong by way of arrogance and hubris. I'd developed dozens of web apps, I'd been on teams designing and developing enterprise, corporate and consumer apps - I thought he was just full of it. What'd he know?
But as I started working with junior developers more, planning and managing projects more, rewriting inherited projects years after designing their previous incarnations - I started to see an eerie parallel to what the man had said.
Even if you still think yourself the ultimate programmer, incapable of mistake or misstep, impervious to making a bad design the first time through a problem - there still comes a time in which you work with developers less talented than yourself, developers less experienced than yourself. Therein you will painfully learn the wisdom of what tools, truisms, and technologies actually -help- make successful projects, and which just hinder.
I still find him to be an arrogant, pompous, ass; but what wise-ass hacker isn't? It's our calling card.
Background (Score:4, Interesting)
The rewrite of the system in Java, based on using database abstractions and (would you believe) HTML abstractions was a complete crock [membled.com] and ended up being not only slower than the Tcl/SQL version, but less maintainable and much more buggy. I think they got something out of it in the end, after dropping 90% of the extra complexity and object-oriented-itis, but there's no way Java plus an object-relational mapping layer was the right implementation language.
OpenACS and Java [openacs.org] makes a similar argument to philg's, but more coherently and less trollishly. I agree with his essential points however. And what he writes is based on experience, both with managing a web development company and with teaching students.
Java has issues, but not the ones mentioned here (Score:5, Insightful)
That said, Java has terrific benefits and some deadly flaws. JSPs, for one, are a mess. Embedding code for even such simple tasks as displaying dynamic fields is error-prone and difficult to maintain. Add to that the fact that so many JSP developers leave reams of business code in the JSPs themselves, and the hackish nature of JSP comes to light. This is not, however, a simple Java problem, and it plagues any similar templating languages. I have seen some ASP pages that were phenomenally large. Bad practice is bad practice, irregardless of where it occurs.
Java also suffers, as many know, from serious memory issues. In the rush to provide a single language platform for applications across all aspects of software engineering, Java tries to do too much in too many places. Java can be embedded inside phones for small Internet clients and video games, or loaded onto the largest servers for massive Java-based enterprise integration applications. It does both of those things exceedingly well, providing powerful abstractions at both micro and macro levels. The grey area in the middle is where most people stumble. Drawing the line between "enterprise" and "standard" code libraries is very difficult, and many "enterprise" features remain in the "standard" version of Java, adding to the bloat. What's worse, only within the last couple years has the question of memory consumption begun to be addressed in earnest by Sun engineers. There are many lights ahead, however, be it the improved base memory handling in Java 1.5, or the eventual integration of Apple's VM-sharing innovations into the Sun Java proper.
Java being staticly type has other problematic side-effects; namely, as data and systems outside an application change or as the application as a whole needs to grow and adapt to new requirements, single small changes in a few classes can explode into massive alterations throughout the system. Again, much of this can be mitigated with rigid adherence to preferred OO practices. If those practices are not enough, there are a number of freely-available APIs and libraries to allow for more dynamicity and looser coupling between tiers, almost certainly easing these upward transitions.
At the end of the day, any software development group wants the tool that gets the job done. No project I've ever been associated with chose Java because of market hype or buzzword psychosis. They chose Java because it presented the most complete set of enterprise service abstractions in a single platform, without needing vast amounts of glue code to aggregate them into a single, homogeneous enterprise application. I have also never been on a Java project that failed, although many stumbled along the way. Java is not market-successful simply because it is hyped, or because it is trendy, or because I say so. It is successful because it provides developers more tools in a single toolbox than other comparable languages.
This guy has no idea what he's talking about. (Score:5, Funny)
JSP is a component of J2EE. [sun.com] Here's a tip: When you have an "epiphany" about the nature of something, it ususally helps to have at least a basic understanding of whatever the hell it is you're talking about.
Huh???? PHP -Good, Java-Bad? (Score:3, Informative)
PHP is fine for smaller applications. It is an utter desaster for large applications that need maintenance and the ability to be coded by many inidividuals. Every bit of templating done in PHP has to be done by hand or you have to have intimate understanding of the code for the "application server".
JSP allows you to use Java's strengths in that the logic can be done in servlets, beans etc and implemented as one line JSP tags. It's overhead heavy for small projects but excellent for larger ones where you will still be able to figure out what the code does if the original developer left or got fired. This is similar to ASP.Net I imagine.
His comparisons say nothing about the scope of the students applications or the tools used. Anyone doing a whole application in JSP is going to suffer, and this is because JSP is not meant for this, and a comparison of JSP and PHP on this basis alone will make PHP seem better than it is.
As someone else mentioned: Use the right tool for the job.
Bind variables and SQL (Score:5, Interesting)
This is more cultural than technological. SQLJ has been available for years and handles bind variables in the same way that C does. But nobody uses it.
There's a tremendous distaste for SQL databases in the Java community. A major component of the Java community seems to have evolved out of the OO purist / Smalltalk view of things that view relational databases as an abomination to be avoided, or at least wrapped and hidden with an object-relational mapping layer. This is due to many varied reasons: dealing with objects alone is very empowering, and becoming an expert at SQL and relations is a discipline unto itself that many Java developers choose not to undertake.
If one DID actually try to learn the technology behind SQL and databases like Oracle, they'd discover a tremendously powerful engine for storing and retrieving data, that doesn't necessarily require elaborate model-view-controller architectures for good maintainability.
Simple web applications can be written with packages of stored procedures and a minimal data binding framework to JSP pages in a snap. In fact, this seems to be the approach ASP.NET and ADO.NET has been taking. Apple's WebObjects took this approach too, though with an object/relational mapper underneath (and "Fetch Specifications" instead of , or in support of, stored procedures).
Struts was the first real stab at a good data binding framework for JSP and is wonderful, but generally wasn't dynamic enough until the introduction of the DynaBean.
In summary, I think Java can definitely achieve the productivity levels of PHP and Perl, but the default recommendations from Sun are not the approaches that lead to these levels of productivity. I would suggest that the learning curve in Java might be higher to achieve this productivity, but it certainly is possible.
But I also think that the Java-based techniques do tend to favour a certain level of modularity that PHP and Perl and traditional VB/ASP based approaches do not favour out of the box, thus leading to a very unmaintainable approach. I think the Java community over compensated with "too much" modularity, but there are signs this is calming down.
Greenspun somewhat misguided (Score:5, Informative)
Of the three, C/C++ is obviously not well suited for developing web-based applications.
PHP is quick and easy, but it suffers from a lack of vision -- it was never designed, and the authors don't really seem to know what they want to do or where they want to go with it (don't even get me started on how it's supposed to be "Object-oriented" now...). IMO, it's much easier to make a mistake in PHP, and code is much less maintainable than equivalent JSP pages -- just try switching from MySQL to Oracle, and you'll see what I mean. I shudder whenever I hear the words PHP and enterprise in the same sentence.
instances vs. classes (Score:4, Funny)
Java instanceof SUV
We'll ignore the bad naming conventions, specifically it should be a lowercase J. Dont forget also that Java instanceof 3GL and Java instanceof OO.
My favorit happens to be Java instanceof ToyLanguage. The difference between men and boys? The size of their toys!
Lisp zealots = Holocaust deniers (Score:4, Interesting)
Don't assume from my posting that I'm in any personal hurry to learn VB and PHP! But having so many bright young people in 6.171 gives one a fun opportunity to take a high-level look at the programming tools of the moment.
What would I personally prefer to use? The same thing that I would have wanted to use 10 years ago: Common Lisp, CLOS, plus an ML-like type inferencing compiler/error checker. I find this preference, shameful, however, and try to keep it concealed from young people.
Just yesterday I ran into a friend. She's a 23-year-old graduate student in computer science at Harvard. Conversation rolled around to programming tools. Unprompted she said "What I think would be best is Common Lisp Object Systemw with a modern type system". I was stunned. I thought it was only dinosaurs like me that clung to Lisp.
I had a second ephiphany for the week... Believing that Lisp circa 1982 plus some mid-1980s ML tricks thrown in is better than all of the new programming tools (C#, Java) that have been built since then is sort of like being a Holocaust denier.
Re:Too much formalism (Score:5, Insightful)
Re:/.'d already.... (Score:4, Informative)
Re:its a bad comparison (Score:5, Informative)
Didn't even attempt to find out who Greenspun is, huh? Check out his resume [greenspun.com]. He is a Ph.D. in Comp Sci and teaches Comp Sci courses in MIT. Do you happen to teach Comp Sci at MIT?
Re:Make Java Open Source! (Score:4, Insightful)
You mean like Kaffe [kaffe.org]?
The Java class library, the language standard, and even the bytecode itself has been pretty well documented in many sources across the web. There's nothing preventing you from making your own version should you wish to - it's just that most people have decided that one of the existing implementations are "good enough" for their uses, just like many people decided that Windows 98 was "good enough."
I personally still don't buy this "Java is an SUV" argument. A programming language is a tool, and a bad programmer can write horrible code in any language or environment. I've said this before on ./, but knowing which tool to use and why you're using it is the most important thing to realize when you're programming.
Re:My Java Problem. (Score:3, Insightful)