5 ms·
Can Java Be Saved?
- jacquesm 17y agoThat's an excellent article, thanks Fogus! Not only does it level some valid criticism, it also proposes (for the most part, omitting 'new' would break too much code) workable solutions.
- silkodyssey 17y agoI think that both sides of the argument are valid but I am more inclined to believe that keeping the language stable at least over the short term may be the better strategy. Java thrives in environments where stability is a prime concern and Sun's commitment to maintaining backwards compatibility would inspire confidence. The new languages that are being developed to run on the jvm reduces the need for Java to evolve as rapidly as some would like. If it is proven that these new languages solve problems better than java then it's only a matter of time before developers make the switch. At this point when it's obvious what features are really desired then it Sun/Oracle may decide that adding those features to the Java language are appropriate. In this way the new jvm languages sort of act like a research lab to test out new ideas to see which work better.
- jacquesm 17y agoJava has some serious shortcomings that require you to write lots more code than actually necessary, to reduce that would be really really neat. On top of that I can see one immediate benefit in implementing some of these, which is that to my eyes all java persistence layers are kludges, simply because of the way the language is structured. This could make writing such software a lot easier and more reliable.
- vladev 17y ago"Can Java Be Saved?" Hopefully not. :)
- jacquesm 17y agoWhy hopefully not ? Java has it's uses. I'm no 'fan' of the platform, but like any other programming language you can write anything in it, it simply has a 'niche' where it is a good tool when properly applied.
- jrockway 17y agoAnd what is this niche?
- jacquesm 17y agoSoftware written for large corporations with a medium to high turnover in their staff where quality of programmer is less a factor than long-term maintainability of the project is. As weird as it sounds, in that world java's lack of 'neat constructs' and tendency to solve things using 'boilerplate' is actually an asset, for the same reason that COBOL used to be an asset. I've inherited a bunch of java code about 10 months ago now, so I've been more or less forced to come to terms with it, and even if I can't get over how tremendously kludgy it feels I would have a hard time getting this kind of performance out of other platforms on the exact same hardware. Call it grudging admiration, I personally would have never thought that you could do this and more with Java before being forced to get in to it. There isn't a day though that I don't curse the language designers for making me go the long way around on just about anything that I could do in half the code (or less) in pretty much any other language that I have under my belt with the exception of assembler. At this point in time, my main gripes with java are verbosity and an absolutely terribly kludgy feel to the interface with other parts of the library, it feels like wearing a straightjacket. And it is exactly for that reason why enterprise types much really love it, my 'creativity' is limited to the point where anybody else facing the same problem would probably write more or less the same code. Since joining this project I've basically just been busy condensing code and removing 1000's of lines of boilerplate by replacing it with the appropriate abstractions. And by doing that I'm doing two things, I'm making the work marginally more interesting, secondly the other guy working on the project is slowly starting to see that cut&paste is not the way to go. But that's my 'toolmakers' hat that I'm wearing, I'm pretty sure the that people that lead this project would rather have me work on 'features' because that is more productive in their eyes, my kind of 'productivity' will start paying off in the longer term. Time will tell how it is all goes, for now my conclusion is that it is probably not the language that is 100% at fault, it is likely in large part attributable to the people that use it and promote it. And it will be a long time before I will be one of them, if ever. If you've ever used UCSD-P with the dreaded P-code then you know roughly what I feel like about this job :)
- bediger 17y agoThis is just crying over spilt milk, isn't it? Java got to be the COBOL of the 21st Century because of the boilerplate & etc, not despite it. Immoral MegaCorporations like Java because they can segment large jobs and have armies of drones work on the small segments. Immoral MegaCorporations don't innately like productivity, they innately like Control Over Employees.
- wallflower 17y ago> Java got to be the COBOL of the 21st Century Java won. It wanted to become the Enterprise language. Initial concerns over speed have mostly been addressed with JIT compilers. Java = COBOL. Java is so firmly entrenched in the Fortune 500 enterprises. Because Java won, stuff like Grails (Groovy + Java) has a much better chance of getting corporate adoption than Ruby on Rails. Having worked in corporate environments for a long time, people risk their jobs when they push (relatively) new technology (like Spring, over J2EE).
- radu_floricica 17y agoUhh... it's not immoral to want manageable code. If any piece of code would depend on the programmer who wrote it, or require somebody in the top 10% then I'm sorry to say, but a lot less software would be written. It's not a perfect world, but I tend to value a workable compromise over an unworkable ideal.
- bad_user 17y agoIf you're going to implicitly say that Java code is more "manageable" than alternatives, then you're going to have to provide citations, or at least meaningful stories of your experience. The most important purpose of higher-level programming languages is to remove accidental complexities. I can give you dozens of examples where Java fails to do that ... as opposed to other languages, some of them mainstream. Some examples ... nullable references, checked exceptions (which are a class of their own), no compile-time code contracts (the type-system is way too weak), concurrency based on shared state and mutexes, public/protected instance variables (with a god-awful getters/setters convention), no real closures (an anonymous class instantiation only captures final locals), no multi-dispatching (this could take care of half of all possible Java-related gotchas, at least), no pattern-matching operator (switch doesn't count). And the list can go on and on. I've also worked on "big" code-bases written in Java. Some Java open-source libraries are truly beautiful, but these particular projects were not. On one of them it took one whole month to fix a bug that escaped us because of all the layers and all the boilerplate that was executing. This particular bug only happened like once a month, and debugging multi-threading Java code is a nightmare (I guess it could be worse). Sorry, but this argument doesn't fly. I work in a Perl shop and not all programmers here are in "the top 10%" (I don't think either of us are). But with enough training and clear code-conventions (many of them coming from our community) ... our code base is quite manageable. PS: I don't have anything against Java or Java programmers. I actually like it because of the available tools, libraries and because of the JVM, which is state-of-the-art.
- weavejester 17y agoI find it interesting that the article mentions the "new" operator, since this particular language quirk has been a source of minor fascination to me. Presumably it was added to make Java look more like C++, even though many other parts of the language are quite different. The "new" operator is the only language feature I can think of that has no purpose other than appearance, and that comes at the cost of making the language just that little bit worse.
- leoc 17y agoThese comments by Guy Steele http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg04044.html http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/m... http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg04030.html http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/m... on the LL-1 list seem to shed light on why Java has a hardwired "new".
- weavejester 17y agoAha, interesting. So they were worried about having a specific operator for heap allocation. It doesn't sound like a particularly clever design decision, because even very early on Java had static "newInstance" methods which rather seem to defeat the point. But I can see the reasoning behind it now, even if that reasoning wasn't very well thought through.
- forinti 17y agoThis is all irrelevant because most Java programmers now program in XML anyway. Except they like to think it's not programming, but "configuration".
- gaius 17y agoI don't know why you were downmodded, that's an accurate description of most AOP shops. 10,000-line, version controlled "config files" are not unusual.
- axod 17y agoThe fact Java can be used like that, is irrelevant to the merits of the language. Mibbit backend is about 20k LOC, and 72 lines of xml to get ant to do something useful.
- jrockway 17y agoBut it's not code, so it doesn't need testing or documentation. Think of the time savings!
- gaius 17y agoVersion controlled if you're lucky too!
- jrockway 17y agoUh oh, the Java downmod trolls are here. I wonder how many accounts axod has created simply to mod down every post in "Java is not perfect" threads.
- axod 17y agoAnd I'll do the same in a few years time when this place is overrun with "Ruby is dead!", "Why Python is dead", "Is erlang the next COBOL" articles.
- ivenkys 17y agoWelcome to the bimonthly "Is Java dead ? Can it be saved ? Using Java, brain-dead ?" ad-infinitum . The reality is quite prosaic , does Java work for you ? This can also be re-phrased as Are you looking for a stable,robust language with tons of libraries + tools and lots of "developers" ? If yes, then consider Java. If no, then look elsewhere , may be even at one of the languages running on the JVM. End of.
- moron4hire 17y agoI think projects like Clojure are showing that the Java platform isn't necessarily about the Java language anymore, that the runtime and the class library can be used to great effect while getting passed Sun's unwillingness to evolve the language. When was the last time Sun updated the bytecode format? I seem to remember it has been quite a while, like 1.3. I don't know, I haven't been steeped in Java for the last 3 years.
- moron4hire 17y agoIt appears it was round about the time of JRE1.5. Actually, that was the last major runtime update, that doesn't mean the bytecode format changed, though obviously how the runtime reacts to the bytecode is a significant consideration when developing a new language. Anyway, it doesn't seem like the JRE is a largely moving target.
- axod 17y agoSIGH Some people are such fashion idiots. We get it. You think Java is like wearing flares. It's unfashionable to you hip idiots. You're having a blast hacking together your dynamic stuff without a care in the world. You love how you can type 3 less characters and get the same work done! Woo! High five! You have your repl setup so you can edit (and break) your website on the fly. Static typing? who needs it. Lets write our own type checking all over the code. Meanwhile, people who don't care what is fashionable, are making awesome stuff in whatever language they assess does the job best. For anyone who hates Java, I'd recommend: * Ignore everyone who writes Java commercially. *especially* corporates doing their massive TomCat beans getter/setter XML over engineered crap. * Do NOT use an IDE. You don't need to. It makes you output more code, and worse code. * Figure out your own concise style, and figure out the absolute strengths of Java (There's many). I know it's ridiculous that at some point programmers may figure out that languages are largely irrelevant, but I hope it happens one day. Talking of languages "Dying" is also quite ridiculous. Languages are 'alive' as long as people use them. Guess what? If a new JVM is never released, it still solves a massive class of problems. A good programmer beats a good <language> programmer IMHO. </rant>
- shiranaihito 17y agoDid you really take the post that personally?
- axod 17y agoI'm just bored of the endless fashion strutting that goes on recently in programming. I think it's irrelevant and tiring. If a language solved a problem 5 years ago, it'll solve the same problem today. It won't die unless something else is found that solves the problem in a better way.
- jrockway 17y agoYeah, why bother keeping up with advances in the field? Back in my day, sonny, we used our Java 1.4, and that's the way we likes it. Any new ideas should be immediately rejected as "fashion strutting", especially new ideas that have been successfully implemented in other languages for decades.
- dreish 17y agoFunny that this article praises C#'s generics over Java's type erasures, when Rich Hickey specifically cited the latter, and the convenience it creates for dynamic languages, as a reason for choosing the JVM over the CLR for his implementation of Clojure.
- nazgulnarsil 17y agoagain, please don't upvote question headlines. cowardly journalism, easily abused, insubstantial stories. just don't do it.
- axod 17y agoAgree. Flag it instead.
- rubinelli 17y agoC# and Java may look similar, but they have drastically different ecosystems. C# can evolve much faster because Microsoft can drop their support of older versions and make them practically inviable. MS customers are used to the cycle and have learned to expect it. The large corporations that adopt Java, on the other hand, don't expect and don't want the language to change. They have hundreds of millions of dollars invested in code, and they won't let any vendor tell them it's obsolete.
- mdemare 17y agoThe strange thing is that even though Java is very much backwards compatible, big vendors behave as if every new version would break everything. I've had to move heaven and earth for an upgrade from 1.4.1 to 1.4.2 when Java 6 was just around the corner, and I hear that there are still many teams using Java 1.4.
- rudd 17y agoIt's funny how an article about Java the language comes up and almost every single comment here is attacking either the article or the language. Like it or not, Java is one of the most popular languages, so there are going to be a lot of people who want to improve it to make it more usable. As the article said, Microsoft has proven with C# that you can take a language and evolve it over time for the better. If Java the language wants to be viable and keep up with what programmers want from a language, then it's going to have to release an update with changes like the ones outlined in the article. I think the article hit the nail on the head with some of Java's biggest problems (though not all). These changes would make it so that Java could be used in the way a lot of people want to use it.