Ruby as First Language

“Glen” [email protected] writes:

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?
This is definitly a problem for “imperative” programmers. Therefor I
would tend to judge C++ quite negativly. You can write C with a C++
compiler but that does not make for “OO” Programming…

Regards
Friedrich

Rob wrote:

I found it very difficult to learn because I spent too much
time looking for certain methods in the Ruby book.

This is a big problem for a lot of programmers. We’ve had Visual Basic
programmers looking for the on error gosub handler because that is
all they know and have become incapable of learning anything new. I’ve
seen Cobol written in Perl by Cobol programmers who just couldn’t learn
anything new. We’ve had C programmers have fits because they couldn’t
use the pre / post
increment / decrement operators that they used in C and -= and += was
too hard to learn.

You get the picture. Take a deep breath and forget you ever knew C then
try again, prior expectations can be a real hindrance when learning
something new.

“Robert K.” [email protected] writes:

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

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.

2006/2/23, woodyee [email protected]:

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

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.

Rob wrote:

Don’t get me wrong. I love Ruby. It’s just that as a mediocre
programmer, I found it very difficult to learn because I spent too much
time looking for certain methods in the Ruby book. Sometimes it is
easier for beginners to move forward when they don’t have 10 different
options for how to do something.

Perfectly said.

Wittgenstein’s Ladder. http://c2.com/cgi/wiki?WittgensteinsLadder

Training wheels, training wheels, training wheels.

Everybody needs 'em when starting out in a new area. I need 'em. Big
time. Especially as I start watching the SiCP LISP videos. And I have
some past experience hacking around with Python. Though with my
background it looked more like object-oriented VBScript.

God help me.

Just my $.02.

-dave

On Sat, Feb 25, 2006 at 08:13:34AM +0900, Timothy G. wrote:
} 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 2/25/06, Chris P. [email protected] wrote:

I have written a tutorial, and recently a book, lovingly and
painstakingly built over the last three years, aimed at teaching
programming, using Ruby, to non-programmers. So I’m totally,
hopelessly biased here…

Chris, I really enjoyed your book. The exercises are well thought out
and practical.
The lessons build knowledge in a logical manner. When you are finished
the
book you feel “learned”, I’ve been subconsciously buying tween blazers
ever since.

I am a big, really big big… not even in a strictly volume sense, I’m
talking mass…
ridiculously humongous fan of the Poignant Guide.

However I found the actual lesson material was not always as thorough
as I would like, and there are no exercises. I don’t think I will ever
forget the forklift, or the caterpillar but _why’s book is not really
for a new programmer, unless they
are really strange/wonderful/interesting/open minded type people or
unless
they have just finished reading your book :wink:

I think normal[1] folk will probably find _why’s guide too distracting.

I think the books add to each other. _why’s guide is very entertaining
and fun. Your
guide is very practical. Both guides will teach you a lot and we as a
community are far richer for having both to read.

Thanks Chris, and thanks _why.

[1]People who know how to send email and download music, but not much
else.

On 2/25/06, Gregory S. [email protected] wrote:

  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)

No way. :slight_smile: Ruby before C, any day. It’s really not an issue of
“procedural is easier than OOP”. You can do procedural Ruby, and it’s
so so so so so much easier. The aspiring programmer will be able to
do so much more after their first half-hour lesson. This is
motivating. A motivated student learns faster, retains more (longer),
and most importantly, is less likely to quit! (You wouldn’t believe
how often I hear people saying, “I’ve tried to learn to program over
and over again, but never got into it… until Ruby!”)

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.

GIANT HONKING DISCLAIMER:

I have written a tutorial, and recently a book, lovingly and
painstakingly built over the last three years, aimed at teaching
programming, using Ruby, to non-programmers. So I’m totally,
hopelessly biased here…

And I’d also like to say that I absolutely love the Poignant Guide
and, as a programmer, I’d much rather read it than my own writings.
Chunky! Bacon! (Seriously. Chunky bacon.) How can one not fall
in love with Why instantly? I have personally had an asthma attack
from laughing too hard reading his sidebar dissing asthmatics. His
insight and sensitivity were… (must not say breath-taking…
resist…) um… good.

I totally and sincerely believe that the world is a better, brighter,
more love-filled place now that the Poignant Guide is in it. I do.

However, having said that, I really don’t think that the Poignant
Guide is the way for a non-programmer to learn programming. Do you
personally know of any non-programmers learning to program from
reading it?

I mean, I feel bad saying that… dude, I love it, too! But, for all
it is, I just don’t honestly believe that it meets the
non-programmer’s needs.

But as I mentioned, I’m so hopelessly and completely biased… you
should probably take everything I say with 200 parts salt, 1 part
Chris.

:slight_smile:

Chris

On 2/25/06, Alex C. [email protected] wrote:

ever since.
Chris, I am presently enjoying your book.

I am a big, really big big… not even in a strictly volume sense, I’m
talking mass…
ridiculously humongous fan of the Poignant Guide.

me too!

However I found the actual lesson material was not always as thorough
as I would like, and there are no exercises. I don’t think I will ever
forget the forklift, or the caterpillar but _why’s book is not really
for a new programmer, unless they
are really strange/wonderful/interesting/open minded type people or unless
they have just finished reading your book :wink:

I think normal[1] folk will probably find _why’s guide too distracting.

This depends. I have them both. I printed out Why’s guide, and I
also purchased both the PDF and dead tree copy of Chris P.'s Learn
to Program book.

As I’ve said publicly in other places… Why was one of two things
when he write the Poignant Guide… he was either 1. VERY stoned. or
2. VERY much a genius.

Let me qualify. Chris wrote a VERY good book with excellent examples.
Why uses crazy techniques and you think the guy is all over the map.

This will sound painfully obvious… but if it were, schools would be
MUCH different than they are today.

People do NOT learn the same. Let me say that again… people do NOT
learn the same. One person may learn the most from the traditional
‘teacher talk - student listen’ model. That is what the VAST majority
of our schools still believe and practice to this day.

There was a man named Howard Gardner [2] that came up with the theory
of multiple intelligences. In a nutshell, many different methods of
learning… and if you’re trying to teach someone a subject in a
manner that doesn’t match what their learning style is, you’re missing
the mark!!!

This is where I think Why has it right on, and where I think Chris
might benefit in doing a little research and seeing if he wants to
implement some of these things in his next book.

A present day example would be the Head First series that O’Reilly &
Associates is doing.

I think the books add to each other. _why’s guide is very entertaining
and fun. Your
guide is very practical. Both guides will teach you a lot and we as a
community are far richer for having both to read.

AMEN!

Thanks Chris, and thanks _why.

[1]People who know how to send email and download music, but not much else.


Alex C.
http://noodlejunkie.blogspot.com

[2] http://rubyurl.com/g2V

Dave C. wrote:

Okay, now I have to pull this one out. See if listening to this one
makes your head explode. :slight_smile:

http://www.aoe.vt.edu/~cdhall/Space/AFGUID.wav

I apologize for noise but I have to say thanks for that link. My
girlfiend ask me what goes on in my brain while I am reading/writing
code - I played that for her and I am positive she will not try to learn
how to code. Another soul saved…

On Fri, 2006-02-24 at 01:27 +0900, James B. wrote:

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

Project MAC Home Page

The book is available online for free as well.

And if you want to convert those videos to sound files to listen to
during your commute, here’s how:

http://tomcopeland.blogs.com/juniordeveloper/2006/02/mp4_to_mp3_one_.html

I’m on lecture 8 at the moment… good stuff!

Yours,

Tom