Ruby as First Language

Discussion in 'Ruby' started by woodyee, Feb 23, 2006.

  1. woodyee

    woodyee Guest

    Hi! I'm interested in getting opinions on Ruby as a first language. For
    example, how it compares to python/perl/basic/etc as a first language.
    My goals are to learn the basics of a language, then delve into network
    programming, and then learn how to interact with the operating system
    programaticallly. Will Ruby help me achieve this goal? Will Ruby enable
    me to transition to other languages (ex., C/Assembly/etc)? Thanks in

    woodyee, Feb 23, 2006
    1. Advertisements

  2. woodyee

    dblack Guest

    Hi --

    Yes, and then some.
    It won't cause you to know those other languages of course, but it
    will enable you to learn them in the sense that it won't stop you :)
    And C actually connects up naturally with Ruby, since Ruby is written
    in C and you can write C extensions for Ruby.

    Have you seen this book?


    David A. Black ()
    Ruby Power and Light (

    "Ruby for Rails" chapters now available
    from Manning Early Access Program!
    dblack, Feb 23, 2006
    1. Advertisements

  3. Ruby vs. Perl: much cleaner syntax and less typing.

    Ruby vs. Basic: although there might be Basic dialects around that have
    evolved from the ridiculous line number + GOTO I'd rather not consider it.

    Ruby vs. Python: can't comment on that.

    Ruby takes away a lot of the nifty details that you would have to deal
    with in C or C++ (memory management etc.) or Perl (how many $'s do I need
    here?). OTOH there is no *direct* access to system libs (as from C for
    example). For that you would have to write a C extension. Still, I think
    to initially learn to develop software Ruby is a pretty good choice.

    Kind regards

    Robert Klemme, Feb 23, 2006
  4. --=-TpE+hqRiu7EohiA+v2LD
    Content-Type: text/plain
    Content-Transfer-Encoding: 7bit

    I wish I had that book when I first started programming. That book
    changed my way of thinking about code more than any other book! Be
    warned....If you learn ruby first then you'll hate the syntax of just
    about every other language!

    Charlie Bowman

    Charlie Bowman, Feb 23, 2006
  5. woodyee

    Dave Burt Guest

    Just to knock down your only negative point a little, Robert, there is DL,
    which makes accessing C libraries about equal in pain to doing it in C, no?

    Me, I'm all for learning Ruby as a first language. My first language was
    Basic, and I do reckon that it probably doesn't matter too much what you
    pick, but an important factor is being able to actually produce something
    cool/fun/useful as you go. (Games, for instance.) Learning a second language
    will be significantly easier after you've learnt one already, almost
    regardless of the language.

    Ruby's productive, flexible, and crosses paradigms other languages are built
    around. Perhaps it's less simple than, say, Java or Basic, but I think it
    more than makes up for it in the
    being-able-to-get-something-done-quickly-and-easily department. The
    paradigm-crossingness of it may mean it's easier to pick up a wider range of
    languages after you've mastered Ruby; it's a bit like Lisp, a bit like
    Basic, a bit like Java.

    Choose Ruby.

    Dave Burt, Feb 23, 2006
  6. woodyee

    Gene Tani Guest

    Perl has gotten a bad rap, well-written perl is pretty easy to follow.
    Also perl's kind of hard to avoid, in certain circles, lots of times i
    start somethign by reading CPAN modules, lots of OReilly books have
    sample code in perl, etc. so at least being able to read perl code is


    ruby has a couple really nice IDEs, komodo and Arachno, which make
    learning as painless as possible, popping up method names for you to
    click on when the IDE can determine what object instance you're talking
    about. (Wing IDE for python is also really nice).
    Gene Tani, Feb 23, 2006
  7. woodyee

    Giacecco Guest

    Hi Woodyee, how important is this information according to your

    If you're doing this for yourself, Ruby will be a great language to
    learn and use.

    But if you are doing this to revise your position in the job market,
    none of the languages you listed will give you much advantage: it's
    Java and/or C# to be obligatory these days in any curriculum.

    I am certain that Ruby will grow a lot in the next years and things
    will change, but if you have to decide today, and it is for your job,
    Ruby is still too weak.

    Giacecco, Feb 23, 2006
  8. Yes, but this thread is about "first language". I don't know how Perl's
    OO has changed since Perl 5 but then it was horrible. Certainly nothing
    I'd recommend for learning OO - I'd definitely choose even C++ and of
    course Java / C# over Perl for OO.

    Kind regards

    Robert Klemme, Feb 23, 2006
  9. I forgot that. Yeah, with DL it seems reasonably easy. Good point!
    I wouldn't go that far. For example, at the time I was using BASIC there
    were no functions and you had to work with GOSUB and GOTO for
    modularization; for me this is a major drawback. I rather recommend to
    use PASCAL (no kidding) over ancient BASIC's. I know current BASIC
    dialects are much better - but then again, there are so many of them...
    I'm not sure; it certainly helps, but I guess the paradigmatic distance
    (TM) of the second language makes a difference. I guess it's easier to go
    from C++ to SmallTalk (both OO) than from Lisp to BASIC...
    Definitively! :)

    Robert Klemme, Feb 23, 2006
  10. woodyee

    James H. Guest

    But more importantly, *should* Ruby be a first language taught, period?
    I tend to think no.

    C allows you to have a base understanding of all the technical aspects
    of programming, like memory management, procedural thought, and the
    basics of writing methods. These are generally good skills to have,
    and you'll find that you use them everywhere. C is a lot like latin,
    insofar that it's not changing much, and is used to communicate ideas.
    I also think it's a little more "native" to initial human understanding
    about programming. People tend to think of it as a linear, or
    semi-cyclical set of instructions. In that regard, I think C is a good
    way to enter the scene.

    The thought process overhead in object oriented programming is quite
    extensive. It takes a long time to really get in the mode. If you
    learn somethings about C, and get a basic grasp before moving on to
    Ruby, you'll understand and have a better appreciation for some of the
    "magic" going on behind the scenes, as well as opening other avenues
    for your programming career. Doubly, it takes a long time to learn how
    to think in objects -- something I admit, myself, to just be getting
    the hang of. When you start reading about design patterns, you realize
    the complexity, and beauty that OOP allows you.

    If the original poster decides to forgo C for Ruby in the time being, I
    hope the poster eventually returns to it, if even just to have a base
    understanding of what's going on beneath the scenes.
    James H., Feb 23, 2006
  11. That's precisely the point where we disagree. :)
    It won't teach you anything about methods because there are none in C. :)
    I use UML to communicate ideas - or Ruby - but certainly not C. I don't
    think it's suited for this at all. There's too much overhead.
    Even if you want to start with a strictly procedural language I'd strongly
    favour Pascal over C exactly because those detailed technical aspects are
    *not* present there. Getting memory allocation and pointer handling right
    is difficult for a novice and prevents early successes. IMHO it's far
    more important to grasp abstract concepts that are common to many
    programming languages (like abstraction, modularization, data structures)
    than to know how to not shoot yourself in the foot when doing *ptr++.
    Although I agree with your last paragraph (that OO is more difficult to
    grasp than the procedural paradigma) I strongly disagree with what you
    state in the first paragraph. If you like to, you can use Ruby
    procedurally most of the time.

    Kind regards

    Robert Klemme, Feb 23, 2006
  12. woodyee

    James H. Guest

    C allows you to have a base understanding of all the technical aspects
    Ah, yes. I have a bad habit of using procedure and method
    interchangably =/

    Interesting point about Pascal though, and when I read your words I
    find myself nodding my head in agreement that it is definitely more
    important to understand the concepts found amongst the majority of
    programming languages than the specifics of one (e.g. pointers -- one
    of the great evils of C).

    Okay, how about this: "If you decide to use Ruby as a first language,
    it would be wise to learn C later down the road given it's widespread
    usage". Does that make more sense?

    James H., Feb 23, 2006
  13. Object and Turbo Pascal took the language nicely into the realm of
    OO. It's still a great way to learn how to program - and even after
    all of these years, I still can't understand why nearly all major
    Universities (in the US anyway) have abandoned it completely.

    Stephen Waits, Feb 23, 2006
  14. Is the "C widespread usage" still true, by the way? I admit it is
    still necessary to master C to write extension modules or low level
    software, but should this application domain called "widespread" ?
    Eric Jacoboni, Feb 23, 2006
  15. Certainly! C might not be for everyone but if mastered certainly helps
    understanding basic issues about how programs, processors and operating
    systems interact.

    Kind regards

    Robert Klemme, Feb 23, 2006
  16. woodyee

    James H. Guest

    The OS you're using is likely written in a combination of C and C++ ;)
    There are tonnes of legacy systems written in C too. You can't forget
    James H., Feb 23, 2006
  17. --=-F83GHtiTbb9vg7hTJQoC
    Content-Type: text/plain
    Content-Transfer-Encoding: 7bit

    That's such a good point. I'm a self taught programmer and my first
    language was perl. Without anyone to point me in the right direction, I
    developed some pretty bad habbits. You can still pick up bad habbits
    using ruby, but it's less likely.

    charlie bowman

    Charlie Bowman, Feb 23, 2006
  18. woodyee

    Glen Guest

    I think there are two flaws in your argument.

    1) Your experience does not set the standard for everyone else.

    2) I assume you started with a language similar to C (or at least
    procedural), and then learned OO. Because it took you a long time to
    fully grasp OO, you think it is best to start with a procedural
    language. ?? Is there no possibility that it took you longer to grasp
    OO *because* you started with a procedural language?

    I was taught both procedural and OO in college, and did not experience
    the difficulties you mention.

    Alan Shalloway, one of the authors of "Design Patterns Explained"
    argues that avoiding design patterns makes it harder to learn them
    object-oriented design. Instead, he introduces his students to
    object-oriented design *and* design patterns and has found the students
    learn object-oriented design faster.

    Quote from preface in book:
    "The design pattern books I had been reading and the design pattern
    experts I had been talking to were saying that you really needed to
    have a good grounding in object-oriented design before embarking on a
    study of design patterns. Nevertheless, I saw, with my own eyes,
    students who learned object-oriented design concurrently with design
    patterns learned object-oriented design faster than those just studying
    object-oriented design. They even seemed to learn design patterns at
    almost the same rate as experienced object-oriented practitioners."

    If experience can be used to draw conclusions, I would trust his
    experience with a larger test set over yours.
    Glen, Feb 23, 2006
  19. woodyee

    Bill Kelly Guest

    It should be noted that many people here are using ruby for our jobs.


    It's true Ruby isn't suited to every task, but it's working for a lot
    of us.


    Bill Kelly, Feb 23, 2006
  20. --=-hj6XWEFNCfacc0QzcWDS
    Content-Type: text/plain
    Content-Transfer-Encoding: 7bit

    If you plan on working on the web, you should definitely make sure that
    ruby is in your tool belt.

    Charlie Bowman, Feb 23, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.