Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Printing why's (poignant) guide to ruby

Reply
Thread Tools

Printing why's (poignant) guide to ruby

 
 
Joao Pedrosa
Guest
Posts: n/a
 
      02-14-2005
Hi,

> Um yeah the whole program is syntactically wrong. Fortunately Python
> tells you there's an error on practically every single line.


This is the required behaviour of good languages. When there is a
detectable error, tell it to the user/programmer.

> Learning and understanding syntax is one of the first steps of a
> newbie, even with something like Scheme which doesn't really have much
> of a syntax. I believe it is an important first step.


Every step is important, even making money after getting to know the
language better.

> If you don't have a clue about the basics like this, you'll soon fail
> miserably whether you're using Ruby or not. And come-on, who's going
> to explain yield and blocks to a newbie?


We just take what we can handle. No need to explain everything that a
language can do before someone can write his programs. I remember a
kid that would use lots of lines in his code until he learned how to
make a loop.

> Why do you think Java became so popular? The creators have often said
> it is because the language started out with a relatively small number
> features and wasn't overwhelming to intermediate programmers.


Java was meant was an embedded systems language. It is obviously being
used in wrong places than its creators had envisioned.

Why don't you let him learn Java, then? The same language of the pros?
That's right. It certainly isn't the most newbie-friendly language out
there. It demands lots of reading/asking/figuring out until one can be
reasonably proficient with it. But I know that some kids love Java.
They are 12 or 13 years old and already do some Java. So it's
possible.

That said, the reason that I don't use Java is probably because
Microsoft didn't support it in a good way and never will. So while
Java and DotNet are fighting, I prefer to try to eat their lunch.

> I'm trying to context-switch to the point of view of a newbie. I
> believe starting small is important when learning.


We are the guys who make languages, tools, operating systems and
programs complex in the first place. I don't think that we can think a
lot like the users of our systems.

Cheers,
Joao


 
Reply With Quote
 
 
 
 
Alexander Kellett
Guest
Posts: n/a
 
      02-14-2005
On Feb 14, 2005, at 8:13 AM, Navindra Umanee wrote:
> If you don't have a clue about the basics like this, you'll soon fail
> miserably whether you're using Ruby or not. And come-on, who's going
> to explain yield and blocks to a newbie?


context switch required.
blocks are trivial to understand.
creation of looping constructs
isn't exactly needed in the first
weeks of programming even.

Alex



 
Reply With Quote
 
 
 
 
Raphael Bauduin
Guest
Posts: n/a
 
      02-14-2005
Richard Dale wrote:
> I'd like to try ruby on non-programmers teaching them using why's amazing
> guide, to see how it works as a beginner's language. I showed some ruby
> code to my 45 year old lodger who has never used a computer or seen a
> computer program. He said "it looks like English, I thought computer
> programming was maths". And he is especially impressed with the cartoon
> foxes in Chapter 3, they have got to be the killer feature..
>
> But it would be great to be able to print the guide out as a PDF. Is there a
> version with markup available, so it can translated to a PDF to make it
> easier to print?
>


About printing the guide:
If you can't get a clean printable version, you can always try htmldoc. It's
already helped me for those kind of print jobs.

http://www.htmldoc.org/


Raph

> -- Richard

 
Reply With Quote
 
James Britt
Guest
Posts: n/a
 
      02-14-2005
Navindra Umanee wrote:
> If you don't have a clue about the basics like this, you'll soon fail
> miserably whether you're using Ruby or not. And come-on, who's going
> to explain yield and blocks to a newbie?


It wouldn't be the first, or even the second, thing I would teach, but a
newbie needs to learn them so as to stop being a newbie.

I don't think they are as hard to explain as one might think. (Making
full use of them is much harder, but getting the essential idea and
basic syntax and semantics may be pretty straightforward).
>
> Why do you think Java became so popular? The creators have often said
> it is because the language started out with a relatively small number
> features and wasn't overwhelming to intermediate programmers.


Perhaps *they* say that, but I don't believe it. Java(tm) had (and has)
major corporate marketing, and solved a number of problems in a manner
less convoluted than C++. It did a comparatively good job of stealing
some of the better ideas from earlier languages (semi-OO, use of a VM +
byte code). Plus it let you make crapplets, and the Web was just
emerging when Java arrived.

>
> I'm trying to context-switch to the point of view of a newbie. I
> believe starting small is important when learning.


Very true, but Ruby does a better job than most languages at starting
with simple basic operations and building upwards to more powerful
constructs.

There are fewer arbitrary and inconsistent conventions and commands that
require a lot of hand waving to explain.

A risk with any language that is designed to be good for beginners is
that the language may end up being best for beginners. Ruby avoids this.

James



 
Reply With Quote
 
Jim Weirich
Guest
Posts: n/a
 
      02-14-2005

Navindra Umanee said:
> I also got confused seeing "yield" there. Hmm, I didn't know Python
> supported that.


Don't know if you are aware of it or not, but yield in Python is quite
different than yield in Ruby. Python's yield creates a generator, a
sort-of limited use continuation.

--
-- Jim Weirich http://www.velocityreviews.com/forums/(E-Mail Removed) http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



 
Reply With Quote
 
Alexander Kellett
Guest
Posts: n/a
 
      02-14-2005
On Feb 14, 2005, at 3:55 AM, James Britt wrote:
> It's the more abstract stuff (e.g., blocks, high-order functions, even
> the notion of a variable) that spooks them.


how can a variable confuse? its just a name. anyone who's done basic
algebra gets it straight away surely?
as for blocks, surely you just provide the use cases? i can't see
[1,2,3].each { |value| } providing much
confusion honestly other than the obvious first blocker - the syntax.
high order functions? what are they then?

alex



 
Reply With Quote
 
Alexander Kellett
Guest
Posts: n/a
 
      02-14-2005
reading this again. still shocked...

On Feb 14, 2005, at 12:19 AM, Navindra Umanee wrote:
> How is a total beginner going to learn Ruby? By reading Pickaxe? I'm
> not talking about a CS student here. My dad lives half-way around the
> world from me.


already answered this one.

> Besides, Python is a more restricted and syntactically uniform
> language. Ruby is more flexible and expressive, but IMHO to really
> understand the code you have to know more CS concepts and have a
> deeper understanding of the syntax than some people like to admit.


python is confusing as hell. you try to explain why they have to
get the indent levels right on every line. people can't even deal
with the correctness of html (as is obvious given the **** on the web)
never mind python.

> Even though in Ruby you can abuse the syntax or treat it glibly --
> which makes it look like a nice thing for experienced programmers -- I
> think it is better to understand what you are doing first. Python
> forces you to understand these issues.


ummm... without some backup i'd have to say you're trolling.

> I prefer Ruby but I think Python will be easier for a beginner to
> grasp at the beginning, and it has less hurdles as well
> documentation/book-wise -- I even saw one of the beginner books
> describe how to implement a neat graphical game in a few steps.


chris pines tutorial answers this problem already.
anyways. this is about materials. i doubt that you're
really expecting to shove the python stdlib documentation
in front of your father and get a regexp engine out of
him in the coming days...

> And yeah, VB has wizards and stuff on top of plenty of documentation.
> Like I said, quicker gratification can be a good thing. Someone used
> to fancy windows and GUI stuff probably isn't going to be happy stuck
> at the command-line level. Joao makes a good point, of course.


okay. i don't even want to start on this point because it
means one inevitable thing.

<rant>

sorry but this is just getting stupid. "fancy windows and gui stuff"
are you talking about vb? the confusing as crap to advanced and beginner
users piece of cruft that m$ managed to build over the last 10 years
with seemingly no real advancements whatsoever? non resizable
interfaces,
awful damn confusing language syntax, slow as hell on old machines.

gimme my a nicely syntax highlighted irb with gui builder integration
anyday over this crap!

</rant>



 
Reply With Quote
 
Michael Walter
Guest
Posts: n/a
 
      02-14-2005
On Tue, 15 Feb 2005 00:41:45 +0900, Alexander Kellett
<(E-Mail Removed)> wrote:
> reading this again. still shocked...
> On Feb 14, 2005, at 12:19 AM, Navindra Umanee wrote:
> > Besides, Python is a more restricted and syntactically uniform
> > language. Ruby is more flexible and expressive, but IMHO to really
> > understand the code you have to know more CS concepts and have a
> > deeper understanding of the syntax than some people like to admit.

> python is confusing as hell. you try to explain why they have to
> get the indent levels right on every line. people can't even deal
> with the correctness of html (as is obvious given the **** on the web)
> never mind python.

FWIW, from my experience "people" have very few problems understanding
indentation in Python.

Michael


 
Reply With Quote
 
Gavri Fernandez
Guest
Posts: n/a
 
      02-14-2005
On Mon, 14 Feb 2005 08:19:20 +0900, Navindra Umanee
<(E-Mail Removed)> wrote:
> Alexander Kellett <(E-Mail Removed)> wrote:


> Besides, Python is a more restricted and syntactically uniform
> language. Ruby is more flexible and expressive, but IMHO to really
> understand the code you have to know more CS concepts and have a
> deeper understanding of the syntax than some people like to admit.


No. Ruby is only complex when you work on complex problems. (I mean
that in the sense that the complexity allows for elegant solutions.
Rails for example). When Ruby is used as a tool to teach programming,
there is no reason to use any of the complex constructs.

Python's procedural mix only works against itself for when used to
learn programming.

For someone who is new to programming
"string".display
wouldn't feel less natural than
print "string"

Really, think about that.

And why should we try to teach them the procedural paradigm and then
say 'Hey! forget all that stuff you learnt. It's not really a good way
to program. Now i'll teach you the object-oriented way" ?

Of course, all of this I say assuming that the goal is to create an
object-oriented programmer, not a procedural one.


--
Gavri
---------------------------------------------------
I blog here: http://gavri.blogspot.com


 
Reply With Quote
 
Ruth A. Kramer
Guest
Posts: n/a
 
      02-14-2005
James Britt wrote:
> Navindra Umanee wrote:
> > If you don't have a clue about the basics like this, you'll soon fail
> > miserably whether you're using Ruby or not. And come-on, who's going
> > to explain yield and blocks to a newbie?

>
> It wouldn't be the first, or even the second, thing I would teach, but a
> newbie needs to learn them so as to stop being a newbie.
>
> I don't think they are as hard to explain as one might think. (Making
> full use of them is much harder, but getting the essential idea and
> basic syntax and semantics may be pretty straightforward).


Challenge: Well, how about explaining them (or at least blocks)?

If you attempt it, how about explaining blocks from the point of view of
an ex-Algol, Pascal, PL/1 programmer, for whom a block is just a way of
grouping several statements together so they can all be executed as a
result of some "test" (like if then else, while do, etc.). Is there
something extra or different about a Ruby block? What?

Enquiring newbies want to know

Randy Kramer


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 2 11-27-2010 12:12 PM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:52 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:50 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:28 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-18-2007 10:11 AM



Advertisments