# Learn how to program

**URL:** https://rubytalk.org/t/learn-how-to-program/44145
**Category:** ruby-talk
**Created:** [30 January 2008 21:30 UTC](https://rubytalk.org/t/learn-how-to-program/44145 "2008-01-30T21:30:43Z")
**Posts on this page:** 10
**Page:** 2

<div class="post-metadata">

### Author: ![Eivind\_Eklund](https://avatars.discourse-cdn.com/v4/letter/e/f17d59/32.png) [@Eivind\_Eklund](https://rubytalk.org/u/Eivind_Eklund)
#### Post date: [1 February 2008 08:19 UTC](https://rubytalk.org/t/learn-how-to-program/44145/21 "2008-02-01T08:19:23Z")

</div>

Too arcane syntax, too many special cases, bad handling of error  
conditions, no built in parameter passing, etc.

It isn't that's impossible to read Perl - I find Perl reasonably easy  
to read - but there's a lot of gotchas in it, and I wouldn't want them  
on a beginner. There are, to my mind, only four things that might  
have redemptive value in using Perl as beginner's language:  
- Sigils might be useful to make the beginner remember the differences  
between types  
- The "softness" of string/number typing in perl (they're  
automatically converted to each other depending on context) might be  
easier for a beginner to start with ("It's a number already, why do I  
have to call .to\_i ?)  
- The language is well enough known that it might be easier to find a  
friend that use it to help out than in more unusual languages  
- The language is full enough of traps that the new programmer may  
learn "BE ALERT! TRUST NO ONE! THE LANGUAGE IS YOUR ENEMY AND MUST  
BE BEATEN INTO SUBMISSION!"

Of course, I happen to like code, and I think you can end up being  
fairly friendly with Perl after a short while - say, ten years of Perl  
experience - so it's not a total loss...

If you've got other redeeming features of Perl for beginners, I'm  
eager to hear them - if somebody can convince me I'm wrong, I've  
learned something, so I'm always in favour 🙂

Eivind.

> **···**
>
> On Feb 1, 2008 7:09 AM, Chad Perrin \<perrin@apotheon.com\> wrote:
> 
> > Is this another example of the common (mis)conception that Perl is a  
> > "write-only" language? It's not, and in fact it's an excellent language  
> > for learning to program. It just may not be the best for learning OOP,  
> > in particular.

---

<div class="post-metadata">

### Author: ![Marc\_Heiler](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@Marc\_Heiler](https://rubytalk.org/u/Marc_Heiler)
#### Post date: [3 February 2008 13:42 UTC](https://rubytalk.org/t/learn-how-to-program/44145/22 "2008-02-03T13:42:08Z")

</div>

Perl is a horrible language as far as aesthetics are concerned.

The expressions you want to do are riddled with snoopy swearing  
characters.  
I would never recommend it as a learning language.

Ruby is a lot better, however ruby in TOTAL is actually rather complex.

If you like CSS, html etc... you can start learning PHP, because despite  
being a horrible language as far as design is concerned, PHP itself is  
rather easy.

I dont think C, Java etc... fall into this language anyway because they  
dont really have the ease of dynamic programming at all.

That being said though I think a ruby programmer should couple ruby with  
a language like C++ C Java, not only because of speed, but also i.e. in  
case of C to extend ruby. (I dont really use ruby for work, I use it for  
fun and every task I need to do here)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

### Author: ![Chad\_Perrin1](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Chad\_Perrin1](https://rubytalk.org/u/Chad_Perrin1)
#### Post date: [4 February 2008 10:04 UTC](https://rubytalk.org/t/learn-how-to-program/44145/23 "2008-02-04T10:04:47Z")

</div>

Learning Perl, by Randal Schwartz, is one of the all-time best books for  
learning a programming language with very little familiarity with  
programming at all. Something like its approach with the addition of a  
teacher would make for an excellent instructional course for people who  
essentially have \*no\* familiarity with programming.

PHP gets a lot of mileage out of how easy it is to pick up from scratch,  
and do simple work with only minimal exposure. Perl has all the benefits  
of PHP in this regard, with the exception of PHP's ubiquity for  
markup-embedded coding on shared hosting accounts. What Perl \*doesn't\*  
have is its brain-damaging limitations and design characteristics.

Ruby, I think, is the best language I've ever met for teaching object  
oriented programming. I don't think it's quite as easily grasped for  
someone who has never met a programming language before as Perl, without  
additional guidance, though. Part of the reason for that is also the  
reason Ruby's so good for teaching OOP (and Perl's so damned ugly for  
OOP).

I think both Perl and Ruby are among the best languages I've ever  
encountered for teaching programming -- with each being stronger in some  
niches than the other. The same goes for UCBLogo as well.

Does that make sense?

> **···**
>
> On Sun, Feb 03, 2008 at 10:32:22PM +0900, Eivind Eklund wrote:
> 
> > On Feb 1, 2008 7:10 PM, Chad Perrin \<perrin@apotheon.com\> wrote:  
> > \> \> Ruby and Python are pretty decent choices, I think.  
> > \>  
> > \> To the list of high-level dynamic languages for teaching programming, I'd  
> > \> add Logo (specifically UCBLogo), Perl, and probably DrScheme.
> > 
> > Why Perl? I know Perl fairly well, unfortunately having done most of  
> > my programming in it over the last 12 years, but I don't see why it  
> > would be appropriate for teaching. I'd think all the weird  
> > irregularities would get in the way, but if you actually have  
> > experience with it, I'd like to hear why I'm wrong (if I'm wrong).
> 
> --  
> CCD CopyWrite Chad Perrin [[http://ccd.apotheon.org](http://ccd.apotheon.org) ]  
> McCloctnick the Lucid: "The first rule of magic is simple. Don't waste your  
> time waving your hands and hopping when a rock or a club will do."

---

<div class="post-metadata">

### Author: ![Robert9](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@Robert9](https://rubytalk.org/u/Robert9)
#### Post date: [4 February 2008 15:24 UTC](https://rubytalk.org/t/learn-how-to-program/44145/24 "2008-02-04T15:24:57Z")

</div>

The "irregularities" usually only happen when you are doing more  
complicated Perl. For a starter language there is no reason to do that  
and Perl is a good choice there. It has libraries for almost any  
aspect of programming you would want to do. I find it personally "fun"  
to program in myself and is a good first language for a hobbyist. I  
don't discount Ruby as a started language either.

Robert

> **···**
>
> On Feb 3, 8:32 am, Eivind Eklund \<eekl...@gmail.com\> wrote:
> 
> > On Feb 1, 2008 7:10 PM, Chad Perrin \<per...@apotheon.com\> wrote:
> > 
> > \> \> Ruby and Python are pretty decent choices, I think.
> > 
> > \> To the list of high-level dynamic languages for teaching programming, I'd  
> > \> add Logo (specifically UCBLogo), Perl, and probably DrScheme.
> > 
> > Why Perl? I know Perl fairly well, unfortunately having done most of  
> > my programming in it over the last 12 years, but I don't see why it  
> > would be appropriate for teaching. I'd think all the weird  
> > irregularities would get in the way, but if you actually have  
> > experience with it, I'd like to hear why I'm wrong (if I'm wrong).
> > 
> > Eivind.

---

<div class="post-metadata">

### Author: ![Regnum](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@Regnum](https://rubytalk.org/u/Regnum)
#### Post date: [3 February 2008 17:18 UTC](https://rubytalk.org/t/learn-how-to-program/44145/25 "2008-02-03T17:18:42Z")

</div>

Thanks for the answers. I decided by Ruby.

What is the best book Ruby for someone who does not have experience in  
programming?

.Learn To Program  
.Why's (Poignant) Guide to Ruby  
.Humble Little Ruby Book

Thanks.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

### Author: ![Chad\_Perrin1](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Chad\_Perrin1](https://rubytalk.org/u/Chad_Perrin1)
#### Post date: [4 February 2008 10:18 UTC](https://rubytalk.org/t/learn-how-to-program/44145/26 "2008-02-04T10:18:59Z")

</div>

> Perl is a horrible language as far as aesthetics are concerned.
> 
> The expressions you want to do are riddled with snoopy swearing  
> characters.  
> I would never recommend it as a learning language.

Paul Graham: "Real ugliness is not harsh-looking syntax, but having to  
build programs out of the wrong concepts."

I think the attitude you've shown is indicative of a very superficial  
view of programming language design -- not of problems with a programming  
language.

Much as I loathe Python, personally, I still might recommend it as a  
learning language. That's because I realize that my personal preferences  
do not, in and of themselves, amount to a definitive judgment of the  
worth of the language for teaching programming. Perhaps you could learn  
something from that example.

> Ruby is a lot better, however ruby in TOTAL is actually rather complex.
> 
> If you like CSS, html etc... you can start learning PHP, because despite  
> being a horrible language as far as design is concerned, PHP itself is  
> rather easy.

Holy cow. PHP is the new BASIC -- a great way to inflict permanent brain  
damage on yourself by learning it first. It's a rare programmer who  
starts out with PHP and fully recovers from the experience. Usually, the  
path to full recovery involves lengthy therapy with Perl, in fact -- the  
language most familiar to PHP users without its inherently brain damaging  
characteristics.

> I dont think C, Java etc... fall into this language anyway because they  
> dont really have the ease of dynamic programming at all.

Actually, C could be very useful as a first-time learning language. That  
depends to a significant degree upon the student (and the teacher, even  
if that teacher is a book), however. Most students should start with a  
higher-level language, probably dynamically typed, though OCaml is an  
interesting exception to that general guideline about dynamic typing. In  
any case, C can be valuable for its relative semantic closeness to the  
hardware.

> **···**
>
> On Sun, Feb 03, 2008 at 10:42:08PM +0900, Marc Heiler wrote:
> 
> --  
> CCD CopyWrite Chad Perrin [[http://ccd.apotheon.org](http://ccd.apotheon.org) ]  
> Larry Wall: "A script is what you give the actors. A program is what you  
> give the audience."

---

<div class="post-metadata">

### Author: ![Robert9](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@Robert9](https://rubytalk.org/u/Robert9)
#### Post date: [4 February 2008 15:24 UTC](https://rubytalk.org/t/learn-how-to-program/44145/27 "2008-02-04T15:24:58Z")

</div>

I agree with those points.

Robert

> **···**
>
> On Feb 4, 5:04 am, Chad Perrin \<per...@apotheon.com\> wrote:
> 
> > On Sun, Feb 03, 2008 at 10:32:22PM +0900, Eivind Eklund wrote:  
> > \> On Feb 1, 2008 7:10 PM, Chad Perrin \<per...@apotheon.com\> wrote:  
> > \> \> \> Ruby and Python are pretty decent choices, I think.
> > 
> > \> \> To the list of high-level dynamic languages for teaching programming, I'd  
> > \> \> add Logo (specifically UCBLogo), Perl, and probably DrScheme.
> > 
> > \> Why Perl? I know Perl fairly well, unfortunately having done most of  
> > \> my programming in it over the last 12 years, but I don't see why it  
> > \> would be appropriate for teaching. I'd think all the weird  
> > \> irregularities would get in the way, but if you actually have  
> > \> experience with it, I'd like to hear why I'm wrong (if I'm wrong).
> > 
> > Learning Perl, by Randal Schwartz, is one of the all-time best books for  
> > learning a programming language with very little familiarity with  
> > programming at all. Something like its approach with the addition of a  
> > teacher would make for an excellent instructional course for people who  
> > essentially have \*no\* familiarity with programming.
> > 
> > PHP gets a lot of mileage out of how easy it is to pick up from scratch,  
> > and do simple work with only minimal exposure. Perl has all the benefits  
> > of PHP in this regard, with the exception of PHP's ubiquity for  
> > markup-embedded coding on shared hosting accounts. What Perl \*doesn't\*  
> > have is its brain-damaging limitations and design characteristics.
> > 
> > Ruby, I think, is the best language I've ever met for teaching object  
> > oriented programming. I don't think it's quite as easily grasped for  
> > someone who has never met a programming language before as Perl, without  
> > additional guidance, though. Part of the reason for that is also the  
> > reason Ruby's so good for teaching OOP (and Perl's so damned ugly for  
> > OOP).
> > 
> > I think both Perl and Ruby are among the best languages I've ever  
> > encountered for teaching programming -- with each being stronger in some  
> > niches than the other. The same goes for UCBLogo as well.
> > 
> > Does that make sense?

---

<div class="post-metadata">

### Author: ![Ashley\_Wharton](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@Ashley\_Wharton](https://rubytalk.org/u/Ashley_Wharton)
#### Post date: [3 February 2008 17:40 UTC](https://rubytalk.org/t/learn-how-to-program/44145/28 "2008-02-03T17:40:21Z")

</div>

Having just finished reading it, I think "Learn to program" is excellent,  
very easy to read.

Why's is an amazing way of learning without realizing you are.

I think if you flip between both then it works very well.

> **···**
>
> On Feb 3, 2008 12:18 PM, Regnum@argentina.com Regnum@argentina.com \< regnum@argentina.com\> wrote:
> 
> > Thanks for the answers. I decided by Ruby.
> > 
> > What is the best book Ruby for someone who does not have experience in  
> > programming?
> > 
> > .Learn To Program  
> > .Why's (Poignant) Guide to Ruby  
> > .Humble Little Ruby Book
> > 
> > Thanks.  
> > --  
> > Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

### Author: ![Chad\_Perrin1](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Chad\_Perrin1](https://rubytalk.org/u/Chad_Perrin1)
#### Post date: [4 February 2008 10:23 UTC](https://rubytalk.org/t/learn-how-to-program/44145/29 "2008-02-04T10:23:24Z")

</div>

I agree with Ashley Wharton, re: the Poignant Guide and Learn to Program.

I found the Humble Little Ruby Book in need of some editing, frankly.  
Both of the others truly impressed me, though.

> **···**
>
> On Mon, Feb 04, 2008 at 02:18:42AM +0900, Regnum@argentina.com Regnum@argentina.com wrote:
> 
> > Thanks for the answers. I decided by Ruby.
> > 
> > What is the best book Ruby for someone who does not have experience in  
> > programming?
> > 
> > .Learn To Program  
> > .Why's (Poignant) Guide to Ruby  
> > .Humble Little Ruby Book
> 
> --  
> CCD CopyWrite Chad Perrin [[http://ccd.apotheon.org](http://ccd.apotheon.org) ]  
> Kent Beck: "I always knew that one day Smalltalk would replace Java. I  
> just didn't know it would be called Ruby."

---

<div class="post-metadata">

### Author: ![James\_Edward\_Gray\_II](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@James\_Edward\_Gray\_II](https://rubytalk.org/u/James_Edward_Gray_II)
#### Post date: [4 February 2008 16:23 UTC](https://rubytalk.org/t/learn-how-to-program/44145/30 "2008-02-04T16:23:28Z")

</div>

Interesting.

I worked heavily with a student who started with Learn to Program and I found myself needing to supplement the book a lot, just to get them to the point where they had a comfortable understanding. The file IO chapter in particular really doesn't seem to get the job done in that book.

I think everyone has their favorites.

James Edward Gray II

> **···**
>
> On Feb 4, 2008, at 4:23 AM, Chad Perrin wrote:
> 
> > I agree with Ashley Wharton, re: the Poignant Guide and Learn to Program.
> > 
> > I found the Humble Little Ruby Book in need of some editing, frankly.  
> > Both of the others truly impressed me, though.

[Previous page](https://rubytalk.org/t/learn-how-to-program/44145.md?page=1)
