Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Should I Learn Ruby as a First Language?

40 views
Skip to first unread message

MRH

unread,
May 28, 2008, 8:43:06 AM5/28/08
to
Hello Group,

I realize this question has been previously asked in different boards,
however, I believe that it is worth asking here owing to the level of
expertise present.

I am a beginner in programming. I have read some fundamental theory
material and mucked around a bit, and now want to move into actually
learning programming and my first language.

Throughout my research into this question, I have seen that the more
credible sources recommend either Python or Ruby, and I am personally
leaning quite heavily toward Ruby, yet I would very much like to read
the thoughts of the group on this question.

Thanking everyone beforehand,

Maurice

Message has been deleted

David Masover

unread,
May 28, 2008, 9:04:13 AM5/28/08
to
On Wednesday 28 May 2008 07:45:00 MRH wrote:
> Throughout my research into this question, I have seen that the more
> credible sources recommend either Python or Ruby, and I am personally
> leaning quite heavily toward Ruby, yet I would very much like to read
> the thoughts of the group on this question.

Depends what you want to do, and how far you want to go.

For a first language, either Python or Ruby are fine. Python has stricter
syntax, but I suspect Ruby has stricter concepts (of OO, etc). I find Ruby
easier to read, but that's an opinion.

If you want to get a good concept of programming in general, you should learn
(and develop at least some small apps in) a variety of languages -- and a
variety of very different languages.

So, at least one language low-level enough not to do garbage collection (C,
ASM, etc), at least one high-level "scripting" language (Ruby, Python, Perl,
JavaScript), at least one purely functional language (Haskell), and I'll
throw in LISP and either Erlang or Smalltalk.

I'm not sure it matters what order you do this in -- pick whichever has the
best absolute beginner books. I would suggest a tight feedback loop for
learning, though -- look for interactive interpreter shells (Python, IRB),
and avoid compilers (C, C++, Java).

And others will have other lists.

If you don't have that kind of attention span, or if you're looking to learn
what it takes to get stuff done now, that depends very much on what you want
to do. For example, if you're planning to do game development, you're
probably going to have to know C++, and definitely at least C. If you're just
looking to automate some high-level tasks on Unix, learn Bash. And so on.

Mark Wilden

unread,
May 28, 2008, 9:25:58 AM5/28/08
to
On May 28, 2008, at 6:01 AM, Tobias Weber wrote:

> But my real advice is to find a problem you really care about, than
> look
> which language has the best library for it, and go with that. You
> won't
> learn anything from example code in books.

That is such good advice. Programming and cooking are two areas in
which you can both learn and benefit from the result.

///ark

Dave Bass

unread,
May 28, 2008, 9:39:19 AM5/28/08
to
MRH wrote:
> I am a beginner in programming. I have read some fundamental theory
> material and mucked around a bit, and now want to move into actually
> learning programming and my first language.

Once upon a time I used to teach C as a first programming language. In
some ways it's good, as it's close to the hardware (bits and bytes,
addresses and pointers etc) but in many other ways this can be a
disadvantage, as you can't see the wood for the trees. However, it
certainly makes you appreciate higher-level languages when you come
across them later on!

Java now seems to be the first language of choice for many universities,
but I would have to disagree with that.

Ruby is much nicer than Java and it will teach you plenty of OO
concepts.

However, there's no such thing as the "best" language, so you should
concentrate on mastering one, then go on to your next.
--
Posted via http://www.ruby-forum.com/.

Elizabeth Barnwell

unread,
May 28, 2008, 11:36:28 AM5/28/08
to

Hi Maurice,

I'm new to this as well. Here's a link to a resource that can maybe
help you find/learn ruby info - (there are a lot of others up there if
you just search) http://www.yoyobrain.com/cardboxes/preview/103

I hope it helps! Let me know what you think about it too.

Best,

Elizabeth

forgottenwizard

unread,
May 28, 2008, 12:32:44 PM5/28/08
to
On 22:04 Wed 28 May , David Masover wrote:
> I'm not sure it matters what order you do this in -- pick whichever has the
> best absolute beginner books. I would suggest a tight feedback loop for
> learning, though -- look for interactive interpreter shells (Python, IRB),
> and avoid compilers (C, C++, Java).

Actually, TinyCC has a C interpreter that you can use to test code, so
there isn't much need to compile when you are using it.

I believe there is a Windows and a *nix version, so there shouldn't be a
problem with platforms.


Mike Kasick

unread,
May 28, 2008, 1:47:25 PM5/28/08
to
On Wed, May 28, 2008 at 09:45:00PM +0900, MRH wrote:

> Throughout my research into this question, I have seen that the more
> credible sources recommend either Python or Ruby, and I am personally
> leaning quite heavily toward Ruby, yet I would very much like to read the
> thoughts of the group on this question.

I usually lump beginner programmers into one of two categories, (i) those
who want to become expert programmers for purposes of education,
profession, or hobby, and (ii) those who are interested in learning how to
program sufficiently enough to make work in their primary careers easier,
but don't necessarilly have a specific interest in programming itself.

If you're of the former category, I would say it doesn't really matter what
lanaguage you learn first since you will inevitably learn multiple
languages anyways. Remember that a master programmer is not someone who
expertly understands the minutiae of any single language, but rather is
someone who is proficient in many languages. This is largely due to the
fact that all programming languages seek to achieve that same high-level
goal--enable programmers to use a machine to perform computation--and yet
each language achieves this goal in a different and nuanced way. It's
the understanding of these nuances, and why they exist, that paints the
overall picture.

That said, there are a lot of languages out there that are complicated or
even cumbersome because they attempt to be sufficiently general as to allow
any "style" of programming without enforcing too strict of rules as to what
code should look like. Perhaps the best example of this phenomenon is C++,
and to a lesser extent Perl. I express caution in learning these languages
as first languages, since, as a novice programmer you don't really have an
intuition for what code should look like, and the language doesn't really
help guide you in learning either.

Ruby is guilty of a similar phenomenon which, in this context, goes by the
name of "expressiveness". While Ruby is certainly my favorite language, I
know that part of my appreciation for this expressiveness comes from over a
decade of experience in other languages and being able to place Ruby in
the context of this experience.

In other words, I'm not really sure if Ruby is the best, or even a good
language for beginners because I'm not sure how difficult it is to learn
without the benefit of experience. On the other hand, plenty of people
have learned Ruby as their first language and have gone on to recommend it
to others, so it's certainly possible, and probably not a bad choice
either.

That said, keep in mind that Ruby is a bit unique compared to other popular
languages. For example, the idiom of using internal iterators and blocks
as looping constructions (e.g., Enumerable#each) is unlike the usual
approach of using a for loop and/or external iterator as you would use in
C, C++, Java, or Python. While I think Ruby's approach is better, it is
not the norm in other languages. Another example is Ruby's idiom of
automatic allocation and deallocation of resources by passing them to code
blocks (e.g., File#open). In other languages, one typically has to
explicitly deallocate the resource (close the file) and the code for
writing this safely is not intuitive.

This brings up another advantage/disadvantage of learning Ruby first: code
safetyness. One example of this is the resource allocation/deallocation
idiom I mentioned above that ensures that resources are always properly
cleaned up when the program is finished with their use. Another is that
most methods raise an exception upon encountering an error, forcing a
program to abort is an unexpected error happens.

Exceptions are good, and they're prominent in other languages (Java and
Python) and behave, more or less in the same way. Unfortunately some
popular languages implement exceptions (C++ and Perl) but don't use them
universally in library functions, and other languages (C) don't implement
them at all. In these languages, you must (or at least should) check
return values of any function you call to make sure that the desired action
performed successfully. Often times people forget to do this, and the
result is code that continues on ignoring error conditions, usually blowing
up somewhere else where it's difficult to debug.

So, while I regard these features as advantages of Ruby, they are, in some
sense a disadvantage when you attempt to learn a different language that
doesn't take care of these issues for you, as you must be diligent in
taking care of them yourself and it's not something you're used to.

Anyways, the crux of my advice is this: Any language that you're
enthralled by, and can't get enough of, is a good (first) language to
learn. On the other hand, any language that you find bewildering,
confusing, or just plain unfun to learn is probably not a good first
language candidate. If you find youself becoming disinterested after
spending a week or two learning whatever language you choose, skip it and
move on to something else. It may take a while to find the language that
fits, but trial and error is better than giving up on programming
entirely--especially when the language that clicks with you is right around
the corner.

Briefly getting back to the other category of beginner programmers, those
that are not particularly interested in programming itself but recognize
that some proficiency is beneficial for getting their work done--if you're
only going to learn one language and you're not sure which, both Python and
Ruby are reasonable choices. The argument is that since you're only going
to learn one language, you might as well learn one that's useful enough to
enable you to accomplish a wide variety of tasks, and one that's popular
enough that there are many libraries, tutorials, and resources available
for helping you get the job done. Python might be a bit superior with
regard to popularity, at least in the English speaking community. At one
time Perl was much more so, but I wouldn't consider any beneift in greater
popularity of Perl to be worth the pain of having to deal with it's
obtuseness.

Kyle Schmitt

unread,
May 28, 2008, 2:36:30 PM5/28/08
to
Since nobody's posted it...
http://xkcd.com/409/

Ruby is an awesome language, highly abstracted from the hardware,
incredibly flexible and fluid, and probably not a good first language
just for those reasons alone.

Learn C first.

To really get programming, to understand what's going on, you need to
go deep. All the way down to C (though some say assembler).

C is the lingua franca of computers. It doesn't make things easy for
you, it doesn't make things pretty, or necessarily intuitive, but it
does bring you right down to the metal in the end.

It isn't flexible, when you have to tell it to do something, you have
to tell it exactly what to do, And C will do it, even if it's not a
good idea, even if it crashes.
You grab your own memory, and are responsible for putting it back.
You make and move pointers to access the memory: if you point to the
wrong place, you'll get the wrong data, corrupt your own program, and
probably crash it.
You've got to link your own binaries, and link them to the right libraries.

And doing all that makes you a better programmer, makes you understand
what really is going on behind the scenes. Not to mention makes you
appreciate languages like ruby, perl, python and java so much more
when you get to them :)

I don't think you necessarily should program your first projects in C,
but you should learn C as a first language, even if you don't use it
for your first projects. Even if you never use it outside of studying
it.

--Kyle

Rodrigo Bermejo

unread,
May 28, 2008, 2:55:12 PM5/28/08
to
Mike Kasick wrote:
> On Wed, May 28, 2008 at 09:45:00PM +0900, MRH wrote:
>

> I usually lump beginner programmers into one of two categories, (i)
> those
> who want to become expert programmers for purposes of education,
> profession, or hobby, and (ii) those who are interested in learning how
> to
> program sufficiently enough to make work in their primary careers
> easier,
> but don't necessarilly have a specific interest in programming itself.
>
> If you're of the former category, I would say it doesn't really matter
> what
> lanaguage you learn first since you will inevitably learn multiple
> languages anyways. Remember that a master programmer is not someone who
> expertly understands the minutiae of any single language, but rather is
> someone who is proficient in many languages. This is largely due to the
> fact that all programming languages seek to achieve that same high-level
> goal--enable programmers to use a machine to perform computation--and
> yet

> time Perl was much more so, but I wouldn't consider any beneift in
> greater
> popularity of Perl to be worth the pain of having to deal with it's
> obtuseness.

Excellent answer !
Aplausos !!

Mark Wilden

unread,
May 28, 2008, 3:54:41 PM5/28/08
to
On May 28, 2008, at 11:36 AM, Kyle Schmitt wrote:

> Learn C first.

As someone who learned UCSD Pascal first, and then went on to
assembler, then C, I disagree. :)

You don't have to be able to overhaul an engine to ride on a train.
You should always take the easiest way that fulfills your goals.

I was a Classical Studies major at university. People would always
say, "Oh, I wish I'd learned Latin!" Idiots. :) Yeah, learning Latin
will help you learn French, etc. But if you want to learn French, you
should just learn French.

We only have a limited amount of time in our lives. Any time spent
learning a bad language like C is time we can't spent learning
something else - like how to write maintainable, well-tested code.

Taken to its logical extreme, you should really know how to design
digital circuits before you jump into C. Would it make you a better
Ruby programmer? Absolutely! What would make you an even better Ruby
programmer, however, is learning Smalltalk or Scheme or TDD or Rails.
Limited time means you can't learn everything. Make sure what you
learn is actually useful.

Learning C means not learning something else.

///ark

Eric I.

unread,
May 28, 2008, 4:18:57 PM5/28/08
to
On May 28, 2:36 pm, Kyle Schmitt <kyleaschm...@gmail.com> wrote:
> Since nobody's posted it...http://xkcd.com/409/

I *strongly* disagree with this opinion. If the goal is to start
closer to the hardware, then why isn't assembly language even better?
It's like saying to learn sociology you first need to learn
psychology, but before that neurology, preceded by neurochemistry, but
only after biochemistry, which of course follows chemistry, but which
can only come after physics....

Just as there are useful concepts and abstractions within sociology, a
high level programming language provides you with abstractions (loops,
objects, exceptions, iterators, closures, etc.) that are useful in
their own right. You do not have to learn what's happening behind the
scenes first to understand or leverage these concepts.

You can't learn everything at once. You have to learn things
incrementally, and given human psychology, it tends to work best if
along the way you are able to do useful and interesting things.

Now does learning C or assembly language at some point make you a
better programmer? Absolutely! But it doesn't have to be first, or
even second or third. Why make learning unnecessarily painful when it
can be coincidentally fun?

Eric

====

LearnRuby.com offers Rails & Ruby HANDS-ON public & ON-SITE
workshops.
Ruby Fundamentals Wkshp June 16-18 Ann Arbor, Mich.
Ready for Rails Ruby Wkshp June 23-24 Ann Arbor, Mich.
Ruby on Rails Wkshp June 25-27 Ann Arbor, Mich.
Ruby Plus Rails Combo Wkshp June 23-27 Ann Arbor, Mich
Please visit http://LearnRuby.com for all the details.

David Masover

unread,
May 28, 2008, 5:04:51 PM5/28/08
to
On Wednesday 28 May 2008 13:36:30 Kyle Schmitt wrote:

> Learn C first.
>
> To really get programming, to understand what's going on, you need to
> go deep. All the way down to C (though some say assembler).

And that's the point, really. Some say assembler. You say C. I say neither, or
it depends.

I would say, start with something like Ruby or Python. There's a minimum of
busywork between you and what you actually want to make. It'll get you in,
and get you hooked.

It also means you'll have a solid grasp of a few core concepts before moving
on to C. You won't spend the whole time learning what a variable is, or what
a function is, because you'll already know how to program. Instead, you'll
spend your time learning all that depth knowledge you're talking about -- how
to allocate memory, what a pointer is, etc.

But it's not really a closed debate, by any means. I started (barely) with
QBASIC (multiple choice quizzes with if/then/else) -- didn't really learn to
program until I got a good book on C++. So I pretty much did the opposite of
what I'm advocating here.

And I stand by, whichever has the best book. Once you know one language well,
learning another is much easier -- it's those first baby steps that are
difficult.

Bill Kelly

unread,
May 28, 2008, 6:13:12 PM5/28/08
to

From: "Mark Wilden" <ma...@mwilden.com>

>
> We only have a limited amount of time in our lives. Any time spent
> learning a bad language like C is time we can't spent learning
> something else - like how to write maintainable, well-tested code.

Uhhhhhhhh.... From matz, two days ago on ruby-core: [16910]

From: "Yukihiro Matsumoto" <ma...@ruby-lang.org>
To: <ruby...@ruby-lang.org>
Sent: Monday, May 26, 2008 8:18 AM
Subject: Re: [PATCH] lambda with normal block syntax
>
> [...] I program in C more than Ruby


So... matz has implemented ruby in a "bad language" ?

Personally I find it extremely useful to be fluent in the
language that Ruby is written in. Ruby would be a lot less
useful to me if I weren't able to write my own ruby
extension modules. . . . Which requires a knowledge of C,
if one is using Matz' ruby. (Obviously if I were using
JRuby, knowledge of C wouldn't be anywhere near as relevant.)

I'm not convinced someone should learn C *before* ruby,
however I find C to be an extremely vaulable language to
know.


Regards,

Bill

Mark Wilden

unread,
May 28, 2008, 6:44:39 PM5/28/08
to
On May 28, 2008, at 3:13 PM, Bill Kelly wrote:

> From: "Yukihiro Matsumoto" <ma...@ruby-lang.org>
> To: <ruby...@ruby-lang.org>
> Sent: Monday, May 26, 2008 8:18 AM
> Subject: Re: [PATCH] lambda with normal block syntax
> >
> > [...] I program in C more than Ruby

If you're writing Ruby, as opposed to doing applications programming,
that makes sense!

> So... matz has implemented ruby in a "bad language" ?

It's funny. I used to work at Sierra On-Line (a long time ago) where
we used a home-grown OOP language to write adventure games. The guy
who wrote the language was without doubt the smartest person I've ever
worked with. But he actually had very little OOP experience, and I was
able to teach him a thing or two about using his own language!

All that's to say that "Matz uses C more than Ruby" doesn't really
bear on which is the better language. However, I should have said that
C is a "bad" language for applications, in the sense that Ruby is much
better!

> Personally I find it extremely useful to be fluent in the
> language that Ruby is written in. Ruby would be a lot less
> useful to me if I weren't able to write my own ruby extension
> modules. . . . Which requires a knowledge of C,
> if one is using Matz' ruby. (Obviously if I were using
> JRuby, knowledge of C wouldn't be anywhere near as relevant.)

That's great, but it doesn't apply to most people.

> I'm not convinced someone should learn C *before* ruby,
> however I find C to be an extremely vaulable language to know.

As someone who's quoted in the GNU C FAQ, I probably have as great an
appreciation of C as anyone. I just think its sell-by date has passed
for most applications. On the other hand, I wouldn't write a device
driver in Ruby.

///ark

Tim Hunter

unread,
May 28, 2008, 6:58:31 PM5/28/08
to
Bill Kelly wrote:
> Personally I find it extremely useful to be fluent in the
> language that Ruby is written in. Ruby would be a lot less
> useful to me if I weren't able to write my own ruby extension modules. .
> . . Which requires a knowledge of C,
> if one is using Matz' ruby. (Obviously if I were using
> JRuby, knowledge of C wouldn't be anywhere near as relevant.)
>
> I'm not convinced someone should learn C *before* ruby,
> however I find C to be an extremely vaulable language to know.

+1. I read this quote from somebody smart: "C is the atmosphere in which
we live."

Although I learned (and earned my living with) assembly language many
years ago, I don't think it's particularly necessary to learn it now
unless you're working in a very specialized area, like compilers,
graphics drivers, etc. But C is still hugely popular and widely used and
having it in your toolchest will be useful for many years to come.

However, even though C is a small language (compared to Java or C++) I
think it's harder to learn than Ruby, and learning it will be more
frustrating since it takes so much more code to get results and it's so
easy to make mistakes that are really, really hard to fix. I've been
doing it for 25 years now and I still spend more of my time finding and
fixing bugs than I do writing code.

--
RMagick: http://rmagick.rubyforge.org/
RMagick 2: http://rmagick.rubyforge.org/rmagick2.html

MRH

unread,
May 29, 2008, 7:16:19 AM5/29/08
to
Tobias:

Thank you for your reply.

> I learned by doing, in perl, and think it worked well

I agree, and plan on using that approach.

> You'll have to learn more than one language anyway

Quite true, and I plan on a few . . . I am just debating which one to
try first . . .

> Educationally Python might make more sense since it has less syntax (no
> blocks)

I will keep that in mind.

> But my real advice is to find a problem you really care about, than look
> which language has the best library for it, and go with that. You won't
> learn anything from example code in books.

Had also planned on this.

Cheers,

Maurice

Dave Bass

unread,
May 29, 2008, 7:45:08 AM5/29/08
to
Kyle Schmitt wrote:
> Learn C first.
>
> To really get programming, to understand what's going on, you need to
> go deep. All the way down to C (though some say assembler).
>
> C is the lingua franca of computers. It doesn't make things easy for
> you, it doesn't make things pretty, or necessarily intuitive, but it
> does bring you right down to the metal in the end.

This is exactly why we chose C as the first language for electronic
engineering and information systems engineering students. Previously the
course had been given in Algol 68 (!), then Pascal, but it was decided
that C would be a much better foundation, and useful in the real world
too.

C is very hard to learn. Almost everybody comes unstuck on pointers and
memory allocation. But this trains your mind, and once you've learnt C,
you realise what other languages are protecting you from, and how they
work internally (since most are written in C, like Ruby).

Recently some ex-students of mine contacted me via a social networking
site to thank me, saying that C had been very valuable to them in their
careers.

If the OP wants a good foundation in programming, C will provide it. But
Ruby would be gentler. :-)

MRH

unread,
May 29, 2008, 7:51:45 AM5/29/08
to
Hi David,

Thank you for your post.

> Depends what you want to do, and how far you want to go.

I want to program for myself, for clients, and contribute to FOSS
projects, and take it all as far as I can.

> For a first language, either Python or Ruby are fine. Python has stricter
> syntax, but I suspect Ruby has stricter concepts (of OO, etc). I find Ruby
> easier to read, but that's an opinion.

Will keep this in mind.

> If you want to get a good concept of programming in general, you should learn
> (and develop at least some small apps in) a variety of languages -- and a
> variety of very different languages.

I agree . . . part of my research into the fundamentals has led me to
decide to, as part of stage 2 - if you will - work my way through the
(and I hope I don't sound like online bookstore spam with this)
"Concepts, Techniques, and Models of Computer Programming" book . . .

> So, at least one language low-level enough not to do garbage collection (C,
> ASM, etc), at least one high-level "scripting" language (Ruby, Python, Perl,
> JavaScript), at least one purely functional language (Haskell), and I'll
> throw in LISP and either Erlang or Smalltalk.

Ah, this resonates with some of my preliminary conclusions . . .

> I'm not sure it matters what order you do this in -- pick whichever has the
> best absolute beginner books.

I think that for me personally, the best approach is to go from higher
level to lower level, and yes, one of the reasons I have been torn
between Python and Ruby was that Python has (from what I have read)
great beginner books, yet Ruby does as well . . .

> I would suggest a tight feedback loop for
> learning, though -- look for interactive interpreter shells (Python, IRB),
> and avoid compilers (C, C++, Java).

Will do.

> If you don't have that kind of attention span, or if you're looking to learn
> what it takes to get stuff done now, that depends very much on what you want
> to do. For example, if you're planning to do game development, you're
> probably going to have to know C++, and definitely at least C. If you're just
> looking to automate some high-level tasks on Unix, learn Bash. And so on.

I hear you, I am mostly interested in web applications, yet also want
to explore desktop applications for Mac OS X . . . and the more I read
about Lisp, the more interesting it becomes . . .

Cheers,

Maurice

MRH

unread,
May 29, 2008, 7:53:01 AM5/29/08
to

> That is such good advice. Programming and cooking are two areas in
> which you can both learn and benefit from the result.

I actually cook a bit :)


Rick DeNatale

unread,
May 29, 2008, 7:53:14 AM5/29/08
to
On Wed, May 28, 2008 at 3:54 PM, Mark Wilden <ma...@mwilden.com> wrote:
> On May 28, 2008, at 11:36 AM, Kyle Schmitt wrote:
>
>> Learn C first.
>
> As someone who learned UCSD Pascal first, and then went on to assembler,
> then C, I disagree. :)
>
> You don't have to be able to overhaul an engine to ride on a train. You
> should always take the easiest way that fulfills your goals.
>
> I was a Classical Studies major at university. People would always say, "Oh,
> I wish I'd learned Latin!" Idiots. :) Yeah, learning Latin will help you
> learn French, etc. But if you want to learn French, you should just learn
> French.

And while learning Latin, might help some learn French up to a point,
I'd argue that knowledge of one language can also interfere REALLY
learning another, related or not, if one can't accept that the second
language really doesn't operate exactly like the other.
While Latin had a large influence on the evolution of French, it's
only one influence. This is true, I suspect to an even larger degree
to English, which was influenced by a long succession of native
tongues and the tongues of various conquerors and invaders.

There's a long history of English grammarians clinging to the myth
that English grammar must follow Latin grammar, leading to bogus rules
like the injunction against splitting an infinitive, which is common
in English usage, but impossible in Latin since the infinitive is a
single word. Yes, if Star Trek were translated to latin, something
would have to be done with "To boldly go,..." but in English it's
perfectly good and understandable usage IMHO.

The concerns when programming in a low-level language like C are quite
different than those when programming in a higher-level language like
Ruby. In C one must worry about issues like storage management,
ensuring that one doesn't copy the wrong kind of data from one
variable to another, possibly causing buffer overflow or underflow,
confusing a pointer with data, etc. All on top of (or perhaps
beneath) application level concerns.

It seems to me that people who start with a language like C are much
more likely to be overly concerned about the problems they've
encountered coming out of these low-level technical concerns, which
for the most part are handled by the language and its runtime rather
than the programmer in a language like Ruby leading to stilted,
chicken-typed code.

This is not to say that it's a bad think to learn C, or Latin. But I
firmly believe that for most people this should come later as a way to
expand understanding of how higher-level languages are implemented and
extended, not as a first step to inform how one should think about
higher-level languages.
--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Rick DeNatale

unread,
May 29, 2008, 7:56:33 AM5/29/08
to
On Thu, May 29, 2008 at 7:45 AM, Dave Bass <dave...@musician.org> wrote:
> Kyle Schmitt wrote:

>> C is the lingua franca of computers. It doesn't make things easy for
>> you, it doesn't make things pretty, or necessarily intuitive, but it
>> does bring you right down to the metal in the end.
>
> This is exactly why we chose C as the first language for electronic
> engineering and information systems engineering students. Previously the
> course had been given in Algol 68 (!), then Pascal, but it was decided
> that C would be a much better foundation, and useful in the real world
> too.
>
> C is very hard to learn. Almost everybody comes unstuck on pointers and
> memory allocation. But this trains your mind, and once you've learnt C,
> you realise what other languages are protecting you from, and how they
> work internally (since most are written in C, like Ruby).

But, many don't seem to realize that the other languages are
protecting them and carry unnecessary techniques from C to the higher
level language.

MRH

unread,
May 29, 2008, 7:59:04 AM5/29/08
to
Dave,

Thank you for your post.

> Once upon a time I used to teach C as a first programming language. In


> some ways it's good, as it's close to the hardware (bits and bytes,
> addresses and pointers etc) but in many other ways this can be a
> disadvantage, as you can't see the wood for the trees. However, it
> certainly makes you appreciate higher-level languages when you come
> across them later on!

I see.

> Java now seems to be the first language of choice for many universities,
> but I would have to disagree with that.

Me too, that is a conclusion I reached after reading the internal SUN
memos that talked about the problems in Java/JVM . . .

> Ruby is much nicer than Java and it will teach you plenty of OO
> concepts.

Great to know this. I just recently learned that all languages do not
handle OOP the same way. I find it interesting that Ruby, according to
what I have read, features the possibility of using several paradigms
in addition to OO.

> However, there's no such thing as the "best" language, so you should
> concentrate on mastering one, then go on to your next.

I will keep that in mind.

Best,

Maurice

MRH

unread,
May 29, 2008, 8:01:25 AM5/29/08
to
> I'm new to this as well. Here's a link to a resource that can maybe
> help you find/learn ruby info - (there are a lot of others up there if
> you just search)http://www.yoyobrain.com/cardboxes/preview/103

>
> I hope it helps! Let me know what you think about it too.
>
> Best,
>
> Elizabeth

Hi Elizabeth,

Thank you for the link! That is pretty interesting, and I believe it
will be very useful.

Regards,

Maurice

Dave Bass

unread,
May 29, 2008, 8:03:33 AM5/29/08
to
Rick Denatale wrote:
> This is not to say that it's a bad think to learn C, or Latin. But I
> firmly believe that for most people this should come later as a way to
> expand understanding of how higher-level languages are implemented and
> extended, not as a first step to inform how one should think about
> higher-level languages.

It's a question of whether you learn top-down, or bottom-up. Different
people have different learning preferences.

Traditionally technical subjects have been taught bottom-up in academia
("building on a firm foundation"), but there are very good arguments for
the top-down approach too.

MRH

unread,
May 29, 2008, 8:04:13 AM5/29/08
to
> Actually, TinyCC has a C interpreter that you can use to test code, so
> there isn't much need to compile when you are using it.
>
> I believe there is a Windows and a *nix version, so there shouldn't be a
> problem with platforms.

Hi forgottenwizard,

Thank you for that info, that is good to know, as I have concluded
that I will need to study C eventually, and something like this sounds
as though it will be very useful.

Happy Hacking,

Maurice

MRH

unread,
May 29, 2008, 8:13:08 AM5/29/08
to
Hi Mike,

Thank you for this post.

> I usually lump beginner programmers into one of two categories, (i) those
> who want to become expert programmers for purposes of education,
> profession, or hobby, and (ii) those who are interested in learning how to
> program sufficiently enough to make work in their primary careers easier,
> but don't necessarilly have a specific interest in programming itself.

I am a category (i) ;)

> If you're of the former category, I would say it doesn't really matter what
> lanaguage you learn first since you will inevitably learn multiple
> languages anyways.

Yes, please see prior post. :)

> Remember that a master programmer is not someone who
> expertly understands the minutiae of any single language, but rather is
> someone who is proficient in many languages.

A-ha! I had assumed the contrary - this is great to know, and it makes
sense.

> That said, there are a lot of languages out there that are complicated or
> even cumbersome because they attempt to be sufficiently general as to allow
> any "style" of programming without enforcing too strict of rules as to what
> code should look like. Perhaps the best example of this phenomenon is C++,
> and to a lesser extent Perl. I express caution in learning these languages
> as first languages, since, as a novice programmer you don't really have an
> intuition for what code should look like, and the language doesn't really
> help guide you in learning either.

I see

> Ruby is guilty of a similar phenomenon which, in this context, goes by the
> name of "expressiveness". While Ruby is certainly my favorite language, I
> know that part of my appreciation for this expressiveness comes from over a
> decade of experience in other languages and being able to place Ruby in
> the context of this experience.
>
> In other words, I'm not really sure if Ruby is the best, or even a good
> language for beginners because I'm not sure how difficult it is to learn
> without the benefit of experience. On the other hand, plenty of people
> have learned Ruby as their first language and have gone on to recommend it
> to others, so it's certainly possible, and probably not a bad choice
> either.

I will consider this.

> That said, keep in mind that Ruby is a bit unique compared to other popular
> languages. For example, the idiom of using internal iterators and blocks
> as looping constructions (e.g., Enumerable#each) is unlike the usual
> approach of using a for loop and/or external iterator as you would use in
> C, C++, Java, or Python. While I think Ruby's approach is better, it is
> not the norm in other languages. Another example is Ruby's idiom of
> automatic allocation and deallocation of resources by passing them to code
> blocks (e.g., File#open). In other languages, one typically has to
> explicitly deallocate the resource (close the file) and the code for
> writing this safely is not intuitive.

I get the gist of what you are saying. Will remember.

> This brings up another advantage/disadvantage of learning Ruby first: code
> safetyness. One example of this is the resource allocation/deallocation
> idiom I mentioned above that ensures that resources are always properly
> cleaned up when the program is finished with their use. Another is that
> most methods raise an exception upon encountering an error, forcing a
> program to abort is an unexpected error happens.
>
> Exceptions are good, and they're prominent in other languages (Java and
> Python) and behave, more or less in the same way. Unfortunately some
> popular languages implement exceptions (C++ and Perl) but don't use them
> universally in library functions, and other languages (C) don't implement
> them at all. In these languages, you must (or at least should) check
> return values of any function you call to make sure that the desired action
> performed successfully. Often times people forget to do this, and the
> result is code that continues on ignoring error conditions, usually blowing
> up somewhere else where it's difficult to debug.
>
> So, while I regard these features as advantages of Ruby, they are, in some
> sense a disadvantage when you attempt to learn a different language that
> doesn't take care of these issues for you, as you must be diligent in
> taking care of them yourself and it's not something you're used to.

This resonates with my earlier research as well. Will also remember
this.

> Anyways, the crux of my advice is this: Any language that you're
> enthralled by, and can't get enough of, is a good (first) language to
> learn. On the other hand, any language that you find bewildering,
> confusing, or just plain unfun to learn is probably not a good first
> language candidate. If you find youself becoming disinterested after
> spending a week or two learning whatever language you choose, skip it and
> move on to something else. It may take a while to find the language that
> fits, but trial and error is better than giving up on programming
> entirely--especially when the language that clicks with you is right around
> the corner.

Will do.

Regards,

Maurice

Srijayanth Sridhar

unread,
May 29, 2008, 8:21:05 AM5/29/08
to
My two cents worth:

Ruby is a good first language to learn if you are really really young
and you are just learning something, because ruby is designed in a way
that lets us apply regular thinking methods. If you are a child,
5.times do something makes more sense than for (i=0; ....). However,
if you are a little older and are able to grasp concepts, then you
might be better off learning C.

One reason C is advantageous is it forces you to learn algorithms and
the inner working of "methods" in ruby for instance. It is entirely
possible for a person who has only learned ruby to never bother about
how a sort is implemented. This may or may not matter to you in the
end, but learning C, as someone else said earlier, really makes you
appreciate Ruby, Java etc. Also, going from Ruby to C might be hard
because it might seem like you are always writing code for tasks that
are so trivial in Ruby. So I suggest you learn C first.

Hope that helps.

Jayanth

MRH

unread,
May 29, 2008, 8:27:51 AM5/29/08
to
Hello Kyle,

> Since nobody's posted it...http://xkcd.com/409/

I see what is meant there.

> I don't think you necessarily should program your first projects in C,
> but you should learn C as a first language, even if you don't use it
> for your first projects. Even if you never use it outside of studying
> it.

That resonates with what I had considered in relation to C. I have
also concluded that I should read "Write Great Code" I & II, as those
address becoming acquainted with the bare metal from a programmer's
perspective.

Cheers,

Maurice

MRH

unread,
May 29, 2008, 8:32:40 AM5/29/08
to

I agree, although I will devote some time to becoming acquainted with
the lower level, just enough to broaden my perspective I think.

MRH

unread,
May 29, 2008, 8:35:15 AM5/29/08
to
> I *strongly* disagree with this opinion. If the goal is to start
> closer to the hardware, then why isn't assembly language even better?
> It's like saying to learn sociology you first need to learn
> psychology, but before that neurology, preceded by neurochemistry, but
> only after biochemistry, which of course follows chemistry, but which
> can only come after physics....
>
> Just as there are useful concepts and abstractions within sociology, a
> high level programming language provides you with abstractions (loops,
> objects, exceptions, iterators, closures, etc.) that are useful in
> their own right. You do not have to learn what's happening behind the
> scenes first to understand or leverage these concepts.
>
> You can't learn everything at once. You have to learn things
> incrementally, and given human psychology, it tends to work best if
> along the way you are able to do useful and interesting things.
>
> Now does learning C or assembly language at some point make you a
> better programmer? Absolutely! But it doesn't have to be first, or
> even second or third. Why make learning unnecessarily painful when it
> can be coincidentally fun?
>
> Eric

Hi Eric,

I agree. Thank you for your post.

Cheers,

Maurice

MRH

unread,
May 29, 2008, 8:37:39 AM5/29/08
to
> And that's the point, really. Some say assembler. You say C. I say neither, or
> it depends.
>
> I would say, start with something like Ruby or Python. There's a minimum of
> busywork between you and what you actually want to make. It'll get you in,
> and get you hooked.
>
> It also means you'll have a solid grasp of a few core concepts before moving
> on to C. You won't spend the whole time learning what a variable is, or what
> a function is, because you'll already know how to program. Instead, you'll
> spend your time learning all that depth knowledge you're talking about -- how
> to allocate memory, what a pointer is, etc.
>
> But it's not really a closed debate, by any means. I started (barely) with
> QBASIC (multiple choice quizzes with if/then/else) -- didn't really learn to
> program until I got a good book on C++. So I pretty much did the opposite of
> what I'm advocating here.
>
> And I stand by, whichever has the best book. Once you know one language well,
> learning another is much easier -- it's those first baby steps that are
> difficult.

David,

Thank you for this post. I also agree.

Is it just me or is the web interface for posting here actually
PAINFUL to use?

Best,

Maurice

MRH

unread,
May 29, 2008, 8:38:55 AM5/29/08
to
> I'm not convinced someone should learn C *before* ruby,
> however I find C to be an extremely vaulable language to
> know.
>
> Regards,
>
> Bill

Bill,

I will keep this in mind, thank you.

Best,

Maurice

MRH

unread,
May 29, 2008, 8:40:31 AM5/29/08
to

> Although I learned (and earned my living with) assembly language many
> years ago, I don't think it's particularly necessary to learn it now
> unless you're working in a very specialized area, like compilers,
> graphics drivers, etc. But C is still hugely popular and widely used and
> having it in your toolchest will be useful for many years to come.
>
> However, even though C is a small language (compared to Java or C++) I
> think it's harder to learn than Ruby, and learning it will be more
> frustrating since it takes so much more code to get results and it's so
> easy to make mistakes that are really, really hard to fix. I've been
> doing it for 25 years now and I still spend more of my time finding and
> fixing bugs than I do writing code.

Hi Tim,

I will remember this information. Thank you.

Cheers,

Maurice

MRH

unread,
May 29, 2008, 8:43:28 AM5/29/08
to
> This is exactly why we chose C as the first language for electronic
> engineering and information systems engineering students. Previously the
> course had been given in Algol 68 (!), then Pascal, but it was decided
> that C would be a much better foundation, and useful in the real world
> too.
>
> C is very hard to learn. Almost everybody comes unstuck on pointers and
> memory allocation. But this trains your mind, and once you've learnt C,
> you realise what other languages are protecting you from, and how they
> work internally (since most are written in C, like Ruby).
>
> Recently some ex-students of mine contacted me via a social networking
> site to thank me, saying that C had been very valuable to them in their
> careers.
>
> If the OP wants a good foundation in programming, C will provide it. But
> Ruby would be gentler. :-)

Hi Dave,

Thank you for your post. As I have mentioned, I believe I will study C
and those texts so as to become acquainted with the lower level
concepts.

Best,

Maurice

MRH

unread,
May 29, 2008, 8:47:35 AM5/29/08
to

Hi Rick,

Thank you for this post.

Coming from a self taught background in Languages, and being
bilingual, I can see what you mean, and will keep this in mind.

Regards,

Maurice

Kyle Schmitt

unread,
May 29, 2008, 9:34:41 AM5/29/08
to
On Thu, May 29, 2008 at 6:53 AM, Rick DeNatale <rick.d...@gmail.com> wrote:
> And while learning Latin, might help some learn French up to a point,
> I'd argue that knowledge of one language can also interfere REALLY
> learning another, related or not, if one can't accept that the second
>
> There's a long history of English grammarians clinging to the myth
> that English grammar must follow Latin grammar, leading to bogus rules
> like the injunction against splitting an infinitive, which is common
> in English usage, but impossible in Latin since the infinitive is a

To the first point, I'd actually argue that learning the second
foreign language, or a second programing language teaches you more
about the first than you'd even imagine. Maybe it's a mindset, or
maybe it's what languages you're working with, I'm not sure.

Contrary to what I advised, I learned BASIC first. I was OK in it,
then I learned C++ in school (It took quite awhile for me to be able
to write straight C after that). Learning in that order I've often
felt was not good for me.

But after learning C++, I was so much better in BASIC than I was
before, that I ended up tutoring/teaching it to business students
(this was way back in the day). The only way I could do that was
because learning that second language taught me so much more about
programming.

Although perhaps that makes an argument for learning BASIC (really
really basic, not this VB/business basic junk) or shell script first,
_then_ delving into C, then an abstract language.

There really are so many ways to think of it. Humm.

I still believe that people should learn C though, before embarking on
programming projects, much less careers, even if they don't use C for
it.


As for English and it's horrific grammar, it's a Germanic language
that was busy absorbing Latin, Franco and the occasional Greek words
for 10 centuries. I've heard, but can't find references anywhere
right now, that the grammar itself was latinized shortly after the
advent of cheap printing. Apparently there was an underlying motive
to make it more difficult, since that would make it easier to
distinguish between the educated and the non educated. Evil isn't it?
Just wish I could find a reference.....


--Kyle

David Masover

unread,
May 29, 2008, 11:31:18 AM5/29/08
to
On Thursday 29 May 2008 07:39:55 MRH wrote:

> Is it just me or is the web interface for posting here actually
> PAINFUL to use?

I never noticed. I use it as a mailing list, and it's also a newsgroup.

David Masover

unread,
May 29, 2008, 11:39:35 AM5/29/08
to
On Thursday 29 May 2008 06:54:54 MRH wrote:
> Hi David,
>
> Thank you for your post.
>
> > Depends what you want to do, and how far you want to go.
>
> I want to program for myself, for clients, and contribute to FOSS
> projects, and take it all as far as I can.

Still depends -- for example, if you just want to be able to contribute to the
most FOSS possible, learn C. The vast majority of FOSS projects are in C,
among them some of the better known. It might be nice to know some value of P
in a "LAMP stack" -- Perl/PHP/Python/Ruby -- but pretty much the entire rest
of the stack will be written in C. Maybe a bit of shell scripts, but the
shell itself is written in C.

If, on the other hand, you want to write brand new apps, from the ground up --
or you want to interface with all these existing apps, but not actually patch
them -- then Ruby is as good a choice as any.

But these don't matter as much, since you've indicated a more academic
curiosity -- you'll probably learn both anyway, and more.

> I hear you, I am mostly interested in web applications, yet also want
> to explore desktop applications for Mac OS X . . . and the more I read
> about Lisp, the more interesting it becomes . . .

I suspect that Ruby has more LISPisms than Python. Either would be good for
GUI OS X apps and web apps.

Marc Heiler

unread,
May 29, 2008, 11:53:58 AM5/29/08
to
Woot, i love those questions :)

> I'm not convinced someone should learn C *before* ruby,
> however I find C to be an extremely vaulable language to
> know.

C definitely is valuable. I dont like C, but there is,
in the long run, not really a way around C.

But Ruby is about 1000x nicer than C and I hope one
day we can use nice languages rather than ugly ones. ;)

What you should also keep in mind is that if you already
know Ruby well, learning C can be boring, because 95% of
what C does, Ruby does too - shorter and nicer for the
human being.


> I have seen that the more credible sources recommend either
> Python or Ruby, and I am personally leaning quite heavily
> toward Ruby, yet I would very much like to read
> the thoughts of the group on this question.

I think both will be a good choice and fill almost the same
niche. I think people that use python or ruby are much
more in the same boat than other languages (i.e. than
in java). The amount of static languages, and the code,
is monumental. I am afraid of the day an autonomous
space ship with robots that colonialize other planets is
empowered by java....


So my personal recommendation is, if you have no time pressure
etc... is that you should learn C first, even if ruby is
a lot more fun (because you will learn ruby a lot easier
anyway and it doesnt matter much when you start learning it IMO.) :)

MRH

unread,
May 29, 2008, 1:20:49 PM5/29/08
to

I was on the Win XP partition using FF (I dual boot and mostly use
Ubuntu) and it just SLOOOOWWEEED down my machine (it's not that fast
however, I am about to build a new one) plus it was becoming difficult
to select text to clip when replying, and it just felt . . .
resistant? . . . all around . . . now I am back on Ubuntu, using FF
and . . . no more pain . . . :)

MRH

unread,
May 29, 2008, 1:23:58 PM5/29/08
to

Hello Jayanth,

An interesting and helpful post, thank you. I did find a free online
book on Data Structures and Algorithms in Ruby . . . posted it to
Reddit Ruby, and some folks stated that it did not use idiomatic
Ruby . . . I am going to tackle that one anyway however.

Regards,

Maurice

Rick DeNatale

unread,
May 29, 2008, 1:35:46 PM5/29/08
to
On Thu, May 29, 2008 at 9:34 AM, Kyle Schmitt <kyleas...@gmail.com> wrote:
> On Thu, May 29, 2008 at 6:53 AM, Rick DeNatale <rick.d...@gmail.com> wrote:
>> And while learning Latin, might help some learn French up to a point,
>> I'd argue that knowledge of one language can also interfere REALLY
>> learning another, related or not, if one can't accept that the second
>>
>> There's a long history of English grammarians clinging to the myth
>> that English grammar must follow Latin grammar, leading to bogus rules
>> like the injunction against splitting an infinitive, which is common
>> in English usage, but impossible in Latin since the infinitive is a
>
> To the first point, I'd actually argue that learning the second
> foreign language, or a second programing language teaches you more
> about the first than you'd even imagine. Maybe it's a mindset, or
> maybe it's what languages you're working with, I'm not sure.

I've got no argument with that, my argument is that your first
language can have a big effect on how you learn, or fail to truly
learn the second.

> Contrary to what I advised, I learned BASIC first. I was OK in it,
> then I learned C++ in school (It took quite awhile for me to be able
> to write straight C after that). Learning in that order I've often
> felt was not good for me.
>
> But after learning C++, I was so much better in BASIC than I was
> before, that I ended up tutoring/teaching it to business students
> (this was way back in the day). The only way I could do that was
> because learning that second language taught me so much more about
> programming.
>
> Although perhaps that makes an argument for learning BASIC (really
> really basic, not this VB/business basic junk) or shell script first,
> _then_ delving into C, then an abstract language.

In my case, and I suspect that I'm considerably older than the average
participant here, I first learned Fortran I, and quickly branched out
to learn many languages including 1620 assembler, IBM/360 Assembler,
Snobol, Lisp 1.5, PL/I, APL\360, PDP/5 and 8 assembler, Algol, etc.
This gave me a rather broad base before I ever encountered C (In fact
much of this took place before C was born). In addition to language
use, I had a pretty good BS education in CS including data structures,
and compiler construction.

After University, I used mostly PL/S which was IBM's equivalent to C,
it was a slightly higher-level than assembler language with a PL/I
like syntax much like C is a slightly-higher level than assembler
language with a stripped down BCPL syntax.

My exposure to C came a bit later, and I first really used it to
develop a variant called ClassC which was similar in concept to, and
developed concurrently with, and without knowledge of, Objective-C

> I still believe that people should learn C though, before embarking on
> programming projects, much less careers, even if they don't use C for
> it.

While it is important at some point to understand the level of
abstraction at which C lives, I think that it's more important to get
a broad understanding of programming.

> As for English and it's horrific grammar, it's a Germanic language
> that was busy absorbing Latin, Franco and the occasional Greek words
> for 10 centuries. I've heard, but can't find references anywhere
> right now, that the grammar itself was latinized shortly after the
> advent of cheap printing. Apparently there was an underlying motive
> to make it more difficult, since that would make it easier to
> distinguish between the educated and the non educated. Evil isn't it?
> Just wish I could find a reference.....

I don't know that it was an evil plot. It just reflects the history
of England as a crossroads/invasion target, and the fact that society
is never homogeneous.

It's why for example, English has multiple words for various animals
and their meat, Pig and Pork, Cow and Beef, Calf and Veal...

This comes from the Norman invasion, after which the language of the
Court and Gentry was French.

The former names are germanic in origin and were used by the farmers
who were Anglo Saxons, the latter were French. Notice how we tend to
use these words today to refer to the animal, vs. the meat.

I've seen this effect mentioned several times, and I'm almost certain
one of them was in the book "The Story of English" by Cran, MacNeill,
and McCrum

http://en.wikipedia.org/wiki/The_Story_of_Englis

h

MRH

unread,
May 29, 2008, 1:51:49 PM5/29/08
to

> Still depends -- for example, if you just want to be able to contribute to the
> most FOSS possible, learn C. The vast majority of FOSS projects are in C,
> among them some of the better known. It might be nice to know some value of P
> in a "LAMP stack" -- Perl/PHP/Python/Ruby -- but pretty much the entire rest
> of the stack will be written in C. Maybe a bit of shell scripts, but the
> shell itself is written in C.

I see.

> If, on the other hand, you want to write brand new apps, from the ground up --
> or you want to interface with all these existing apps, but not actually patch
> them -- then Ruby is as good a choice as any.

Good to know.

> But these don't matter as much, since you've indicated a more academic
> curiosity -- you'll probably learn both anyway, and more.

Thank you, that is encouraging.

> I suspect that Ruby has more LISPisms than Python.

So have I read, so have I read . . . that is actually one of main
reasons (out of many) why I am interested in Ruby: a rather well known
Lisp hacker has on several instances expressed his opinion that Ruby
is quite similar to Lisp.

>Either would be good for
>GUI OS X apps and web apps.

Also good to know.

MRH

unread,
May 29, 2008, 1:53:21 PM5/29/08
to
> So my personal recommendation is, if you have no time pressure
> etc... is that you should learn C first, even if ruby is
> a lot more fun (because you will learn ruby a lot easier
> anyway and it doesnt matter much when you start learning it IMO.) :)

Hi Marc,

Thank you for your post . . .

Cheers,

Maurice

Kyle Schmitt

unread,
May 29, 2008, 3:44:02 PM5/29/08
to
On Thu, May 29, 2008 at 12:35 PM, Rick DeNatale <rick.d...@gmail.com> wrote:
> In my case, and I suspect that I'm considerably older than the average
> participant here, I first learned Fortran I, and quickly branched out
> to learn many languages including 1620 assembler, IBM/360 Assembler,
> Snobol, Lisp 1.5, PL/I, APL\360, PDP/5 and 8 assembler, Algol, etc.
Errr. Lisp 1.5? I'm going to guess then, you were learning this
stuff in the mid to early sixties?

Yeah. I started as a little kid with C64 basic using sample programs
from "3-2-1 Contact" magazine... I think that was 1983.

Just a little generational gap :)

> I've got no argument with that, my argument is that your first
> language can have a big effect on how you learn, or fail to truly
> learn the second.

Hum. But don't you think that if someone learns, really learns and
uses, the fluid flexible everything-hidden-behind-the-scenes languages
first, that they will have trouble when they eventually have to deal
with the nitty gritty of C or ASM?

> one of them was in the book "The Story of English" by Cran, MacNeill,

OK, now I've got something to read some weekend soon.

--Kyle

Rick DeNatale

unread,
May 29, 2008, 3:56:27 PM5/29/08
to
On Thu, May 29, 2008 at 3:44 PM, Kyle Schmitt <kyleas...@gmail.com> wrote:
> On Thu, May 29, 2008 at 12:35 PM, Rick DeNatale <rick.d...@gmail.com> wrote:
>> In my case, and I suspect that I'm considerably older than the average
>> participant here, I first learned Fortran I, and quickly branched out
>> to learn many languages including 1620 assembler, IBM/360 Assembler,
>> Snobol, Lisp 1.5, PL/I, APL\360, PDP/5 and 8 assembler, Algol, etc.
> Errr. Lisp 1.5? I'm going to guess then, you were learning this
> stuff in the mid to early sixties?

Early 70s.

7stud --

unread,
May 29, 2008, 4:25:04 PM5/29/08
to
MRH wrote:
> Hello Group,
>
> I realize this question has been previously asked in different boards,
> however, I believe that it is worth asking here owing to the level of
> expertise present.
>
> I am a beginner in programming. I have read some fundamental theory
> material and mucked around a bit, and now want to move into actually
> learning programming and my first language.
>
> Throughout my research into this question, I have seen that the more

> credible sources recommend either Python or Ruby, and I am personally
> leaning quite heavily toward Ruby, yet I would very much like to read
> the thoughts of the group on this question.
>

I was in the same position as you about a year ago--except I have
experience programming in other languages, and I was leaning the same
way. I read a bunch of articles on Ruby and Python, and I was leaning
towards Ruby. Then I went to the Ruby website, and I did the twenty
minute tutorial, but I found the syntax distasteful. So I did an about
face and began learning Python instead. After spending a year with
Python, which I liked quite a bit, I thought I would learn some Ruby,
which is what I'm doing now.

Ruby people talk about how clean the Ruby syntax is and how Ruby
"doesn't get in your way". But in my opinion, Ruby has barely evolved
beyond Perl as far as ugly syntax goes. A lot of the code posted on
this forum is extremely difficult to decipher. I also find that Ruby
actually gets in my way all the time, and based on the questions posted
in this forum, Ruby seems to get in other people's way too. To be fair,
all computer languages get in your way: there are weird results, quirks,
and edge cases that will stump you when writing programs, but for some
reason the Ruby kool-aid drinkers like to claim that is not the case in
Ruby. Ruby lets you do so many bizarre things that I would guess there
are more quirks and edge cases that will leave you completely bewildered
than in any other language I know.

As far as I can tell, Ruby is a good language for experienced
programmers who don't want to be confined by any rules and don't need
speedy execution. For them, Ruby is an expressive language because they
can write the most bizarre code with it. I also notice that a lot of
Ruby programmers who post on this forum like to cram the equivalent of
ten lines of code into a convoluted one liner whenever they
can--efficiency and clarity be damned.

> I suspect that Ruby has more LISPisms than Python.
> Either would be good for GUI OS X apps and web apps.
>

As a beginner, you can pretty much forget about programming GUI apps
with Ruby. Ruby doesn't come with any software that will let you
program GUI apps, so you first have to get some software installed,
which can be a big hassle. Then there is not much documentation or many
tutorials for Ruby GUI programming.

On the other hand, Python includes software that will let you program
GUI apps. It's called Tkinter, and it's simple enough so that beginners
can get their feet wet. The documentation on Tkinter isn't the
greatest, but some python books have sections on Tkinter and there are a
few websites that have decent examples and documentation.

The documentation for the Ruby language and its Standard Library is very
poor. As a result, you need to buy the book Programming Ruby(2nd ed)
just for the documentation section in the second half of the book. As a
beginner, you probably won't use the online docs for reference very
often, so that won't affect you as much. Python's documentation is
better, but I still consider it substandard. php has the best online
documentation I've seen because they allow users to post comments in the
docs. The php users flesh out the descriptions of the functions and
they post examples demonstrating tricky results they encountered. Why
python and ruby don't adopt a similar model for their documentation is
baffling. In essence, the php docs are self documenting, and the php
users create a rich trove of information for free.

Python has a very good beginners book that just came out with a new
edition this year: "Learning Python(3rd ed)".

Based on all of the above, I recommend Python over Ruby. Good luck.

7stud --

unread,
May 29, 2008, 4:58:00 PM5/29/08
to
7stud -- wrote:
>
> Based on all of the above, I recommend Python over Ruby. Good luck.
>

I just wanted to add that I started with C++ and Java. Unless you plan
on becoming a computer science student in college, I would not start
with C or C++. It takes a lot of time to learn the language and if you
want to do much more than grind out calculations, it requires complex
programs.

On the other hand, python has a broad application and it allows you to
perform many tasks very easily. For instance, in C++ to get the
contents of a web page and then print out some information contained
therein, you would have to be pretty good with C++, and then you would
have to learn a topic called sockets, which is quite difficult. In the
end, your program would probably be 100+ lines of code and very error
prone.

In python, you can write that same program in less than 20 lines of
code. The reason it's so easy in python is that expert programmers have
done that programming task many times in the past, and their code is
contained in the python libraries. All you have to do is call a few
simple functions to get the benefit of all their hard work and
experience. In C++, there are no equivalent libraries, so every
programmer who wants to get the contents of a web page and print out
some information contained therein has to reinvent the wheel and write
their own program from scratch.

python has a vast number of libraries that cover almost every subject
you can think of, and the code in the libraries was written by expert
programmers. In python, you get access to their programs by calling a
few comparatively simple functions. As a result, complex programming
tasks are reduced to a few lines of code.

Dave Bass

unread,
May 29, 2008, 6:03:00 PM5/29/08
to
7stud -- wrote:
> I also notice that a lot of
> Ruby programmers who post on this forum like to cram the equivalent of
> ten lines of code into a convoluted one liner whenever they
> can--efficiency and clarity be damned.

Hear hear. Clarity should win over compactness every time, IMHO. (Even
in Perl.)

In my own coding I like one idea per line, and one comment every 5-10
lines on average. Seems like everyone else tries to do the exact
opposite.

(Ducks... ;-)

Lloyd Linklater

unread,
May 29, 2008, 6:58:32 PM5/29/08
to
Well, I checked my pockets and found a surplus $0.02 and will toss it in
here, if I may.

You can learn to program starting with any language and get things done.
That having been said, all languages are NOT created equal. It is,
therefore, important to know more about what you are seeking.

If you want a job writing windows programs, you will almost certainly
want to investigate C#. There are a good deal of caveats and
frustrations associated with that, but there it is. There are many jobs
to be had therein.

If you want something that is cross platform then you would need Java,
Ruby, PHP, and their ilk. There are a LOT of java jobs and sun has
embraced ruby in the form of jruby and that is very good for the ruby
lovers (us). There are a lot of wonderful java libraries. Those are
things that other people wrote to do things that are commonly done like
file handling and searching through internet sites, etc. Mingling the
two is something that I think important, though this is more of a purist
site so I will behave. :)

In choosing between languages like java, php, and ruby, you need to
think of how you want to do your programming. I know this may be
difficult to grok, but stick with me here. If you want a language where
it does the work for you and all you need to do is describe what needs
doing, then ruby is for you. If you want the control, and attending
execution speed, then you might consider C++.

As an example, sorting an array in ruby is as simple as

my_array = my_array.sort

or

my_array.sort!

You do not need to know HOW it gets done. You just say "do it" and
VOILA! I cannot tell you how many bubble sorts I have written over the
years, though I can still count the quick sorts on my fingers and toes.

So, in summary, you need to decide what you want it to do and see which
language fits how you think then go that way. Ultimately, you should
learn several languages but not at first. At first, you should learn to
program well in one language. Only then should you spread out.

fwiw & imho

Mark Wilden

unread,
May 30, 2008, 12:33:36 AM5/30/08
to
On May 29, 2008, at 3:03 PM, Dave Bass wrote:

> Hear hear. Clarity should win over compactness every time, IMHO. (Even
> in Perl.)

However, compactness can sometimes add to clarity, simply because you
don't have to read so much code to find out what's going on.

> In my own coding I like one idea per line, and one comment every 5-10
> lines on average.

I only comment code that's difficult to understand. I try never to
write code that's difficult to understand.

///ark

Mark Wilden

unread,
May 30, 2008, 9:34:36 AM5/30/08
to
On May 29, 2008, at 5:03 AM, Dave Bass wrote:

> It's a question of whether you learn top-down, or bottom-up. Different
> people have different learning preferences.

The trouble with bottom-up is that it will take you forever to reach
the top. :) With top-down, you start with your ultimate objective, and
stop when you've gone down far enough. That way you don't have to
learn subatomic physics in order to make a cherry pie.

///ark

forgottenwizard

unread,
May 30, 2008, 9:58:21 AM5/30/08
to

FWIW, I would suggest K&R to learn C. It seems to be the standard for
learning C, and along with a copy og the C99 standard, should be able to
get you started in it.


forgottenwizard

unread,
May 30, 2008, 10:10:57 AM5/30/08
to
On 00:53 Fri 30 May , Marc Heiler wrote:
> What you should also keep in mind is that if you already
> know Ruby well, learning C can be boring, because 95% of
> what C does, Ruby does too - shorter and nicer for the
> human being.

That goes for any OOP language. Procedural languages like C require more
code to do the more complex task, but generally require less to do
simple things (getchar/scanf vs. messing with an array).


Dave Bass

unread,
May 30, 2008, 12:18:36 PM5/30/08
to
Mark Wilden wrote:
> With top-down, you start with your ultimate objective, and
> stop when you've gone down far enough.

But you never really understand what you're doing; you end up learning a
set of rules and prescriptions instead of basic principles. Do this and
it works; do that and it doesn't.

Of course this could get very philosophical. What do I mean by "really",
"understand" and "basic principles"? ;-)

You can certainly drive a car without knowing what goes on inside the
engine. Millions do. But some of us (especially those from an
engineering background) like to know how it works, at least in outline.

Having said that, I have no wish to delve into Ruby's C source code. But
if I wanted to, I could!

Eric I.

unread,
May 30, 2008, 2:37:59 PM5/30/08
to
On May 30, 10:10 am, forgottenwizard <phrexianrea...@hushmail.com>
wrote:

You did say "generally". But since we're talking about Ruby in this
thread and since you're responding to someone who was specifically
comparing Ruby and C, I think it's worth pointing out that Ruby, and
perhaps object-oriented scripting languages in general, are almost
always shorter than C, even for those "simple things".

Since you gave "getchar/scanf vs. messing with an array" as an
example...

C: ====

#include <stdio.h>

int main()
{
printf("How old are you? ");
int age;
scanf("%d", &age);
printf("Next year you will be %d.\n", age + 1);
}

Java: ====

import java.io.*;

public class AgeQuestion
{
public static void main(String[] arguments) throws IOException
{
System.out.print("How old are you? ");
BufferedReader input =
new BufferedReader(new InputStreamReader(System.in));
String age_string;
age_string = input.readLine();
int age = Integer.parseInt(age_string);
System.out.println("Next year you will be " + (age + 1) +
".");
}
}

Ruby: ====

print "How old are you? "
age = gets.to_i
puts "Next year you will be #{age + 1}."

====

So yes, Java is more verbose than C. But C is more verbose than Ruby.

Eric

====

LearnRuby.com offers Rails & Ruby HANDS-ON public & ON-SITE
workshops.
Ruby Fundamentals Wkshp June 16-18 Ann Arbor, Mich.
Ready for Rails Ruby Wkshp June 23-24 Ann Arbor, Mich.
Ruby on Rails Wkshp June 25-27 Ann Arbor, Mich.
Ruby Plus Rails Combo Wkshp June 23-27 Ann Arbor, Mich
Please visit http://LearnRuby.com for all the details.

Todd Benson

unread,
May 30, 2008, 3:48:43 PM5/30/08
to
On Wed, May 28, 2008 at 7:45 AM, MRH <mauric...@gmail.com> wrote:
> Hello Group,
>
> I realize this question has been previously asked in different boards,
> however, I believe that it is worth asking here owing to the level of
> expertise present.

That type of thing pops up pretty often on this group.

In engineering, you _need_ to know the fundamentals. With Ruby, it is
somewhat of a gray area. With Rails, you risk giving something to
somebody that is powerful with the side effect of gun-in-baby's-hands
syndrome.

Many questions float to this list about Rails where it becomes really
clear to rubyists that the person has no idea about how to use the
underlying language. This is probably common with other DSL's as well.
And the C guys probably say the same thing about rubyists.

So, where do you start? I'd say skim through the K&R C book,
read/scan through a couple of design oriented books, and then tackle
Ruby/Python/Perl/whatever with an open mind (meaning, awareness of
different programming paradigms -- hanging out in the book store is
not only pragmatic, but also allows you to ogle your
competition/pretty girls or guys/whatever :)

Programming is not entirely Knuth anymore. Although, you could learn
a lot from the guy. On a similar note, a person should avoid trying
to turn Ruby into C or Python like 7stud and some others like to.

Todd

MRH

unread,
May 31, 2008, 11:10:59 AM5/31/08
to
Todd,

Thank you for your reply.

> That type of thing pops up pretty often on this group.
>
> In engineering, you _need_ to know the fundamentals. With Ruby, it is
> somewhat of a gray area. With Rails, you risk giving something to
> somebody that is powerful with the side effect of gun-in-baby's-hands
> syndrome.

I know what you mean (and what others mean who have voiced analogous
conclusions) I used to translate legal documents professionally, and
was often horrified by translations created using translation software
by people who - even though they were bilingual - had no knowledge of
the underlying principles and subject. It is one of the reasons I left
that market: since those folks would do it for peanuts, companies
began to send me that stuff expecting me to "just clean it up" for 1/3
the going rate since "well, it is more than halfway done" (when in
actuality it takes 200% more work to clean up a mess than to start
from scratch and do it right the first time) . . .

> So, where do you start? I'd say skim through the K&R C book,
> read/scan through a couple of design oriented books, and then tackle
> Ruby/Python/Perl/whatever with an open mind (meaning, awareness of
> different programming paradigms -- hanging out in the book store is
> not only pragmatic, but also allows you to ogle your
> competition/pretty girls or guys/whatever :)

I will keep this approach in mind, it strikes me as very pragmatic and
balanced, I had considered something similar but figured I was wrong
by not knowing enough to reach an accurate conclusion in the first
place. Oh, and btw, it's girls I ogle ;)

> Programming is not entirely Knuth anymore. Although, you could learn
> a lot from the guy. On a similar note, a person should avoid trying
> to turn Ruby into C or Python like 7stud and some others like to.

Will keep in mind . . .

Cheers,

Maurice

David Masover

unread,
Jun 1, 2008, 9:46:44 PM6/1/08
to
On Thursday 29 May 2008 15:25:04 7stud -- wrote:

> Ruby people talk about how clean the Ruby syntax is and how Ruby
> "doesn't get in your way". But in my opinion, Ruby has barely evolved
> beyond Perl as far as ugly syntax goes.

You obviously haven't seen a lot of Perl.

And to either, I'd say, it's how you use it. It is possible to write beautiful
syntax in Ruby. I'm not convinced it's possible to do so in Perl without a
filter.

> To be fair,
> all computer languages get in your way: there are weird results, quirks,
> and edge cases that will stump you when writing programs, but for some
> reason the Ruby kool-aid drinkers like to claim that is not the case in
> Ruby.

We're not the only ones:

http://xkcd.com/353/

To be fair, every language has "kool-aid drinkers". There are people who
absolutely love .NET, for whom its their sole reason for staying on Windows.

> Ruby lets you do so many bizarre things that I would guess there
> are more quirks and edge cases that will leave you completely bewildered
> than in any other language I know.

Any Turing-complete language lets you do bizarre things. If you're doing stuff
like this:

class NilClass
def nil?
false
end
end

Expect your irb to crash when you type that, or shortly thereafter.

Personally, I like that you can do stuff like that in Ruby. Doesn't mean you
have to. I like that I can type "rm -rf /" at a Unix prompt, but of course, I
don't. I like having the training wheels off.

> > I suspect that Ruby has more LISPisms than Python.
> > Either would be good for GUI OS X apps and web apps.
> >
>
> As a beginner, you can pretty much forget about programming GUI apps
> with Ruby. Ruby doesn't come with any software that will let you
> program GUI apps, so you first have to get some software installed,
> which can be a big hassle. Then there is not much documentation or many
> tutorials for Ruby GUI programming.

If you're learning to program, I should hope that you can also learn to
install software. I haven't looked at the documentation, though...

> On the other hand, Python includes software that will let you program
> GUI apps. It's called Tkinter, and it's simple enough so that beginners
> can get their feet wet. The documentation on Tkinter isn't the
> greatest, but some python books have sections on Tkinter and there are a
> few websites that have decent examples and documentation.

$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 41, in <module>
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package
>>>

Whoops. There goes that theory. As long as I'm going to be installing
packages, why not install tcltk for Ruby? Or OpenGL?

And while we're at it, in my experience, gem is much, much better
than "easy-install".

> The documentation for the Ruby language and its Standard Library is very
> poor.

Really?

http://ruby-doc.org/

Plenty of documentation. Not complete, but not "poor", I think.

Lloyd Linklater

unread,
Jun 2, 2008, 12:25:19 PM6/2/08
to
Dave Bass wrote:
> Mark Wilden wrote:
>> With top-down, you start with your ultimate objective, and
>> stop when you've gone down far enough.
>
> But you never really understand what you're doing; you end up learning a
> set of rules and prescriptions instead of basic principles. Do this and
> it works; do that and it doesn't.
>
> Of course this could get very philosophical. What do I mean by "really",
> "understand" and "basic principles"? ;-)
>
> You can certainly drive a car without knowing what goes on inside the
> engine. Millions do. But some of us (especially those from an
> engineering background) like to know how it works, at least in outline.

So true! In the end, the one that understands more of what is going on
will solve the really tough problems where the one that plunks around
until he muddles there cannot. Still, there is a great deal of effort
required in the learning process.

"Thinking is the hardest work there is, which is why so few people do
it." - Henry Ford

You could learn enough to do what you want to do and save delving for
when delving is required. If there is another notion to consider it is
that it should be fun. If it is not fun for you then you will never get
far. Programming takes far too much brain power to do it without joy.
Certain projects and parts will be joyless but that is true for
everything. If you cannot find joy in it, then do something else. Go
to the strata where things are fun and stay there until necessity drives
you out but return ASAP! :)

MRH

unread,
Jun 7, 2008, 6:09:50 PM6/7/08
to
Lloyd,


> So true! In the end, the one that understands more of what is going on
> will solve the really tough problems where the one that plunks around
> until he muddles there cannot. Still, there is a great deal of effort
> required in the learning process.
>
> "Thinking is the hardest work there is, which is why so few people do
> it." - Henry Ford
>
> You could learn enough to do what you want to do and save delving for
> when delving is required. If there is another notion to consider it is
> that it should be fun. If it is not fun for you then you will never get
> far. Programming takes far too much brain power to do it without joy.
> Certain projects and parts will be joyless but that is true for
> everything. If you cannot find joy in it, then do something else. Go
> to the strata where things are fun and stay there until necessity drives
> you out but return ASAP! :)

Thank you for this post. I will also keep it in mind.

Cheers,

Maurice

MRH

unread,
Jun 7, 2008, 6:18:23 PM6/7/08
to
Hello everyone,

Very well, this discussion has played out so to speak, thus I have
decided to submit this last post, so as to thank everyone who
participated - I appreciate it quite a bit, and find the generous and
helpful attitude of every single poster to be very encouraging as it
bodes well for future interaction with Rubyists.

I also want to let everyone know that I have decided to become
acquainted with some of the lower level fundamentals first, not
necessarily learn Assembler and/or C, but work my way through the
concepts . . . I have picked up a copy of Programming From The Ground
Up . . . after that, I will - indeed - teach myself the Ruby
Programming Language as a first language!

Regards and Happy Hacking to All,

Maurice

0 new messages