Ruby Off the Rails
An anonymous reader writes "IBM DeveloperWorks has an interesting writeup on Ruby that takes a look at the programming language as a stand-alone solution rather than defining it in terms of Rails. From the article: 'Ruby on Rails is just one facet of what makes Ruby great, just like EJB is only part of the Java enterprise platform. Andrew Glover digs beneath the hype for a look at what Java developers can do with Ruby, all by itself. Ruby's syntax is quite different from that of the Java language, but it's amazingly easy to pick up. Moreover, some things are just plain easier to do in Ruby than they are in the Java language.'"
ikkibr is a robot that looks for similar past articles and reposts highly-modded comments from those articles. See http://ask.slashdot.org/comments.pl?sid=171820&cid =14310500
Ruby is useless to me because it has no unicode support.
e st=all&lang=java&lang2=ruby&sort=fullcpu
In this shootout it was found that Ruby had lower memory consumption, but also ran much more slowly than Java:
http://shootout.alioth.debian.org/benchmark.php?t
Why? The speed of C and C++ are hardly needed for most applications, and languages like Ruby and Python can leverage GUI toolkits like Qt and GTK. If your Qt Ruby application is indistinguishable from your Qt C++ application, why waste time developing in C++ if you don't have to?
...is a good guy to write this sort of thing since he's been programming Java for a long time and has also branched out into "dynamic Java" things like Groovy. He's done a bunch of stuff on dbUnit (including a dbUnit chapter in Java Testing Patterns), too. So he's had enough experience with Java to know what's what.
I'm probably biased, though, since Andy also wrote the CPD Ant task.
The Army reading list
"The real question is, can ruby be defined on its own terms, and not Java's?"
I'm not sure this is even a issue. the Disussion on Ruby Vs Java seems to happen totaly outside the Ruby 'community'. I read a lot of Ruby programmer blogs and don't see Java mentioned that much.
Interesting reading
http://www.artima.com/intv/ruby.html
The Philosophy of Ruby: A Conversation with Yukihiro Matsumoto
I'm doubtful. I bump up against the limitations of Java every other day, and it seems like the only way you could get around such things is with an awful lot of code generation.
For instance, I was recently writing a Java class to convert an XML DOM into a custom object tree. This largely involved writing getters and setters, and for loops to iterate over NodeLists to pull out descendant elements. I couldn't help thinking that with Ruby, I could have written "has_attributes" and "has_descendants" methods, and generated the getters and setters and DOM handling automatically. Instead of my classes being 50 lines apiece, they could have just been 4. It would have taken me far less time in Ruby than I did in Java, because Java hasn't got metaclass-like abilities like Ruby or Python.
I work as a java developer, but I still still have plenty of other languages in my toolbox. I have just started with experimenting with Ruby. The biggest thing I see is that Ruby fills gap for me between perl and Beanshell.
The programming hierarchy I tend to think of for my work,
1. Shell- Basic scripting. Glueing commands together.
2. Perl- More powerful sripting features, but not really OO.
3. Ruby- Still a scripting language, but designed around OO.
4. BeanShell- Good for quick glueing of java classes together
5. Java- When I need a full compiled application environment.
For me each language has its purpose and I use them where it best gets
the job done.
Rails as has been said, is a framework. Ruby is the language, and all rails is just ruby with a design in place to make it easier. Some great tools for using rails are becoming available though, due to its increasing user-base. A lot of people are still "trying it, and going back to php" but its got a core user group now and that's what counts.
2) Java needs a lot of RAM. If you try to run a java app on a smallish box, chances are it will start swapping.
3) Swing is Slow, it makes Java GUIs feel cluncky. SWT is much better for the user, it "feels" more responsive.
Both these are now way out of date. Java memory handling has been tidied up. As even a 'smallish box' these days is more than 128MB, memory really is not going to be a problem at all.
Swing is hugely faster these days, to the extend where it is often reported to be more responsive than SWT on some platforms (such as Linux). Swing is now by default OpenGL or DirectX accelerated.