From: Chris Pine Date: 2002-12-05T09:45:45+09:00 Subject: Re: Ruby Book for People Who Aren't (Yet) Programmers ----- Original Message ----- So you suggest I quickly start using the terms 'String', 'Float' and 'Integer'. Is that right? What do you suggest I do when the student finds out that '3.class' returns 'Fixnum' instead of 'Integer'? ---------------------------- Why would anyone use 3.class? As far as I'm concerned, they shouldn't even know about the 'class' method until they are well beyond my tutorial. Why? Because it is almost always used for bad things! If anything (and I still don't think this is really a good idea), you could use the 'kind_of?' method, which would work fine with Integer. I find both of these methods rarely useful in 'getting things done', and that's what a tutorial should focus on, IMHO. For example, I have personally found 'method_missing' to be far more useful (and academically interesting) than 'class'. But that is probably outside of the scope of my tutorial, too. I don't know about you, but I don't want to rewrite the pickaxe. I just want to prepare someone for being able to use it confidently. I'm thinking of my tutorial as sort of an 'unofficial prequel'. ---------------------------- I don't see why you have to introduce 'Bignum' as soon as you introduce 'Fixnum'. One could just use the terms 'Fixnum', 'Float' and 'String' and never mention 'Bignum'. ---------------------------- Perhaps... I don't like Fixnum much, but Float and String aren't really obvious names to a non-programmer, either. I guess the reason I favor Integer over Fixnum is that sometimes you won't have a Fixnum: (1234567890*1234567890).class --> Bignum It just feels wrong to say that non-Float numbers are Fixnums, because they *aren't*... at least not always. If you divide the Numeric type into two parts and one of them is Float, the other is Integer. And how do you explain that to_f returns a Float, and to_i returns a Fixnum? '999999999999999999999'.to_i.class --> Bignum Well, to_i *doesn't* return a Fixnum; it returns an Integer. It just feels to me like the 'right' way to do it. Chris