Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Correct Behaviour? Was False = 2 ????

From: robbo1mark:aol at: 5-Jul-2001 13:20

JEFF, Are you saying then that almost ALL other computer languages get this wrong then by using zero based indexing? Their language designers & users too presumably have gone through all the same discussions and points that we've gone through this past week, assuming that these points have been discussed ad infinitum previously then why do you think that nearly ALL decided in favour of zero based indexing and that those who previously didn't are now shifting towards that position ie Visual Basic. YES Carl and YOU guys at RT are very smart & REBOL is really cool & a super language but are you really saying your smarter than nearly everyone who's gone before you on this quest? REBOL gets a lot of things right that other languages get wrong or make less intuitive but surely you must admit that zero based indexing aside we've discovered a LOT of inconsistencies & anomolies in REBOL behaviour in these discussions. There is still MUCH room for improvement in terms of the final language design of REBOL IMHO. Do you agree? cheers Mark Dickson In a message dated Thu, 5 Jul 2001 12:21:08 PM Eastern Daylight Time, Jeff Kreis <[jeff--rebol--net]> writes: << Howdy, Joel:
> But the simplest test of usability is to show anyone (with > no prejudicial prompting, of course) an ordered collection > of items and simply ask, "Which is the first?" They will > likely not find that a challenging question...
But they will apparently find it challenging if asked "which is the zeroth?"
> I'm simply not interested in defining that term at all.
Why? Why is it so hard to locate zeroth in your simpler system? It seems like zeroth would be a great word for zero based index systems, and yet you want to pretend it's not there, sweep it under the carpet. Tsk tsk. Where is zeroth? We have to conclude one of two (zero of one) things, in our zero indexed system: 1. zeroth position == first position 2. zeroth position comes before the first position. Easy enough right? The zeroth (first) proposition above is the only one that can be right while maintaining the definition of FIRST that you've made. So ZEROTH is FIRST, FIRST is ZEROTH. This is what makes zero based indexing so much more understandable!! The general ease for people to understand the concept of ZEROTH is concomitant with the ease of understanding zero based indexing. No need to hide our good and well suited word.
> We've already covered this. The ancient greeks also didn't > consider "one" a true number. Most people of the middle > ages still believed that the sun revolved around the > earth. . .
The argument is simply that zero based is less intuitive, not that people are incapable of groking it. People are capable of groking base 64, but few people, that I know of, balance their checkbooks in base 64. We commonly start numbering things by one. We teach our children to spread out their fingers and say "one two three.." Or do you teach children to say "zero one two.. " ending on finger nine? David Letterman counts down from 10 to 1 not 9 to 0, NASA does the same. Cars have gears starting with 1 through 4 or 5, not starting with gear zero. It's only some groups of programmers that think it natural to number things starting from zero. The rest of the world orders things starting with 1. Zero based indexing can only be justified based on what it gives you in terms of programming convenience. It can not be justified in terms of common usage. You have to weigh the utility of zero-based indexing against the relatively low "portability" of the concept. So how are we going to reindex date! values?:
>> 0-0-0
** Syntax Error: Invalid date -- 0-0-0 ** Near: (line 1) 0-0-0
>>
Oh come on, REBOL, don't complain about this invalid date! Why it's the zeroth (first) day, month, and year! Isn't that obvious?! Yesterday was: FOURTH of July, 2001, which would be:
>> 3-6-2000
== 3-Jun-2000 Clearly 3-6-2000 is the fourth day, the 7th month and the 2001st year (when we start from zero). Hey, since we're breaking all existing REBOL scripts in the interests of doing things "the right way", why not change the direction of evaluation? Left to right only makes sense in the western world. RIGHT TO LEFT is MUCH MUCH SIMPLER! Right to left is the "RIGHT WAY"!! [[item "Look at this!-->"] print][items of list] item foreach And, how about argument position? Surely it makes more mathematical sense to have the thing to operate with, followed by the thing to operate on, YES? blk: copy [] pick 0 skip -1 insert 0-0-0 blk Much clearer. Especially when we put it the "RIGHT" direction. [] copy blk: blk 0-0-0 insert -1 skip 0 pick Perhaps all statements should be parenthesized. REBOL's free format leads to tremendous ambiguity by offering familiar-looking text which is actually used in inconsistent and highly subtle/complex ways. Arity can become unclear. People should KNOW that they're really programming when they program, so we need parenthesis. ([] copy blk:) (((blk 0-0-0 insert) -1 skip) 0 pick) In fact, this whole concept of words is a little fishy. A given word may evaluate to who knows what. Very tricky, subtle/complex. Perhaps we should not allow people to directly use words but they'll call functions to get and put values based on a name. ("BLK" MAKE-NAME-VALUE) ([] copy "BLK" SET-NAME-VALUE) (((("BLK" GET-NAME-VALUE) 0-0-0 insert) -1 skip) 0 pick) I think it's obvious that if REBOL was like the above it would be cleaner, clearer, and more consistent. (: REBOL's getting easier to understand each day! Take the frog pills and seek the zeroth-- Cheers! -jeff