The Artima Developer Community
Sponsored Link

Weblogs Forum
What Are Your Ruby Pain Points, Really?

29 replies on 2 pages. Most recent reply: Mar 6, 2007 8:08 PM by Mason Deaver

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 29 replies on 2 pages [ 1 2 | » ]
Bill Venners

Posts: 2249
Nickname: bv
Registered: Jan, 2002

What Are Your Ruby Pain Points, Really? (View in Weblogs)
Posted: Feb 16, 2007 3:51 PM
Reply to this message Reply
Summary
There has been much praise for Ruby in recent times, but all technologies make tradeoffs. What are the actual pain points you've experienced using Ruby?
Advertisement

Last week I asked in this blog, What are your Java pain points, really? The discussion last week was fruitful, and this week I'd like to ask a similar question for Ruby. My question about Ruby pain points stems from my desire to make sure I understand the actual tradeoffs represented by Ruby, given that there seems to be some hype going around, especially surrounding Rails. One thing I admire about both Rails and Ruby is that they are well marketed. The ruby-lang.org site is very well done, and does a great job of getting curious programmers to try Ruby. And Rails has been expertly marketed with one simple message: it helps you write web apps fast by favoring convention over configuration. But my observation is that Rails in particular has been promoted by trumpeting its good points and downplaying its bad.

I have used Ruby in small scripts, and I like it. But I hope to hear this week from people who have built some pretty serious things with it. It is somehow hard to separate Rails from Ruby, but I'm not interested in hearing about Rails pain points. I'm really interested in understanding what pain points exist today in the general Ruby programming experience. What are your Ruby pain points, really? Please post your list of Ruby pain points in the discussion forum for this blog post.


Jeremy Echols

Posts: 3
Nickname: nerdmaster
Registered: Feb, 2007

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 16, 2007 5:19 PM
Reply to this message Reply
It'd really be a lot easier to come up with Rails pain points than Ruby pain points.

Ruby has been, for me, a very clean language, so I can't offer much here. The biggest issue is that it's slow as dirt compared to just about any language other than PHP. And nobody wants to say "It's just as fast as PHP!" because that's not really something to brag about.

The only other major annoyance I've had is the way Ruby deals with Class objects. The Class class is mostly pretty cool except for in one particular case - when you need to check a class with another class in a case statement:

case object.class
when Hash
end

when String
end
end

That code will not work. Period. Why is this? Ruby uses the === operator for case statements. Very handy, as that automatically allows range checking and regular expression matching:

case object
when /foo.*bar/
# This is hit if we had a string such as "foobar", "foo bar", etc.
end

when 1..10
# This is hit if we had a number (integer or float) >= 1 and <= 10
end
end

And in most other cases, === acts just like ==. But for some ungodly reason, === does something different for Class objects. I'm not sure what it does, nor am I sure why it's so different, but "Hash === Hash" does not evaluate to true even though "Hash == Hash" does! ANNOYING.

Christopher Cyll

Posts: 49
Nickname: topher
Registered: Jan, 2006

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 16, 2007 5:37 PM
Reply to this message Reply
Hey Jeremy,

I believe classes do kind_of? matching on ===. To get the example below working, do this:


[pre]
case object
when Hash
end
when String
end
end
[/pre]


Not sure what I think about that design decision in particular, but hope that helps!

Toph

Dmitri Dolguikh

Posts: 1
Nickname: witlessbir
Registered: Feb, 2007

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 16, 2007 6:29 PM
Reply to this message Reply
My biggest pain point with ruby (or ruby toolset) is the lack of support for automated refactoring.

I understand the reason for this: ruby is not a statically typed language. In case of java information required to support automated refactorings is extracted from java bytecode. In case of ruby this information has to be collected dynamically and one possible way to do this is by using unit tests (I think that's how refactoring is supported in smalltalk).

The lesser pain point is not with ruby itself, but with ruby on rails. It has to do with major hoops than one needs to jump through in order to use in-memory databases with RoR. Which slows down tests immensely.

Have to run to catch the plane.
Cheers,
-Dmitri

---

http://blog.appliedlogic.ca

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 16, 2007 6:37 PM
Reply to this message Reply
> My biggest pain point with ruby (or ruby toolset) is the
> lack of support for automated refactoring.
>
> I understand the reason for this: ruby is not a statically
> typed language. In case of java information required to
> support automated refactorings is extracted from java
> bytecode.

In Smalltalk, this is how it is done as well. Smalltalk systems are live systems, we always have both the source and an object representation of what the source means that is directly manipulateable by Smalltalk code. Which is why refactoring began in the Smalltalk world - it is very easy to do there.

My complaints about Ruby are:

1) Performance

2) The code is in files divorced from the executable. See http://www.cincomsmalltalk.com/userblogs/avi/blogView?entry=3284695382

3) Overly complicated syntax is difficult to parse.

Daniel Berger

Posts: 1377
Nickname: djberg96
Registered: Sep, 2004

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 17, 2007 12:14 AM
Reply to this message Reply
Regarding the previous posts:

Jeremy: See Christopher's response to your post. Or, you could have posted to comp.lang.ruby or asked for help on #ruby-lang on IRC.

Dmitri: YAGNI. This is Ruby, not Java. That being said, I think the about-to-be-released RDT 0.9.0 (Ruby plugin for Eclipse) will have some new toys for you.

Todd: Point 1 is true, but usually irrelevant in any situation where the language isn't the bottleneck. Point 2 falls into the usual complaint I hear from Smalltalkers, i.e. it's not Smalltalk, although I can appreciate Avi's points. Point 3 is true but irrelevant (directly, anyway) to the vast majority of programmers.

And now, some pain points from someone who has actually used the language for five years.

* No native thread support. Not quite the major issue some would make it out to be, but the lack of native thread support has hurt on at least one C extension where we had to resort to some icky polling hacks instead. Since multi-core cpu's are the wave of the future, this will become a bigger deal than it is now I suspect.

* MS Windows issues stemming from the usual UNIX-centric bias that most language creators have. Issues range from blocking behavior with (Ruby's) threads to bad path handling. Some of this is mitigated with 3rd party libraries, however.

* Ruby could use better function tracing and ways to handle potential segfault situations internally instead of dumping core, which is a right royal pain to debug. This can also be an issue for those bugs you hit in your own C extensions.

* No real AOP support. There have definitely been times I've missed this.

Some of these issues will be addressed in Ruby 2.0, however.

Dan

Buu Nguyen

Posts: 2
Nickname: buunguyen
Registered: Feb, 2007

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 17, 2007 1:50 AM
Reply to this message Reply
Biggest pain point: no good IDE with an editor for building GUI and support for Ctrl-Space, refactoring, and unit testing. My life, and many others, would be better with such an IDE

Joao Pedrosa

Posts: 114
Nickname: dewd
Registered: Dec, 2005

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 17, 2007 11:43 AM
Reply to this message Reply
In general I am happy with Ruby. I think Ruby and JavaScript (and its variations) will continue to make progress. JavaScript is the closest language to Ruby which will continue to grow in popularity over time, so I think the two of them can co-exist just fine, like Ruby on the server side and JavaScript on the client side. I am really happy with the jQuery JS library, which seems to be a very nice Domain Specific Language for JS, while making something similar to how Ruby would, with some powerful standardization on iterations and chaining of operations.

Standard JavaScript can be a pain, but once they make things like jQuery, it starts to feel less painful. The important thing is that the core was kind of right from the beginning, while the libraries can fix the shortcomings.

That's how Ruby could improve. For example, instead of trying to use native threads for multi-CPU usage, maybe a smart library could be used, which would hide the high-performance concurrent operations from the user. Ruby been so malleable, it would be very easy to use the library, with or without wrappers. The crux is that the core already provides the right functionalities.

My pain points are these:

1. Native threads, mainly for Windows programming.

2. More performance, because the faster the better. Simple like that! :-) I think a good library for concurrency programming could be created, for example, instead of relying on locking/multiple processes only.

3. Native Windows C/C++ compiler which was free and compatible with as many Windows as possible, and as optimized as possible. Everywhere else we can have "gcc" which is easier to standardize on. On Windows it has always been a little painful, as the compilers were commercial. Imagine if all the Java SDKs where commercial as well. It seems that Microsoft has started providing some free compilers, but there may be some tradeoffs to using them, don't know. This is external to Ruby, but very important, because Ruby relies heavily on C. Now that tools have become free/commodities, one day this might be fixed for good.

Ruby 2.0 will improve these things. The remaining issues will be fixed with time. And some other issues maybe will never be completely fixed, as they may go against my use cases of Ruby programming.

I've come to a point that I don't feel any void with Ruby. Sometimes I might feel that something is incomplete, while other times I don't see an easy alternative to what is available, for example, I would rather avoid reintroducing manual compilation for Ruby files... If it's "JIT", fine. :-)

Charles Miller

Posts: 972
Nickname: carlfish
Registered: Feb, 2003

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 17, 2007 5:06 PM
Reply to this message Reply
1. Performance. Whenever you want something done at a reasonable speed, you're expected to drop down to C, or Ruby APIs that are totally non-rubylike wrappers around C libraries, which slightly defeats the purpose. And the Ruby garbage collector sucks.

2. Lack of automated refactoring tools. Trying to program without even simple things like safe renaming and one click method extraction/inlining is like being forced to type with one hand.

3. Clumsy character encoding and Unicode support. There seem to be two camps inside Ruby, the first all say "This has never caused us problems, therefore it isn't a problem", and "Unicode doesn't solve 100% of character encoding issues, so we're going to spend eternity in analysis paralysis, hoping to find a better solution." Neither attitude fills me with confidence writing multi-lingual apps in Ruby.

disney

Posts: 35
Nickname: juggler
Registered: Jan, 2003

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 19, 2007 5:41 AM
Reply to this message Reply
I have only played with Ruby; I've looked for opportunities to use it professionally, and I'm still awaiting the right one!

My pain point (and this could just be because I'm inexperienced and/or stupid ;-)) is how to find and how to use the many Ruby libraries out there. If I want (say) to read the 'volume label' of a disk, I'm sure there's a library and a simple call, but where is it, and how do I find out?

Ruby Newbie ;-)

disney

Posts: 35
Nickname: juggler
Registered: Jan, 2003

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 19, 2007 5:43 AM
Reply to this message Reply
I have only played with Ruby; I've looked for opportunities to use it professionally, and I'm still awaiting the right one!

My pain point (and this could just be because I'm inexperienced and/or stupid ;-)) is how to find and how to use the many Ruby libraries out there. If I want (say) to read the 'volume label' of a disk, I'm sure there's a library and a simple call, but where is it, and how do I find out?

Ruby Newbie ;-)

Joao Pedrosa

Posts: 114
Nickname: dewd
Registered: Dec, 2005

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 19, 2007 6:24 AM
Reply to this message Reply
Awesome benchmark:

"Ruby Implementations Shootout: Ruby vs Yarv vs JRuby vs Gardens Point Ruby .NET vs Rubinius vs Cardinal"
http://www.antoniocangiano.com/articles/2007/02/19/ruby-implementations-shootout-ruby-vs-yarv-vs-jruby-vs-gardens-point-ruby-net-vs-rubinius-vs-cardinal

Thank you very much, Antonio! Great one.

Jeremy Echols

Posts: 3
Nickname: nerdmaster
Registered: Feb, 2007

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 19, 2007 3:20 PM
Reply to this message Reply
Dang, Daniel, I know I'm no expert, but at least I'm not a snob.

That's pain point #1 for me - so many Ruby programmers have that band-like "heard it first" syndrome. There are just too many snobs who are so dedicated to pointing out that they used Ruby before it was popular. I realize I'm not as cool as them, but it really hurts my feelings to have to hear it all the time.

I've used Ruby for about two years (mostly hobby programming, mind you, probably nothing as awesome and sexy as what you do), but I never ran into the class case issue until about a month ago. So very sorry. In any case, I still think it's inconsistent to have Hash === Hash not be true, no matter what the rationale behind it is. Adding a check for === when both objects are Class objects wouldn't exactly be hard.

I'm surprised nobody's complained about the lack of private data. Pretty much anybody can get at "private" data, and usually without much trouble. Never been something I minded, as I dealt with too many third-party controls when I was programming in Delphi, but I've heard many purists complain about this aspect of Ruby. Being unable to easily extend and change the behavior of poorly-written classes makes me appreciate Ruby's openness. Every time we updated one of those horrible controls, we had to repatch the class to first expose private data to subclasses (ie, make data protected), then make certain functions virtual (so they could be redefined in a subclass). It was a nightmare.

Question for Todd though - what part of Ruby's syntax do you find confusing? I've thought it to be a mostly clean syntax....

Peter Booth

Posts: 62
Nickname: alohashirt
Registered: Aug, 2004

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 19, 2007 11:02 PM
Reply to this message Reply
My Ruby pain points are largely about maturity. With Java, when I have a problem or question there are typically many places I can turn to, to get an answer: books, people I know, the Advanced Java mailing list, Heinz Kabutz' online magazine, IBM's developer.ibm site, Sun's Java forums, Usenet, etc. There are more than a dozen books on Java concurrency, but the best of the best was only published last year. There are a dozen Java style books, but only Bloch's Effective Java is rock solid. There just isn't the same amount of long term experience that can say "don't use API x because it sucks."


With Ruby there is frequently one core source of information about a topic, although the Rails hype is changing that. Tools are certainly weaker. I'd love an equivalent to the Eclipse Java debugger.

The other surprise is how many smart developer's haven't heard of Ruby yet, but that's changing quickly.

Erik Engbrecht

Posts: 210
Nickname: eengbrec
Registered: Apr, 2006

Re: What Are Your Ruby Pain Points, Really? Posted: Feb 20, 2007 9:23 AM
Reply to this message Reply
> That's pain point #1 for me - so many Ruby programmers
> have that band-like "heard it first" syndrome. There are
> just too many snobs who are so dedicated to pointing out
> that they used Ruby before it was popular. I
> realize I'm not as cool as them, but it really hurts my
> feelings to have to hear it all the time.

Will someone name a single feature Ruby has that wasn't available in LISP or Smalltalk first?

Flat View: This topic has 29 replies on 2 pages [ 1  2 | » ]
Topic: What Are Your Ruby Pain Points, Really? Previous Topic   Next Topic Topic: The Python Conference


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us