I realize I'm late to the party, but...
I've asked several friends and associates (application developers) what
programming language they recommend for new development. The most
prevalent answer was Ruby (with Ruby-On-Rails a close second). This was
surprising to me, since my understanding is that Java and C (et al) are
most prevalent.
Quite possible, but it depends entirely what you're doing.
Is Ruby a good programming language for general purpose usage?
That depends what you're trying to do.
I don't want to skew responses by specifying a particular application or
usage. However, please DO respond with qualified answers if you feel
that is appropriate.
A quick analysis of Ruby's weaknesses:
- Even once you hack in support for Lisp-like macros, it's likely not going
to feel as natural as Lisp.
- Slow. Not as slow as people suppose it is, but it's not C, or even Lisp.
- Can be difficult to bundle into one exe, so it _may_ be difficult for
Windows desktop applications.
Now, I never got enough into Lisp to get really good at macros, and Ruby's
syntax is still flexible enough to do interesting things with it -- in fact,
at least a few of the great examples I've seen of Lisp macros can be done in
Ruby, though they obviously aren't Macros in Ruby.
So my answers are mostly going to be qualified by the other two concerns. Ruby
is my favorite language in every other respect, so I'm going to say, choose
Ruby for everything except places where you actually need vertical performance
(performance on a single machine) -- but actually measure it, don't just
assume! -- and for places where your target output is a single .exe, unless
you can figure out a better way to bundle a Ruby app for Windows.
This does mean, by the way, that Ruby is ideal for web development. You
control the installation (so you just make sure to get a web host which
supports Ruby, or which gives you enough control to use it), and you can
always throw more hardware at it, which is cheaper than developer time. There
are exceptions to this rule, but when you actually get to the point where
you're so big that it's worth a few months of developer time to shave 10% off
in performance, that's a nice problem to have, and it's worth getting there
before your competitors do.
That is,
is it worth the time and effort to become proficient?
That's a different question.
I never use Lisp, and I still consider it worth the time and effort to at
least learn the language. Ruby is very easy to pick up, and you should be able
to see very quickly whether or not it's worth the time and effort to become
_more_ proficient.
If you already know Java, many concepts will translate right over, but the
beauty of Ruby's syntax will make it hard for you to look at a Java program
again.
The biggest reason you should learn Ruby is to understand what it means for
code to look pretty, and why you might want your code to look pretty. Look at
some Ruby on Rails examples, and try to keep in mind that Rails is written in
pure Ruby -- that is, Rails is a Ruby library that adds this kind of thing:
30.seconds.from_now
However...
Again, I don't want to sway responses by
specifying a background for the learner. Might be a relatively new
student of programming, might be an old-timer with decades of
development experience.
This is also not something you can remove from the question. Again, if you
already know Java, some of the object model will be easier to understand, like
the concept of object references. If you know C++, it may take a bit for you
to understand why it's weird to ask about "passing by value" in Ruby, versus
"passing by reference".
Similarly, if you're just starting out, it depends who you ask -- I would say
you should learn Ruby, so you get excited about programming, and so you
actually start programming faster, without having to learn about nasty low-
level things like pointers and memory allocation. Others would say just the
opposite -- you should start low-level, so that by the time you get to Ruby,
you understand exactly what the language is doing under the covers. Either
way, you should eventually learn both high-level and low-level languages, for
the same reason -- you want to understand just what you're asking the language
to do for you.
On the other hand, if you are already incredibly proficient in something like
assembly language or COBOL, you might find that you've already found your
niche, and your job will likely not become obsolete -- so you might want to
learn Ruby as a curiosity, but it's questionable how useful it will be to the
actual work you do. If you're already incredibly proficient in Lisp, Ruby
might be a hard sell, because there are specific, measurable ways that Ruby is
less powerful than Lisp -- the biggest reason I prefer Ruby is syntax, and
most Lisp people _like_ s-expressions.
···
On Tuesday 02 February 2010 09:19:32 am Jim Maher wrote: