[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby as First Language

woodyee

2/23/2006 2:08:00 PM

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

45 Answers

dblack

2/23/2006 2:14:00 PM

0

Robert Klemme

2/23/2006 2:15:00 PM

0

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

Charlie Bowman

2/23/2006 2:18:00 PM

0

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

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

Dave Burt

2/23/2006 3:01:00 PM

0

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


Gene Tani

2/23/2006 3:17:00 PM

0


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/3...

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

2/23/2006 3:18:00 PM

0

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

Robert Klemme

2/23/2006 3:26:00 PM

0

Gene Tani wrote:
> 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

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

Robert Klemme

2/23/2006 3:31:00 PM

0

Dave Burt wrote:
> 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?

I forgot that. Yeah, with DL it seems reasonably easy. Good point!

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

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

> Learning a second language will be significantly easier after you've
> learnt one already, almost regardless of the language.

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

> Choose Ruby.

Definitively! :-)

robert

James Herdman

2/23/2006 4:10:00 PM

0

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.

Robert Klemme

2/23/2006 4:28:00 PM

0

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

That's precisely the point where we disagree. :-)

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

It won't teach you anything about methods because there are none in C. :-)

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

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

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

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

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