Forum Controls
Spotlight Features
Replies: 76 - Pages: 6   [ 1 2 3 4 5 6 | Next ]
  Click to reply to this thread Reply

Why is the Java community so enchanted by Ruby?

At 7:24 AM on Apr 2, 2007, Ze'ev B wrote:

I've posted these thoughts on the Java Posse Google group and it generated an interesting discussion.
You are welcome to read and comment.

"I've noticed lately that many Java centerd sites (Artima, DZone etc.) are starting to add sections about Ruby. Sun hired the JRuby guys and is investing in supporting Ruby development inside Netbeans. A lot of Java "celebrities" that are advocating Ruby.

This made me think and reflect about what is happening in the past couple of years in the Java community. Ruby is gaining a lot of attention (mainly because of the well marketed RoR). I've lately became interested in dynamic languages and looked at both Ruby and Python. After looking at both languages I find Python is much more in
tune with the Java culture:

1. Readability and explicitness - both Java and Python endorse clean readable code that explicitly states what is being done. Ruby reminds me of Perl - a "write only" language
2. Matureness- Python and Java are of almost the same age. They are mature languages that proved themselves again and again in production systems.
3. Vibrant community - both platforms have a devoted community and community process.
4. Open source libraries - both platforms have a lot of libraries and frameworks available (a result of points 2 and 3).

It seems that there are a lot of Java developers looking at Ruby as an alternative or complementary environment and not at Python which offers a lot and is more "in the spirit" of Java. This also includes Sun that chose to hire the JRuby guys instead of resurrecting the Jython project (which has been brought back to life recently by some
volunteers after a call from one of the JRuby guys).

As for RoR, there is a python-based web framework that seems to offer the same level of productivity (and some say that even more) which is called Django (used by Tabblo which was just acquired by HP).

What do you think? "
1 . At 7:35 AM on Apr 2, 2007, Jeroen Wenting DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

I'm always wondering why people (not counting Bruce Tate who got a lot of money to think so) think Ruby's so nice.
I looked at it seriously several times (from way back before any Java site started hailing it as the best thing since sliced bread which would kill Java instantly) and always found it to seem clunky, hard to read and harder to write.

But Ruby is the darling of the open source movement for some reason and THEREFORE one is supposed to like it, which is why Sun hired those guys. It's a good marketing move to make them look like they're really there with their Linux spirit.
2 . At 8:32 AM on Apr 2, 2007, thebugslayer wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

This topic could easily start those programming lang war, but personally I think every programming lang has it's strength and weakness. I work with Python before and have recently started using little bit of Ruby. The bottom line is both works for me, and both has something I like and don't. Other than syntax and user groups, it's all personal preference I think.

As you've mentioned, Ruby works much like Perl while easy up in defining OO classes. I found this very useful in writing adhoc scripts. While I prefer the closes of Python way of using variable and defining Classes better. But I do like the easy use of Ruby's closure style(callback some may call it).

RoR is a great framework and so as many other ones out there. One or a project would depending on it's user's level of experience and comfort level of it's framework design and purpose in order to take full use of them. I didn't know about Django, and their features do sound very competitive. Thanks for the reference Ze'ev B!

I don't why Java community pick up Ruby more than Python recently, but I didn't see any bad reason why not either. Either case it beneficial to have more choices than not. Use it if it help, seek other way if it doesn't suit you.
3 . At 8:35 AM on Apr 2, 2007, Ian wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

Yeah, I don't think it is.
4 . At 9:18 AM on Apr 2, 2007, Rob Abbe DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

I'm glad I'm not the only one who thinks ruby syntax is somewhat ugly.

Generally speaking, I dislike scripting languages. I can see there usefulness in certain situations, but I'm glad that I don't have to make a living using them.

Scripting languages rise and fall from favor nearly as fast as Java web frameworks. JRuby will probably suffer the same fate as Jython when the next great scripting craze comes along.
5 . At 9:38 AM on Apr 2, 2007, Ricky Clarkson wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

Many Java programmers are aware that Smalltalk is a more OO language than Java. Personally, when I tried out Smalltalk I didn't like the immersion. I like the freedom to use any editor, or a command line, that I have with other languages.

Ruby is apparently an acceptable Smalltalk, and even an acceptable Lisp (I doubt this part).

Java is already a DSL (domain-specific language), where the domain is 'limited OO'. See http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html

Whereas Lisp (and maybe Smalltalk and Ruby, I don't know) are general languages that allow you to write DSLs in them. Writing a DSL in Java is painful, as explored in http://www.defmacro.org/ramblings/lisp.html .

Why Ruby and not Python? Python gives the impression of being Perl without the ugliness, but of still being hacky. The language is strongly typed, but there is some confusion over whether it is. Guido van Rossum didn't help that in this interview, when he didn't correct Bill Venners - http://www.artima.com/intv/pycontract.html .

Likely the biggest part is Rails. I understand how to use Rails immediately, despite never using Ruby. It scales down brilliantly, which is great for garnering interest. Does it scale up too? I don't know and I don't really care, I'm not a web developer, but I can see that EJB really doesn't scale down so well, so it doesn't have any 'cool' factor. It has a 'config' factor instead.
6 . At 11:44 AM on Apr 2, 2007, Raphael Valyi wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

Why Ruby over Python?

I would say: In my opinion Ruby is acutally cleaner. Some people also say that Ruby closures are cleaner that Python ones, see:
http://ivan.truemesh.com/archives/000411.html

Now consider Rails makes heavy use of closures...

Closures might simply look a syntactic sugar. But with closures, you can ofen divide the number of actual lines of a java method by 4. Do that for each layer of a complex web MVC framework and you understand why Rails API is so canonic.

Now, why Ruby over Java:
* closures (as I said)
* multiple implementation inheritance via mixins (simplifies a lot designs where we would use decorators and factories in java)
* messages to objects as if they were first class methods (natural way of doing AOP, used a lot in ActiveRecord). This actually also counts for the famous java properties support planned for java 7...

Now of course, there are downsides
* While I experienced no real problem with 10 people committing on the same java code repository, I would say more than 3 guys committing on the exactly same Ruby code is risky (due to the absence of static types). Of course, since you typically get 5 times more productive for web development, this generally isn't big deal. But after some experience, I now consider that the ease to do Unit tests in RoR will really protect your own framework against regression (often more than our javac compiler), but this doesn't really ensure the composition of different frameworks doing a lot of meta-programming won't break each other when glued together.

My conclusion
I think JRuby is just a very smart move from Sun. I love Java, this is my favorite static yet dynamic language and I think I woul really love to call it inside my Ruby code (not to say the JVM ruby interpreter could be the fastest implementation).

Also, J2EE developers should admit that statical check is a joke for web development: web framework actually break a lot of static enforcement when using DSL such as: EL expressions, HQL (Hibernate), put anything (Object) in request , properies map, and we could even argue that JSP/JSF are also a crappy way (very limited check compared to javac) of ensuring static validity.

So once you admit this, I think coding in Rails along with Java will actually look a a smarter way of achieving your goals.

Peace.

Raphaël Valyi.
7 . At 11:50 AM on Apr 2, 2007, Jose María Arranz Santamaría wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

Yesterday PHP was going to eat Java
Yesterday .Net was going to eat Java
Yesterday Python was going to eat Java
Today is Ruby...
Tomorrow ... Scala (the new guy) perhaps ?

Is so boring ...

Are we fool? wich really-new-hot-i-like-it language includes a construction like:

ParallelMonitor monitor = new ParallelMonitor();
parallel(monitor)
{
do something in parallel
}
parallel(monitor)
{
do something in parallel
}
monitor.waitUntilAllFinished();

We need a new generation of languages with built in features oriented to parallelism, this feature is today more important in a world of frozen CPU speeds and multicore than a new language with 10% of code reduction and +1000% of maintenance problems.

Jose M. Arranz
JNIEasy where Java loves C/C++
8 . At 11:59 AM on Apr 2, 2007, Ricky Clarkson wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

A flexible enough language will make it easy to use such a control abstraction, without it having to be part of the language. If Common Lisp didn't support OOP, then it could be extended, within the language, to support it.

This fork/join feature is one of the use cases for closures in Java 7, by the way. You might even be able to return from within the parallel stuff, depending on how closures go, and how the parallel stuff is written.
9 . At 12:07 PM on Apr 2, 2007, Dave Glasser wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

I don't think the Java community is exactly "enchanted" by Ruby. I think your perception is caused by Ruby advocates who tirelessly promote Ruby on Java-oriented sites. Personally, I couldn't care less about Ruby.

As for dzone.com, my understanding is that it's development-centric, not Java-centric, so Ruby-related stuff is perfectly on-topic.
Dave Glasser
http://qform.sourceforge.net

Musicians: Check out RPitch Relative Pitch Ear Training Software at http://rpitch.sourceforge.net.
10 . At 12:51 PM on Apr 2, 2007, Andy Tripp DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

> Yesterday PHP was going to eat Java
> Yesterday .Net was going to eat Java
> Yesterday Python was going to eat Java
> Today is Ruby...

Also in there are Javascript and Perl at the beginning, and AJAX at the end.

I hear congress is considering moving up the date for the introduction of the scripting-language-of-the-year by three weeks this year. I'm very excited. I can hardly wait to find out what the next scripting language to replace Java will be!
Andy Tripp, CTO and Founder Jazillian - Legacy to 'natural' Java.
11 . At 12:54 PM on Apr 2, 2007, Mike P wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

JRuby is interesting, because I can mix it with my normal Java code. Ruby isn't so interesting to me, because then I have to rely on a new environment. The JVM has come a long way. It performs great, the garbage collection is very good, threading is easy, there's the sandbox for security, tons of libraries, it's stable. I wouldn't want to make a leap backwards and lose all that.

But let's see some occasional articles here that shows how JRuby can supplement Java. Perhaps people will write more and more business logic in JRuby.

But Java itself is pretty good too. Often when I see other people's code, I see that many people haven't really discovered how to write clean and tight code. These people can not dismiss Java, because they haven't figured out how to get the most of it.
An interesting thing we could do, is perhaps have a sort of a competition / demonstration, where we start with a spec for a small application, and we all go an implement it in the best way we think we can, in Java. We could also have a pure Ruby version, a JRuby, and a JRuby / Java mix.
How about a desk calculator, or an address rolodex or something, or a chat server with both a server and a client component. The spec would include exactly what it should look like, so we don't end up trying to win with fancy graphics.
We compare notes and see what we can learn. Anyone?
12 . At 12:55 PM on Apr 2, 2007, Andy Tripp DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

> A flexible enough language will make it easy to use
> such a control abstraction, without it having to be
> part of the language. If Common Lisp didn't support
> OOP, then it could be extended, within the language,
> to support it.

And C didn't "support" OOP, so they extended it to add "support" for OOP, and called it C++. When "adding support", you end up with something that's quite different than if you build it in from the start, as with Java. "Support" is not enough. COBOL has also added OOP "support". I'll leave you with that image :)
Andy Tripp, CTO and Founder Jazillian - Legacy to 'natural' Java.
13 . At 12:58 PM on Apr 2, 2007, Ricky Clarkson wrote:
  Click to reply to this thread Reply

Re: Why is the Java community so enchanted by Ruby?

You just enhanced my point with examples. C and COBOL aren't flexible enough languages. That's why to add OOP you had to change the language. In Common Lisp you just write a set of macros, typically.
14 . At 1:39 PM on Apr 2, 2007, Archimboldo wrote:
  Click to reply to this thread Reply

Because it's fun - for a while

Java is the most readable language out there. That's why I like it.

Ruby has a fun (a.k.a. "cool") factor. Sometimes that coolness thaws as quickly as it chilled. It may well be that ruby's popularity will only be sustained as long as there are new people temporarily enjoying its coolness.

thread.rss_message