Does this article contain any facts that are actually correct? Java losing marketshare to AJAX?
"One bit of good news: developers and analysts agree that Java is alive and well for internally developed enterprise apps." Has Java ever been alive for anything else?
Java's big problem is incompatibility across platforms?
Ruby gaining popularity because of built-in shopping carts?
And what's the connection between losing marketshare and becoming the new Cobol? I mean, Perl is losing marketshare...
There's so much bashing of Java lately. It reminds me of the kind of daytime TV rants that begin with "Well, Oprah, I think that man needs to..."
When people decide to end a relationship, they often start to think of all the ways they have been wronged to justify it. I always think, eh, maybe "that man" was fine, you just got tired of him. You don't need to justify a break-up to me - feel free to go.
Personally, I don't feel as aggrieved by Java as some people do. It was certainly better than working in C++. It certainly made web programming easier. Tomcat was simple to install and configure. Ant was a good build too (but I did start to wonder why all the XML configuration for something that could probably be standardized). Struts was heavy and cumbersome. Hibernate got on my nerves - why do I have to deal with all this XML. Spring was an improvement, but I broke up with Java when I started reading about Inversion of Control and all the design patterns. Why am I doing this when the actual code I care about is going to be, oh, maybe a thousand lines, tops?
"Well Oprah, Java is no good, let me tell you about what he did, in the beginning he was so nice, always bringing me flowers, but now he just sits on the sofa an plays video games, why even last week, when I got home, working hard to pay the bills, he's just sitting there..."
Eh, my take on it is that technologies and programming frameworks move on (often by finding something that was done better in the past and modernizing it, or even just dressing it up). Many if not most of the "breakthroughs" in rails were already present in other languages.
There's really no need to hate Java or decide it's a foul language that has wronged you. Maybe you're just ready to move on. Nothing wrong with that.
(of course, if you're a Lisper who suspected Java was stupid from the very beginning, I suppose you are entitled to your victory fist pump when everyone starts to wake up and get it).
I'm sick of programming in Java now. I'm not sure what's next, but Ruby and Rails certainly opened my eyes to how much more pleasant and productive other frameworks and languages can be. I just don't feel any real need to hate Java, because it did make my life a little better (almost) a decade ago.
There's more freedom of language choice now than there was in the past, especially for web applications. But I do agreee with you - there is certainly pressure from network effects, which does make it harder to just "break up" with a language as a purely personal choice. Not impossible, just harder.
As for me - I'd disagree that I'm forced to use java, but I am definitely under pressure (financial and otherwise) to do so. For instance, I use an API for a mathematical engine (ILOG) that is available in java, C#, or C - and everyone around me at work uses Java. Technically, I could write an extension for ruby in C (maybe there's already one out there?) But I have a feeling this wouldn't fly with my company. I could also quit and find a new job - there are plenty of good projects in Ruby out there. So to some extent I am "forced" to use Java, but if I'm totally honest with myself, I have to admit that there's more than a small element of personal compromise (as opposed to pure coersion) in the language I use at work.
I read an interview with David Heinemeier-Hansson where the interviewer repeatedly asked him about "why not use X for reason Y" (X= Java, .NET, etc, Y=performance, availability of programmers, scalability, etc)... and his response was something like "previously I was direct, now let me be blunt: I don't care about you."
That's what I'm getting at with the "well, oprah" analogy. At some point, you just have to decide what you're going to with. Keeping an open mind is extremely important, but it's equally important to remember that you don't need to convince anyone other than yourself. If you find yourself justifying things too often to other people, maybe you need to restructure your life a bit (not meant as a criticism: I know I do).
Java ascended to the throne through blind arrogance and force. It ruled with an iron fist. Now that the tables have turned the dynamic language revolutionaries will not be kind. There will be blood. They will take vengeance for all the hours of their lives that were "disappeared". Viva La Dynamico Revolution!
Just to be nitpicky... it would be: 'Viva la Revolucion Dynamica!'
(I tried the upside down exclamation point and the accent mark, but apparently that gives YC News indigestion. You'll have to settle for gender agreement.)
Cobol didn't convince pointy-haired bosses that technology which only 10-15 years before was considered an academic curiosity ought to be standard for business application development.
Relative to the other languages mentioned, I think the only significant way Java is similar to Cobol have is that common conventions require a lot of typing.
Consider an example from the programming language shootout:
Java:
public static void main(String[] args) throws Exception{
int sum = 0;
StreamTokenizer lineTokenizer = new StreamTokenizer(System.in);
while (lineTokenizer.nextToken() != StreamTokenizer.TT_EOF) {
sum += lineTokenizer.nval;
}
System.out.println(Integer.toString(sum));
}
Funny you use this example, because using line input is thing from the past. For me it's a "smelling".
I often see people demonstrating their point with line input or regexes, both of which are misused 90% of the time.
I'm convinced that ruby leads to shorter code at equivalent behavior; however I'm far from convinced that size is everything, because of various remarks of Donald Norman in his excellent book "the design of everyday things". For example: "place constraints in the world and not in the head", so if the constraint exists, it should be visible (which doesn't imply java type system, we can imagine something shown by the IDE that would not be code).
Apart from the language war, there is a community war. I don't use many "normal" java tools, because I feel they are dumb. But I feel there is a strong base of low-educated people in the new java-critics community, people that can only count lines, repeat the leader, cannot create new thinking by their own. And this is not new, a few well-intentioned leader get spoiled by dumb masses is common thing everywhere.
But this is tragic, because where java (and C#/.net) represented a progress hover the mainstream C and C++ by using explicit typing and collection the last technology in interpretation and GC in a single product, and removing explicit pointer manipulation, python or ruby are nothing new, they are basically old tech languages, with old tech (if not dumb) interpretation. O'caml and Haskell (and the "new" bunch of logic/functional language like clean, curry etc.) did propose some innovation.
O'caml did propose a new balance for generics and side effects ("weak types"), an interesting GC, some new type systems, Haskell proposed some interesting optimizations (massive rewriting thanks to laziness) a new compromise for mixing laziness and side effects, Concurrent Clean too, with its "unique" types.
The main problem with languages is people, and it has nothing to do with the line count. Because if you count the lines to make your language choice, then you can't criticize your boss when he manages by headcount chopping, when he imposes the new fad of the moment in the project etc. because you entered his system.
In my last job we divided the codebase by 5 without changing the language, we mainly trained people (management and ourselves the "newly hired" included) and removed stuff (because shit does not only come from development). Doing shit is not a language problem, it's a people problem.
A good contrast to make between Java and other languages on over-typing is Java's lack of a way to return multiple items at a time without making a container class.
So, yes, the lack of assignment is part of the problem. But, of course, the duck-typing is half the fun of something like that. I can return anything (of any type) I want in a tuple of any size just by comma delimiting. Java arrays aren't that flexible, and worse, if you use one that holds more than one type (say Integers and Floats), you have to cast them to Object before you drop them in, and you get to cast on the way back out. Lots of type-related overhead to simulate something that should be easy.
There are so many things wrong with your example! You basically wrote the ugliest Java code you could possibly think of for this simple program.
First, in order to get an objective comparison of code length you should at least use the same (length) variable names. You used "lineTokenizer" in your Java example and "l" in your Ruby example!
Second, you could have just written System.out.println(sum) in Java. The fact that you had to write System.out.println(Integer.toString(sum)) shows your lack of basic Java knowledge.
Lastly, the brackets around your one-line while loop in Java are unnecessary, unlike the brackets around your closure in Ruby.
Also, the Java main method declaration is irrelevant to your point, since it's written only once per program, and is automatically created by any IDE.
How about this equivalent Java code to match your Ruby example:
int count = 0;
Scanner s = new Scanner(System.in);
while (s.hasNextInt())
count += s.nextInt();
System.out.println(count);
Not so different now, is it? You can write concise code in any language if you know how to use it.
Um... I didn't write the example. I took it from a site that encouraged developers familiar with a language to submit solutions.
The developer of the Java solution posted something I'd consider reasonably representative of the Java I would likely encounter from most Java programmers and I while I have almost no personal experience with Ruby, I have the feeling the Ruby solution is reasonably close to what Ruby programmers write.
While you can write concise code in any language, it seems few Java programmers bother to.
Using an example from a benchmarking suite to illustrate language conciseness doesn't make any sense. We all know that conciseness is inversely proportional to speed. Whoever wrote that Java code was trying to write the most performant, not the most concise code. He did a great job, by the way, since for that particular benchmark, Java outperforms Ruby by a factor of 20! (http://shootout.alioth.debian.org/gp4/benchmark.php?test=sum...)
Sorry for initially assuming that you wrote the code. I wasn't familiar with that site, so I didn't register your original allusion to it.
Au contraire, the very fact that the programming benchmark site neither rewards or punishes conciseness makes it a good place to see how important it is to the average programmer when also dealing with an explicit performance criteria.
Also, I think your statement that conciseness is inversely proportional to speed is rarely true. It certainly doesn't hold for the programming examples at the shootout site.
I don't think that Ruby code will do what the original poster at the language shootout thought it would, as it's not equivalent to the Java code above it. If it were correct though, you could improve it by being more Ruby-like and doing it like this:
I don't think that Java programmer was up to scratch, although admittedly Java won't get as short as Ruby. I would count that readline construct of Ruby as kind of cheating, though. It's a specialized feature that doesn't say much about the brevity of Ruby in general.
I've done things like that often enough (putting parens around file contents or each line of an ascii file) that I wonder if it would be worth writing a macro that inserted the parens for you on the fly as you read the file before handing it off to the code you want to execute.
I know that was vague, but I just get the feeling I'm often doing something semi-manually in Emacs that my code should be doing for me.
It isn't only the language, it's the libraries and the programming community.
If you write the kind of Java that other Java programmers appreciate, you'll soon end up with lots of files full of long lines.
Ruby seems to encourage brevity everywhere.
I say seems because apart from a few Capistrano configurations I haven't done any practical Ruby programming. I have however written more lines of Java than I want to admit.
I only did some small exercises with Ruby and experienced a lot of problems that I never had with Java. But that was just because of the dynamic typing aspect I guess (and the mutable strings). It took me rather long to write a 30 line Ruby program. That doesn't mean anything, I was a beginner in Ruby and I am probably an expert in Java. I am just saying that I am still not convinced the brevity is the killer argument.
With Rails I had a similar problem, basically I stopped trying it when I hit the ActiveRecords part, because I thought configuring the OR mapping through the hasmap sucked big time: I had to look up everything in the ebook (PDF sucks), whereas Java+Hibernate+Annotations is just a breeze in Eclipse. I am still tired of Java, but as I said in another post, I am not yet sure how to best replace it.
Also, I have seen a lot of very bad Java Code. Maybe it is also the new Cobol in that respect, too many not so good programmers have been let loose on Java and give it a bad name.
I personally don't think that verbosity is an aim of Java. What I usually aim for, though, is understandable code.
Though that means that if the adoption of Ruby on Rails in the enterprise becomes widespread enough, it too will take the crown of "the new Cobol". Or it might be .NET
What I mean is the rising population of unskilled so-called programmers who have no business programming entering into the marketplace. I've already seen crap Ruby code floating around, including ones that were "ported" (I use the word lightly) from PHP or Perl. (They copied-pasted the code and change things here and there to make it Ruby-like ... doing things like retaining the $ in front of variables, or ...)
The DailyWTF is a monument to these pseudo-programmers.
When a language is sufficiently popular enough that pseudo-programmers perceive it as a way of getting secure income ... without having to expend skull sweat ... that language is flooded with utter crap. The result? COBOL.
People have said you want the top n-th percent of the programmers. For me, I just want to work with programmers that don't suck.
I understand the concern for mobile/embedded stuff and don't know much about how well Java does there.
However, when a half gig of RAM for a server costs well under $100, it just doesn't matter much for regular 'ol server apps. Even a "bloated" J2EE app doesn't usually require more than a gig of heap (unless you're doing massive, in-memory caching). Yeah, it's nice to use less memory, but there are 50 other things I'd give equal weight to (the availability of libraries being about 25 of those 50).
As I write this comment, I am tuning a Java rules (rete) app that is using an 11 gig heap :)
I haven't seen anyone else comment that this whole thing is just a friggin' PR piece from Twiki. And before all you 19-year-olds-fresh-out-of-logic-101 scream "ad hominem!", let me remind you that in the real world you should always consider the source.
I'm not about to defend Java, but what a lot of the Ruby newbies are too young to know is that we had a dynamic language in the enterprise. It was called Visual Basic - you just declared everything "Variant". The result was a bunch of god-awful messes.
Personally, I like flavors of Lisp. But I don't know that I'd prescribe it for the IT department at Wells Fargo.
It really is true. Nobody wants to program in Java anymore, if you do it's just because you don't know any better. However, just like Cobol, there is going to be money available for a long time for anyone that keeps their Java skills sharp.
I would bet that's only because you haven't looked hard enough. If you know Java already that's what you feel like you'll need to use, but honestly it's probably not true. Good Luck, I hope Java works out for you.
Less typing would be nice. I am willing to hope that dynamic typing will make for more fun languages, although I am very used to code completion by now (which is inherently impossible with dynamic typing, I think). Sometimes I wonder if the dynamic typing advocates are just the genius people, the same ones who can also remember the syntax of UNIX shell commands by heart.
If the dynamic languages fail me, I guess Scala might be worth a look.
I think outside of Java, and C#, there is a fair amount of IDE hate. So you tend to not see IDEs in that rich sense you are thinking about (the exception is smalltalk, which is an IDE and VM all rolled into one ball). Some would say language like haskell are so brief, there is nothing an IDE could possible do to help it.
I have read the beginnings of Haskell tutorials now, and it seems to be very similar to Erlang? I am not sure I like the static typing, though (ie inflexible arrays). So maybe not enough reason to prefer Haskell over Erlang?
The base looks similar (space is function call, static types inference, currying, '->' for function definition etc.) because the common ancestor for haskell, o'caml, erlang and various others is ML, another language.
This is the same kind of relation between C, java and C#, the basic type system and grammar are cousin.
I won't answer to the "static typing is inflexible", but you should check the type system itself, and its genericity system and modularity system.
"One bit of good news: developers and analysts agree that Java is alive and well for internally developed enterprise apps." Has Java ever been alive for anything else?
Java's big problem is incompatibility across platforms?
Ruby gaining popularity because of built-in shopping carts?
And what's the connection between losing marketshare and becoming the new Cobol? I mean, Perl is losing marketshare...
This article is utterly clueless.