Ruby as First Language

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
advance!

WY

Hi --

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?

Yes, and then some.

Will Ruby enable me to transition to other languages (ex.,
C/Assembly/etc)? Thanks in advance!

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 :slight_smile:
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?

http://www.pragmaticprogrammer.com/titles/fr_ltp/index.html

David

···

On Thu, 23 Feb 2006, woodyee wrote:

--
David A. Black (dblack@wobblini.net)
Ruby Power and Light (http://www.rubypowerandlight.com)

"Ruby for Rails" chapters now available
from Manning Early Access Program! Ruby for Rails

woodyee wrote:

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 advance!

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

Hi Woodyee, how important is this information according to your
profession?

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.

Gianfranco

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
advance!

Harvard is teaching Ruby and C in their introduction to CS, and several
other schools are starting to use Ruby. (Take a look at
O'Reilly Media - Technology and Business Training for
a bit more info -- including a URL)

For CS heavy programs it looks like Ruby is a good member of the
first set of languages. For more vocational programs it might be a
good first language. That's likely an important distinction.

with Ruby), Ruby makes sense as a first language because it allows
nearly instant gratification, encourages good habits, and provides a
good bridge to other things.

···

On 2/23/06, woodyee <wood_yee12@hotmail.com> wrote:
From my perspective (I'm teaching my 11 yo son about programming

WY

--
thanks,
-pate
-------------------------

woodyee wrote:

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
advance!

WY

I'd just like to add my two pennies - do NOT learn Ruby first. You will be spoilt, and you will get very disappointed whenever you use any other language, and yearn for Ruby all the time.

I suggest you start learning x86 assembler first, for the same reason you would bang your head against a brick wall - it's a wonderful feeling when you stop.

···

--
To reply, take of all ZIGs !!

woodyee wrote:

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
advance!

WY

Personally, I think it is a horrible first language. Let me preface
this by saying I'm a hardware guy that uses programming as needed, so
I'm not a *real* programmer.

Here is the problem. With C or even C++ I can learn a few basic
conditional statements, variable declarations, etc. and I can write just
about any program. Sure, it will be long and inefficient, but at least
I can write it without knowing any more about the language. In Ruby,
you can't do that. The key to learning Ruby is learning the numerous
methods that come with each class.

When I first started playing with Ruby, I thought I would do a typical
programming exercise and write several sort functions in Ruby (bubble,
selection, quicksort, etc.). I couldn't figure out how to do it because
all I needed was Array.sort! It is tough to find documentation on
things like for loops in Ruby, and blocks can be confusing.

I think Ruby is best for people that already have some programming
experience.

···

--
Posted via http://www.ruby-forum.com/\.

besides Ti-BASIC (i'd say that doesn't count), Ruby is my first language,
and i think that's just fine. I had to learn Java at school, and i'm very
annoyed by it's inconvenience and the fact that not everything is an object
(;-)) so i'm happy that i learned Ruby first, because i think i wouldn't
understand the OO-principle this well, if i would have learned Java first..
but that's just my opinion/vision..
Dirk.

···

2006/2/23, woodyee <wood_yee12@hotmail.com>:

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
advance!

WY

My order was Quick BASIC, then C++, PHP, then Ruby. I found the
following things:

1. Don't learn any of the BASIC family. My knowledge of this was a
severe impediment to learning C++ a few years later. It teaches you
really bad habits.

2. C++ is extremely useful to know. It provides a very good launching
point for understanding OO design while at the same time providing an
understanding of low level details of how it all works under the hood.
The easy Ruby-C(++) integration also makes this useful for speeding up
the slower parts of your Ruby code later.

3. Ruby is truly incredible in its simplicity and ease of expressing
quite complex concepts. I started using this about 3 months ago, just
before beginning my first job designing a web application. I used the
Rails platform (built on Ruby) and would choose it over PHP for web
applications any day.

After using Ruby you will feel handicapped writing in any other
language. For this reason, I would thoroughly suggest learning at least
the basics of C or C++ in parallel with Ruby. Learning two languages at
once is not nearly as daunting as it sounds as the basic concepts
translate nicely between them. After building up a basic knowledge of
each of them, you will have a nice base to launch off into the
specifics.

Please note that I am completely self taught in programming and have
never taken any formal education in any language. My experience may not
be typical.

My personal choice for application development would be Ruby, using C++
extensions for the heavy lifting. I believe it is essential to
understand both a compiled and high-level language, preferably that
integrate easily with each other, as this will let you effectively
partition tasks based on speed requirements while retaining the clean
overall logic of the higher language. For this, I believe Ruby and
C(++) are an ideal pair.

My advice to you is to get an introductory book on C++ and a book on
Ruby (the Pragmatic Programmers' guide is excellent). As you work
through the books, try to write the equivalents of the C++ examples and
the Ruby examples in the opposite language. This will rapidly teach you
both the upsides and the downsides of each language.

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
recentrambles.com

···

On Thu, 2006-02-23 at 23:14 +0900, dblack@wobblini.net wrote:

Have you seen this book?

http://www.pragmaticprogrammer.com/titles/fr_ltp/index.html

Robert Klemme wrote:

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.

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.

Cheers,
Dave

Robert Klemme wrote:

woodyee wrote:

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

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

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
helpful

python:
http://mail.python.org/pipermail/python-list/2005-October/305692.html

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).

Giacecco wrote:

Hi Woodyee, how important is this information according to your
profession?

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.

Your primary goal in learning a language is the most important criteria.

If you are looking first to get insight into programming, go learn Lisp, or enough Lisp to find your way around.

There are free videos online by Hal Abelson and Gerald Jay Sussman of their book, Structure and Interpretation of Computer Programs

http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/

The book is available online for free as well.

Then go learn Ruby.

If you are in need of vocational training, go learn Java.

Then go learn Ruby.

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.

Highly subjective observation.

···

--
James Britt

http://www.ruby-doc.org - Ruby Help & Documentation
Ruby Code & Style - The Journal By & For Rubyists
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://refreshingcities.org - Design, technology, usability

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
recentrambles.com

···

On Fri, 2006-02-24 at 02:34 +0900, pat eyler wrote:

Ruby makes sense as a first language because it allows
nearly instant gratification, encourages good habits, and provides a
good bridge to other things.

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.

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

:slight_smile:

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

Regards,

Bill

···

From: "Giacecco" <giacecco@gmail.com>

Asfand Yar Qazi wrote:

woodyee wrote:

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
advance!
WY

I'd just like to add my two pennies - do NOT learn Ruby first. You will be spoilt, and you will get very disappointed whenever you use any other language, and yearn for Ruby all the time.

I suggest you start learning x86 assembler first, for the same reason you would bang your head against a brick wall - it's a wonderful feeling when you stop.

x86 assembler is rather a mess.

In one respect, we were lucky in the old days. Both of the 1401 assembler languages were easy -- even the machine language was pretty straightforward. (It's been nearly 40 years since I last dealt with a real 1401, and nearly as long since I last dealt with an emulated one, but I could still write a self-booting program today.) It gave you a sense of the real machine that's hard to get nowadays.

···

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
   -- Charles Williams. "Judgement at Chelmsford"

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

ruby has the cleaner syntax, but i don't think it has less typing you
mean at the keyboard :slight_smile:

i find the typing to be about even.

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.

somewhere around '87 they had fully evolved to the point of no line
numbers or gotos. something like libertybasic is great for
beginners... although it' s not object oriented.

http://home.cogeco.ca/~tsummerfelt1
telnet://ventedspleen.dyndns.org

···

On Thu, 23 Feb 2006 23:18:33 +0900, you wrote:

I'm not seeing that. Ruby supports pretty much the same constructs and even index access to Arrays. Iterators are a lot sexier, but if you want to walk everything by index knock yourself out. If you don't know the helper methods, you can always roll your own code.

That doesn't make sense to me.

James Edward Gray II

···

On Feb 24, 2006, at 7:56 AM, Rob wrote:

Here is the problem. With C or even C++ I can learn a few basic
conditional statements, variable declarations, etc. and I can write just
about any program. Sure, it will be long and inefficient, but at least
I can write it without knowing any more about the language. In Ruby,
you can't do that. The key to learning Ruby is learning the numerous
methods that come with each class.

"Robert Klemme" <bob.news@gmx.net> writes:

woodyee wrote:

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 advance!

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

I don't think the vs stuff is needed. Ruby is a nice language by many
means, and the others are nice also. Of course the programmers here
have decided pro Ruby. Ruby is a good choice if you like OO, but for
that you can use Smalltalk also. Unfortunatly the Self stuff has not
get the attention it deserves, but that's things are.

If you are not used to OO, it is a task to get into it. My experiences
with OO start while learning Eiffel (now around 12 years or so ago). I
was a enthusiastic Eiffel programmer but the whole stuff around a few
actors have taken away all the fun. Now if you are a fan of static
types language which are good for building scyscrapers, you still can
go for Eiffel. But if you learn other approaches like e.g functional
programming (very much advised to learn it whther you use it or not)
you fell way to much tighthen to imperative/object-oriented stuff in
Eiffel.

An eye opener was Haskell, Ocaml, Erlang and last but not least the
Lisp family.

I like Ruby for my scripting purposes, but I write a few liners
of ugly shell code. It's nice that ruby offers quite a lot in regard
to functional programming, also the most software I've seen written in
Ruby uses the imperative / object-oriented programming style.

I found most of the code quite readable and "understandable" the
learning curve is not steep (if you know OO of course)

Regards
Friedrich

···

--
Please remove just-for-news- to reply via e-mail.

} My order was Quick BASIC, then C++, PHP, then Ruby. I found the
} following things:
}
} 1. Don't learn any of the BASIC family. My knowledge of this was a
} severe impediment to learning C++ a few years later. It teaches you
} really bad habits.

I mostly agree with this, but I will both expand and contract that
category. Most forms of Basic are, indeed, impediments to learning to
program well. This specifically includes all Visual Basic forms through VB6
and VBScript. It does not, however, include VB.NET. VB.NET is pretty much a
dialect of C#, rather than the horror that is VB6. I include Perl in this
category, however. I will name this category "Languages that play fast and
loose with syntax, types, and APIs without any coherent underlying sense."
It is because of this lack of basis that it impedes learning other
languages.

I learned AppleSoft BASIC as my first language. Thankfully, I bridged the
gap between this category of bad languages with Logo, Pascal, many years,
and puberty. I consider Logo an excellent first language, and not just for
moving the turtle around to make pretty pictures.

} 2. C++ is extremely useful to know. It provides a very good launching
} point for understanding OO design while at the same time providing an
} understanding of low level details of how it all works under the hood.
} The easy Ruby-C(++) integration also makes this useful for speeding up
} the slower parts of your Ruby code later.

C should be learned before C++. Everything useful and powerful about C++
(other than employability) is brought into sharp relief by contrasting it
with C. I don't think it is a good language for learning OOP, however. C++
is slightly better at providing OO features than straight C (yes, I'm
serious), but its real power lies in its libraries and its facilities for
generic programming (i.e. templates).

} 3. Ruby is truly incredible in its simplicity and ease of expressing
} quite complex concepts. I started using this about 3 months ago, just
} before beginning my first job designing a web application. I used the
} Rails platform (built on Ruby) and would choose it over PHP for web
} applications any day.

Ruby is great. Rah rah rah. I mean, it's true, but you aren't going to get
much dissent about it on this list.

} After using Ruby you will feel handicapped writing in any other
} language. For this reason, I would thoroughly suggest learning at least
} the basics of C or C++ in parallel with Ruby. Learning two languages at
} once is not nearly as daunting as it sounds as the basic concepts
} translate nicely between them. After building up a basic knowledge of
} each of them, you will have a nice base to launch off into the
} specifics.

I've said it before and I'll say it again. Learning your first language is
*hard* because you are also learning concepts of programming. Learning your
second language is somewhat difficult because you will spend most of your
time thinking in your first language and trying to translate that to the
second, and often getting hung up on syntax. Learning your second paradigm
is *hard* because you must make your brain think in a way that it hasn't
before. Learning your third, fourth, or fifth languages is a bit of a
challenge. Learning your tenth language is a weekend of geekiness. Learning
your twentieth language is a day of playing around.

I think the ideal progression of learning languages would be:

1) Logo as a preteen, or AWK and/or Bourne shell scripting at any age
2) C (second procedural language)
3) Ruby, Python, Java, or C# (first OOP language)
4) C++ (kitchen sink language)
5) Scheme, Haskell, or ML (not OCAML) (first functional language)
6) SQL (first declarative language)
7,8,9) Whichever of Ruby, Python, Java, and C# has been missed previously
10+) Anything at all

} Please note that I am completely self taught in programming and have
} never taken any formal education in any language. My experience may not
} be typical.

I learned BASIC, Logo, and Pascal on my own. I took a high school CS course
which used Pascal, so what I learned was good programming. I learned C,
C++, Bourne shell scripting, and AWK before entering college.

In college, as part of a CS major, I learned (in no particular order) Lisp,
ML, SQL, Java, make (fantastic declarative language, BTW), and lexx/yacc.
Outside of coursework, I also learned JavaScript, a bit of AppleScript,
VRML (both 1.0 and 2.0, but 2.0 was sort of a dataflow language), and just
enough Perl to modify other people's scripts while hating it.

In grad school I taught C++, both as a TA for the software engineering
class and in a week-long minicourse; this meant that I had to learn it
deeply, and I learned to appreciate its subtlety, power, and specific
safety nets. (I could go into the relative advantages and disadvantages of
C++ for pages. I will spare you all.)

} My personal choice for application development would be Ruby, using C++
} extensions for the heavy lifting. I believe it is essential to
} understand both a compiled and high-level language, preferably that
} integrate easily with each other, as this will let you effectively
} partition tasks based on speed requirements while retaining the clean
} overall logic of the higher language. For this, I believe Ruby and
} C(++) are an ideal pair.

The right tool for the right job. Ruby is nearly the same size and shape
tool as Perl and Python. It is good for many of the same things. In
addition, Rails makes Ruby ideal for standalone, database-backed web apps.
For a GUI app, however, I would choose C++ and Qt/KDE or C#. For a major
enterprise app (e.g. the mission-critical, proprietary, special-purpose,
in-house application with which a company performs its work, such as the
retirement management software I am working on now for an actuarial firm) I
would choose C#. For a numerically intensive application, particularly one
that is paralellizable, I would use C. For simple scripts I continue to use
Bourne shell and/or AWK.

The really valuable thing about knowing lots of languages is that you can
think flexibly and work efficiently. Granted, I haven't found a use for a
functional language for ages, but I've certainly use functional idioms that
would not have occurred to me if I hadn't learned a couple of functional
languages. My dayjob involves programming VB.NET, but you better believe I
use a variety of other languages (particularly SQL, AWK, and Bourne shell
scripting) to aid me in my work. Furthermore, I take great joy in playing
with Ruby (and Rails in particular) and JavaScript on the side.

} My advice to you is to get an introductory book on C++ and a book on
} Ruby (the Pragmatic Programmers' guide is excellent). As you work
} through the books, try to write the equivalents of the C++ examples and
} the Ruby examples in the opposite language. This will rapidly teach you
} both the upsides and the downsides of each language.

Gah! I could not disagree more. Learning more than one language at a time
is a recipe for confusion. My advice is to choose a simple toy task that
you will attempt to implement in each language you learn. For many years I
used an abacus (which I implemented in Java 1.0, Java 1.1, VRML 1.0 w/ CGI,
VRML 2.0, C++, and JavaScript/DHTML). For BASIC, Pascal, and C I used a
simple bubblesort. For Ruby (and Rails) I used a Firefox "live bookmark"
generator <http://www.anthropohedron.net/bookmarkfeeds/>.

Start with shell scripting and awk. There are excellent books on it out
there, the technology isn't changing, and you can keep pretty much the
entire language in your head. Failing that, there are good man pages. If
you are on Windows, get Cygwin. If you want to jump straight into Ruby from
there, well, that's almost as good as the progression of languages I listed
above.

For someone who is starting out with no programming experience, I consider
Why's Poignant Guide to be the best introductory Ruby text out there. Yes,
really. It introduces concepts gently and humorously.

--Greg

···

On Sat, Feb 25, 2006 at 08:13:34AM +0900, Timothy Goddard wrote: