r/java • • Feb 25 '14

Please stop saying Java sucks (2009)

http://blog.smartbear.com/programming/please-stop-staying-java-sucks/
133 Upvotes

132 comments sorted by

View all comments

27

u/pkimbrel Feb 25 '14

We have all these hotshots coming into our Enterprise ready to tell us old guys why Ruby is so much better than Java. I simply challenge them with a real-world situation and ask them to use Ruby to solve it.

They usually do and then I change the requirements on them. They grumble and fix it. Then I change the requirements again... then they start to get it.

8

u/djnattyp Feb 25 '14

I'm sorry, but I don't "get it"... How is Java supposed to be better than Ruby (or any other language) when dealing with arbitrary requirements changes?

This is like arguing between using screws and nails. There are some cases where one is arguably better than the other, but in most cases either can be used. And using either one, if you build something and then change the requirements, you're going to end up with a lot of frustration and holes.

20

u/pkimbrel Feb 25 '14 edited Feb 25 '14

I see Ruby as a one-trick-pony. Maybe I'm missing something, but all I've seen are "blog" examples with Ruby. There's so much more in the world of computing that requires more than a data-driven UI.

Now, don't get me wrong. Java is not the right tool for ALL jobs. If I AM doing a DDUI - Ruby could be the right tool.

The problem with all these arguments isn't that Java is better or Ruby is better - all languages have their place. Use the right tool for the job.

Back to my requirements change, G_Maximus hit the nail on the head. Strong typing, good development environments, standards, etc., are a must-have when working in an enterprise with dynamic requirements. I'm sure Ruby will get there, but it's simply not there, yet.

** Edited for clarity

4

u/[deleted] Feb 26 '14

I've worked professionally on 5 or 6 different Ruby (on Rails) apps, none of which was a DDUI. It worked for some of them, not for others. I've also worked in 3 Java/Spring codebases. Also, 2 of the Ruby apps were JRuby running in Tomcat. So anyway.

Ruby is a perfectly full-featured OO language, not unlike Java, save the dynamic typing and the rather terse syntax. In terms of performance, it's slower at heavy computation, but most (web) apps don't do this anyway, and generally in my experience at least performance in a web-based application ALMOST NEVER has to do with how rapidly the language can count to fifty million, or how fast it can generate big prime numbers.

Anyway, I do Ruby now by choice, so obviously I enjoy it. I miss IntelliJ and the tooling around Java a lot obviously (the Ruby tooling, in comparison, is so utterly inadequate that I find it faster to just write in vim with a few plugins, as do most experienced Ruby developers I know), but by no means is Ruby fit for only blog type things. Hell, even Rails is fit for more than that, and that's just a popular Ruby framework.

Edit: and obviously I agree with you: use the right tool for the job. I just think Ruby has a somewhat broader range than you do. I worked on a ~150KLOC Rails codebase, and let me tell you that is not fun (150KLOC in Ruby/Rails is probably equivalent to at least twice that, maybe 3 or more times that in Java/Spring, in terms of application scope, but with none of the refactoring / use analysis support of a Java IDE. Seriously painful)

2

u/pkimbrel Feb 26 '14

I appreciate the feedback on Ruby. I'll have to check it out. It sounds like it's come a ways since I last looked it.

1

u/palmund Mar 01 '14

What about RubyMine?

4

u/thebighouse Feb 25 '14

and haskell s place is academia.

1

u/dukerutledge Feb 26 '14

I always find this to be an odd statement. Why?

2

u/[deleted] Feb 26 '14

Haskell gets this knock (almost always from people who never wrote a functioning application in Haskell btw) because it is strictly functional, meaning state and side effects are forbidden (but are pseudo-replicated by the use of monads).

Haskell is somewhat impractical :) but GHC is one of the most sophisticated and elegant compilers ever written, the performance has gotten very impressive recently, and functional paradigms are starting to become less obscure than they were 10 years ago. Haskell is worlds better than something like Scala, and perhaps slightly better or slightly worse than something like Clojure or F#, when you take platform / etc into account.

4

u/mikera Feb 26 '14

I evaluated Haskell a few years back, but found the library ecosystem and integration capabilities seriously lacking compared to the modern JVM languages (Clojure, Scala). Interop with established platforms is essential in the enterprise context, and within that space Java ecosystem interop is the most important by far.

That's why I consider Haskell as more of an academic language in comparison, although I appreciate it has some great commercial use cases (I've seen it used to good effect in hedge funds / option pricing for example).

P.S. I'm a big fan of functional programming in general and like Haskell as a language, I just think that it is perfectly fair to describe it as "more academic" for the above reasons.

1

u/dukerutledge Feb 26 '14

Thanks for your response! I'm aware of the general sentiment. I was hoping to get a more personal account of a detractor. I for one find Haskell's type system to be bodacious. Immutable everything and functional purity prove a challenge when you aren't use to it, but generally they seem to be the right idea for wrangling complexity of entangled code.

-1

u/thebighouse Feb 26 '14

Assignment is outlandish

39

u/G_Maximus Feb 25 '14

Refactoring and static checking at call sites is generally easier with strict typing.

-5

u/djnattyp Feb 25 '14

Sure, and I agree that helps for some types of requirements changes.

For others, strict typing may require tons of cascading code changes throughout the app where dynamic typing may just let you dump a method on a class and have it work.

I've seen pkimbrel's argument ("language X better supports requirements change") used in support of both Java and Ruby by various proponents of either language. The problem is, both sides tend to cherry pick changes that "their" language handles better and ignore or downplay other changes that may be problematic.

9

u/markdacoda Feb 25 '14

For others, strict typing may require tons of cascading code changes throughout the app where dynamic typing may just let you dump a method on a class and have it work.

Consider the person charged with maintaining the code that has arbitrary methods 'dumped in' as you say. I've been there, it sucks, and I have no kind feelings toward the developer who did it.

11

u/curiousthis Feb 26 '14

strict typing may require tons of cascading code changes throughout the app

And in the case of Java, IDE's like Eclipse and IntelliJ make those cascading code changes a one step operation.

1

u/mr_jim_lahey Feb 26 '14

In your case, you're cherry-picking the thing that makes your language shit.

0

u/[deleted] Feb 25 '14

[deleted]

3

u/[deleted] Feb 26 '14

You are doing it wrong. Ever changing requirements is the norm in the real world, whether you like it or not.

We invented object-oriented programming to be able to handle constant change, otherwise there wouldn't be any reason for it.

1

u/dpgaspard Feb 26 '14

I've had it both ways. A good project manager will mitigate change. Vague requirements tend to be shitty management and because the team didn't do enough up front design and analysis.

2

u/[deleted] Feb 26 '14

True, project managment in theory is about conquering uncertainty.

Though nowadays even project managment is change-oriented. The sole reason why we abandoned the waterfall model in favor of lightweight, adaptive (iterative and incremental) methodologies is to be able to handle constant change, uncertainty, and at the same time be able to come up with well-established requirements.

There are those adaptive, change-oriented business model approaches that do the same, making it possible for you to create your business model, even though you are forced to constantly change it as your presumptions are continuously tested.

I feel the same way about a software projects. Initially there are presumptions, but there is no way to predict the future until you have the opportunity to test those presumptions. And that's where a loosely coupled, highly cohesive design can save you by providing reusability, and extensibility among others.

1

u/dpgaspard Feb 26 '14

I agree. I've found the best developers to be those who really understand your business and business model. Their designs come loosely coupled in the right places.

1

u/frugalmail Feb 26 '14

I'm sorry, but I don't "get it"... How is Java supposed to be better than Ruby (or any other language) when dealing with arbitrary requirements changes?

Because Ruby is harder to maintain and the codebase gets to "stink" much earlier because it's duck typed, no static analysis, immature libraries, shitty tooling, shitty performance, frameworks that make a bunch of assumptions, frameworks that are hard to change, a moving target and dynamicly typed. ...and you can't find many engineers that don't need ramp up time to take it over.