Why Ruby?

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.

So I asked why. I received at least a handful of reasons from each
respondent, no answer consistently offered, none all that obviously
compelling. My initial reaction was “It’s just the buzz”, that is - a
fad. Further research revealed a thriving and mature community around
Ruby, so that initial reaction was probably too dismissive. So let me
ask the question more specifically and of a broader audience with
greater specific knowledge.

Is Ruby a good programming language for general purpose usage? That is,
is it worth the time and effort to become proficient?

The problem is that ANY programming language will probably require tons
of study and years of practice before a developer achieves proficiency.
Is Ruby worth the investment for someone seeking a new programming
language?

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. 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. Let’s just assume reasonable intelligence,
interest and inclination to learn a new programming language. Given
that,

Is Ruby a good choice as a general usage programming language? Why (or
why not)?

On Feb 2, 2010, at 7:19 AM, Jim M. wrote:

The problem is that ANY programming language will probably require tons
of study and years of practice before a developer achieves proficiency.
Is Ruby worth the investment for someone seeking a new programming
language?

I’m far from an expert on this list, but in my two years of experience
with Ruby I’d say unequivocally yes, Ruby is worth learning. It’s
improved my programming generally.

Rails is a framework for the web written in Ruby, so if you’re coming to
this as a web developer, then Rails is an excellent introduction to
Ruby. That’s where I started and it’s branched out to where Ruby has
become my sysadmin scripting language of choice as well.

Jose

Jose Hales-Garcia
UCLA Department of Statistics
[email protected]

This was surprising to me, since my understanding is that Java and C (et
al) are
most prevalent.

It all depends on the application. For desktop apps on Linux, for
example,
you’ll find that C and C++ are the most popular. For web apps, it’s
probably
still PHP. For “The Enterprise,” it’s Java or .NET.

Is Ruby a good programming language for general purpose usage? That is,
is it worth the time and effort to become proficient?

I personally feel that every language is worth the time and effort. But
languages are what I’m into, so my opinion is slightly skewed. However,
Ruby
is tied for my favorite language, so I’d still think that it’s worth
learning.

The problem is that ANY programming language will probably require tons
of study and years of practice before a developer achieves proficiency.
Is Ruby worth the investment for someone seeking a new programming
language?

Well, again, it depends on what you want to do. Writing GUI apps in
Windows?
Yeah, Ruby will work, and would probably be more enjoyable for me than
using
.NET, but it’s probably easier to use C#. Writing web applications?
Absolutely use Ruby. Want to do some cross-platform scripting tasks?
Absolutely use Ruby. Want to put a little bit of joy and fun back in
programming? That’s Ruby. There’s other reasons, too, but those are my
main
uses.

Is Ruby a good choice as a general usage programming language? Why (or
why not)?

Well, without context, Ruby is a great language because when most people
think of OOP, they think of the C++/Java version of OOP, not Smalltalk
style
message-passing OOP.

Actually I made up the term “object-oriented”, and I can tell you I did
not

have C++ in mind.

  • Alan Kay

So if you’ve never programmed in that style, Ruby will teach you a thing
or
two. Also, (some) Ruby emphasizes meta-programming more than any
language
this side of Lisp, which is a wonderful, mind-expanding experience.

While the Rails culture is not the Ruby culture, it’s absolutely the
most
forward thinking group of people I’ve ever been involved with in terms
of
software engineering. You won’t find another community that’s more
obsessed
with Doing Things the Right Way. No other community values testing like
Rails does, for example.

Anyway, by now, I’m kind of rambling. Final word: Yes, absolutely worth
learning.

Yes, it is a good general programming language. Three main features I
have
in mind:

  • the syntax helps you expressing what you want easily and intuitively

  • high-level abstractions (from iterators/blocks to complex
    meta-programming
    features) help you breaking big problems in smaller problems without
    being
    required to introduce explicit interfaces, templates, etc.

  • test/unit and rspec help you writing a lot of tests without being
    annoyed
    by the task.

In my opinion you cannot answer the question without reasonably
“specifying
a background for the learner”. A good language should make you a better
developer everyday, helps you reading other’s code, helps you learning
about
test-driven devel, and so on. Ruby expects some background, but also
helps
you getting that background quickly.

B

On Tue, Feb 2, 2010 at 4:32 PM, Jose Hales-Garcia <

El Martes, 2 de Febrero de 2010, Marc W. escribió:

  • Python
    I don’t know the language that well. But I think that Ruby can express
    some things nicer. However they have some cool libraries such as SQL
    alchemy. (Don’t know about Ruby ORM mappers)

Sequel, ActiveRecords, DataMapper… :slight_smile:

Is Ruby a good choice as a general usage programming language? Why (or
why not)?

Ruby is an object-oriented language. If you like OOL languages, then
Ruby is perfect for you. It allows you the freedom to create without a
lot of constraints.

Ruby on Rails is not a language but a framework, much like PHP is a
language but it is also composed of different frameworks. Ruby on Rails
is a big reason why people learn Ruby, but it’s not the only reason,
just one of them.

Here are the absolute PROs to using Ruby:

  • You can setup multiple ruby installations anywhere -
    C:\ruby
    C:\ruby19
    C:\rubyisgood
    C:\myrubyisbetter
    … for multiple versions and work with all of them. It supports
    Windows, Linux, and MAC.

  • There are multiple types of ruby, each suited just for you!

Ruby EE (Enterprise Edition - non windows)
JRuby (Java compiled Ruby)
Ruby 1.8.7 (standard)
Ruby 1.9.x (latest)
etc…

  • You have multiple graphical libraries you can use, dependent
    on your style of GUI design:

FxRuby
WxRuby
Tk
Monkeybars
etc. etc. the list goes on and on

  • You have one of the biggest if not the best frameworks to use with
    Ruby on Rails and a community that is so thriving around it, that there
    is an average of 200+ emails per day just from that community alone in
    support of development and response. So, if you like web development,
    this is the right place for that.

In only one year of ruby development and 10 months of ruby on rails
development, I’ve created 3 full production web-sites, including one
paid subscription site, and a handful of console applications. I’m
working on a full-featured GUI application and having a lot of fun with
wxruby.

In other-words, you can do a lot with Ruby in a short amount of time.
There is instant gratification.

And, lastly, there are multiple testing environments for your code from
TDD to BDD with Rspec, Cucumber, etc. and not many language communities
thrive on the idea of testing - ruby does.

The CONS:

For me the cons really revolve around documentation, but mainly with the
older RDOC styles that Ruby uses. The older RDOC styles are harder to
read, IMO, compared to something like Microsoft’s MSDN library where
everything is search-able and organized in a way that I enjoy. Others
might disagree with me and feel that the older RDOC style is fine. But,
to each his own.

Versioning differences can be difficult to understand and follow unless
you are in the core mainstream hub and understand all of the nuances of
what is being changed, updated, or coerced. But, if you are new to the
language, you might not suffer from that as badly if you stick with 1.9+
as there is now a compiler for windows and you can easily install from
mac and linux.

===

Other than that, you have my take on it. I have programmed in many
different languages and Ruby is the one for me now.

I am not encouraging to learn PHP instead of Ruby, but:

<…>

PHP:
<…>
 - you never know when syntax or similar errors occur…
 So live with this risk.

What?

 - no lambda like functions

Available since PHP 5.3

<…>

Regards,
Rimantas

Ruby is a delight to program in. After spending the (short) time it
takes to grok Ruby, every other language you use will feel tedious and
limiting by comparison. You will feel like other languages are wasting
you, the programmer’s, time.

Ruby is also the rising star of the programming world. The main thing
that was holding it back–execution speed–is going to be addressed
quite well with the upcoming Ruby 2.0 release. The new version is as
fast than the closest competing language, Python.

I think everyone should know a high-level “scripting” language and a
lower-level compiled language. Ruby and Java are a good combo,
especially since you can easily use Ruby together with Java thanks to
JRuby.

What languages do you already know?

Every good programmer must know at least on scripting language.
Ruby is a good choice.

Ruby: (I’m still noob)

  • nice language. You can be productive without being proficient!
    However for very large projects you may prefer languages which have
    static typing features (which catch more errors at compile time).
    I’ve read one thread telling that Ruby is bad for large projects
    because many things can be done in different ways. If you have
    different programmers working on projects you have to think about them
    all.
    However it is at least as good as Python(?), Perl(?) and much better
    than
    PHP. So learning Ruby will never be a waste of time.

What alternatives could you learn?

PHP:

  • you can get many code
  • many (all?) hosting services provide PHP support
  • it will never die because it’s used often
  • easy to get started with
  • Basically they clone Java … But fail because PHP is slower
    and it lacks behind.

  • you never know when syntax or similar errors occur…
    So live with this risk.

  • no lambda like functions

  • projects such as Phalanger or roadsend are not widely used.
    So I think the language is kind of stalled. It’s kept alive
    because many projects are using it. But if you start learning a new
    language don’t choose PHP.

  • bash,zsh,… (shell scripting)
    You can get many tasks done with Ruby. Unless you want to use
    interactive functions in Shell I’d even recommend ruby.

  • Python
    I don’t know the language that well. But I think that Ruby can express
    some things nicer. However they have some cool libraries such as SQL
    alchemy. (Don’t know about Ruby ORM mappers)

  • Scala (based on JVM)
    If you already know Java I’d say you should at least know about it.
    I don’t know it very well. Nice: you can reuse Java libraries.

  • Haskell
    It’s cool. However it’s not that widely used. Many libraries are still
    missing. Community is small but growing.
    It’s interesting how much the small community has done.
    However it takes some time until packages are updated to run with
    latest GHC.
    However you will never have decent completion. So writing using
    foreign libraries always mean you have to dive into the type and look
    functions up yourself.

    • : no stack traces (there is monad-error library)

    • : big binaries (?). So don’t write simple scripts in it…
      +/-: it’s lazy. This can be nice and it can be hard to find bugs.
      Eg if you use
      contents <- readFile f
      writeFile f $ map (_ -> ‘x’) contents

      you should think this does what you expect:
      read a file, change each character to ‘x’ and
      write the file into the same location…
      Now Haskell is lazy. It opens the file but doesn’t read it.
      The second line truncates it so nothing is left to be read…

    When ignoring this kind of issue it’s a very powerful language.
    If your application compiles it almost always work.

HaXe:
Small community. But they get done a lot. HaXe targets C/C++, Neko,
PHP, JavaScript, ActionScript (Flash). They are working on IPhone
support etc as well (AFAIK).
It has a strong type system.
However because it’s not use by very much users you may have to write
some libraries yourself. However you can reuse them on any platform
then.

Java:

  • great IDE’s
  • many libraries (for everything you can think of?)
  • Some things are hard to learn, much xml.
    compared to Ruby you can’t just write list.map {|v| conevrt v }.
    You end up writing for loops over and over again.
    But that’s why other languages on top of JVM have been invented.

F#,C# … The way to go on Windows today (?)

C: If you want to learn about segmentation faults and what a pointer is
or if you want to do Linux kernel development you have no choice. You
have to learn this language.

Erlang: Many concurrency frameworks? Well suited to get 99% uptime
(At least they claim it…) don’t know much about it.

Lisp: I don’t know it very well. There is some movement as well. They
have webframeworks and there are dialects running on JVM as well which
indicates that the community (or parts of it) are moving as well.
http://clojure.org/.list

Be aware that a new language is being invented at least once a month.
So it depends on what you’re looking for.

I’d say you should know basics of
C (so that you know what a pointer is …)
Java (because you’ll learn about IDEs. )
Haskell (to see what can be done if you study the language for over 2
years… hehe)
PHP (kidding. PHP is only good for web development. But then I’d rather
choose Ruby)

In any case it may be faster to hire someone knowing the tool of choice
for a given task then learning the language yourself.

So in the end if you know many people knowing Ruby well. Go for it.
It will help you a lot if you can just ask your neighbor occasionally
when you’re stuck. If you want to solve a particular problem do some
research. If a solution exists take that (no matter which language it
was written in).

I hope this helps you a little bit.
Marc W.

I’m more of application developer and hacker than professional
programmer, but I’ve learned the rudiments and used to varying degree
maybe 10 languages, and dabble in many, many more, and I seem to always
checking out some new one, it’s a fascinating evolution. Learning R.
is fun and a good investment if this is what you like, the more
languages you learn, indirectly you learn more about computer
operating systems, theory, etc and the easier it is to learn new ones.
Each one has a crowd of passionate advocates. Ruby was very innovative
when it first came out, it was the first language specifically for
rapid web site development,and has been very influential, but many of
it’s best ideas have been subsumed into Java (groovy, gails) and php
(cake/php), for example. Ruby has a wonderful group of users, and
because of them it will probably continue to be very influential, but
only has a tiny market share. As an example, Twitter was founded on
Ruby, however has found not to be sufficiently scalable.

Brian W.
gOgO development, ltd
sedona,az

On Tue, Feb 2, 2010 at 3:19 PM, Jim M. [email protected] wrote:

Is Ruby a good choice as a general usage programming language? Why (or
why not)?

Quick answer: Yes.

Ruby is a more sophisticated language than either Java or C# that you
mention.
Technically Java/C# have less features, so there should be less to
learn, in
practice
that means a lot of your learning is postponed until you encounter the
various
parts of the ecosystem required to be productive.

However, you can be productive at a very early stage when learning Ruby.
Mastery
is not a requirement to get useful work done. Checkout the Ruby toolkit
Shoes or
HacketyHack to get an appreciation of what can be accomplished by
complete
novices
in Ruby.

I have over a decade of experience with Java, and the largest ruby
program I
have
written, barely tips the scales at 1000 LOC, but I still turn to Ruby
when I
need to
get stuff done. In many cases I find I am more productive in Ruby than
in
Java for
equivalent tasks.

Brian W. wrote:
[…]

As an example, Twitter was founded on
Ruby, however has found not to be sufficiently scalable.

That wasn’t the fault of Ruby. It was the fault of poor DB design, and
possibly of Rails.

Brian W.
gOgO development, ltd
sedona,az

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

As an example, Twitter was founded on Ruby, however has found not to be
sufficiently scalable.

http://highscalability.com/blog/2009/9/22/how-ravelry-scales-to-10-million-requests-using-rails.html

On Tue, Feb 2, 2010 at 11:29 AM, Brian W. [email protected] wrote:

As an example, Twitter was founded on Ruby, however has found not to be
sufficiently scalable.

I think the problems that lead Twitter to move their backend to Scala
are
more architectural than they are issues with Ruby as a language.

El Martes, 2 de Febrero de 2010, Marnen Laibow-Koser escribió:

With Ruby, I can develop better code faster than other
languages, and have more fun doing it.

I think this is one of the keys of Ruby: it’s really fun to code it.

Why not Ruby? Unless you’re doing low-level systems programming or
certain real-time applications, I can’t think of a good reason. And
even in those domains, Ruby might be a good choice as a wrapper around C
or something…

Well, when you need some features as real parallelism (various native
threads
running at same time using different CPU’s) Ruby is not a good choice
(well,
JRuby allow it thought).

Tony A. wrote:

On Tue, Feb 2, 2010 at 11:29 AM, Brian W. [email protected] wrote:

As an example, Twitter was founded on Ruby, however has found not to be
sufficiently scalable.

I think the problems that lead Twitter to move their backend to Scala
are
more architectural than they are issues with Ruby as a language.

My point exactly. And to the OP’s question:

I use Ruby because it’s better designed than virtually any other
language in common use. It’s object-oriented from the ground up (unlike
Java or C++), with a healthy dose of functional programming thrown in.
This combination is extremely powerful and expressive – not to mention
exhilarating. With Ruby, I can develop better code faster than other
languages, and have more fun doing it. It is my language of choice for
applications programming.

Why not Ruby? Unless you’re doing low-level systems programming or
certain real-time applications, I can’t think of a good reason. And
even in those domains, Ruby might be a good choice as a wrapper around C
or something…

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On 2 Feb 2010, at 20:33, Iñaki Baz C. wrote:

El Martes, 2 de Febrero de 2010, Marnen Laibow-Koser escribió:

Why not Ruby? Unless you’re doing low-level systems programming or
certain real-time applications, I can’t think of a good reason. And
even in those domains, Ruby might be a good choice as a wrapper around C
or something…

Well, when you need some features as real parallelism (various native threads
running at same time using different CPU’s) Ruby is not a good choice (well,
JRuby allow it thought).

And you’ve always got parallelism via multiple processes - often a much
saner architectural choice.

Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net

raise ArgumentError unless @reality.responds_to? :reason

On 2 Feb 2010, at 15:19, Jim M. wrote:

Is Ruby a good choice as a general usage programming language? Why (or
why not)?

Ruby is a fun language to learn and incredibly flexible to work with:
pick your favourite coding paradigm and Ruby will support it easily.
Indeed of the many languages I’ve mucked about with in three decades of
hacking it’s the one I find closest to natural language, and that makes
it ideally suited to writing simple programs that solve real-world
problems in a maintainable manner.

If you’re working in a Unix or Windows environment Ruby also meshes
quite nicely with existing libraries and the underlying operating
system. There’s some work involved but that’d be equally true in most
other high-level languages.

Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net

raise ArgumentError unless @reality.responds_to? :reason

On 2010-02-02, Jim M. [email protected] wrote:

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.

Seems plausible.

Is Ruby a good programming language for general purpose usage? That is,
is it worth the time and effort to become proficient?

I think so.

Background: I’m a pretty decent shell programmer (I wrote a book on
portable shell scripting), and a pretty decent C programmer (was on
standards
committee for quite a while, also I actually write code).

I love working in C. It’s a very comfortable language for me. However,
it’s
sort of a hassle to do some kinds of things, like string manipulation.
You
can, and if you do it carefully you can have it be both bulletproof and
reasonably efficient… But it’s a lot of work. So sometimes I like to
use
scripting languages. Obviously, I learned perl, way back when perl5
wasn’t
even out yet. I’ve also done C++ (only a little), Java (a bit more),
Objective-C (a fair bit), and a few others.

Ruby is a really pleasant language to work in. It’s expressive, and
well-suited to putting things clearly without a lot of extra verbiage.
The
language favors writing tiny little helper functions which make it easy
to express things clearly, and help you avoid repeating yourself.
The object model is clear and, well, pretty. It avoids the hassle Java
has with some things being Objects and other things being Not Really
Objects,
partially through trickery.

A big part of the fun of Ruby is that it doesn’t feel all half-baked and
rushed. It seems to attract programmers who think a lot about the
developer
experience of using an interface, rather than treating it as a checklist
of
necessary functions, haphazardly named. A strong sense of effective
style
and good conventions (the ? and ! suffixes on method names), for
instance,
makes Ruby code often much more readable.

-s

 - you never know when syntax or similar errors occur…
 So live with this risk.
What?
If you compare PHP with Java you can extend abstract classes in PHP
which will give a runtime error. I’m sure there are some PHP analysis
tools which can detect this kind of error before running your web
application.

 - no lambda like functions
Available since PHP 5.3
He thanks. I only knew about create_function.
For those who are to lazy to look it up (PHP lambda summary):
Syntax looks like this:

[static] function (/*args*/) use (&$x, $y) { /* body */ };

You can use “use” to put vars into the scope of the function body.
Note that & will create references to the var, no matter which type
its contents has. If you don’t use “use” vars which are also present
in
outer scope will be null… [static] is used to not include the $this
reference.

So maybe PHP get’s closer. Can you do this as well now?
echo new FooBar()->fun();

About parallelism: I only used ruby to run some php -l commands to check
syntax in parallel. It’s perfect for this kind of task: Create a quick
work list, start 3 threads and pop items off from that list.
That’s why I recommended learning Ruby rather than PHP. Because PHP
can’t get this job done although it is a scripting language.

Marc W.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs