On Feb 18, 2007, at 8:55 PM, Daniel L. Taylor wrote:

I've always felt that there must be a difference of opinion at RS over whether "lists" should be indexed starting with 0 or with 1 given how RB objects can differ in this regard. But this example takes the cake:

RecordSet.IdxField is 1-based. But RecordSet.ColumnType is 0-based even though it's not marked as such in the Language Reference. This is within the same object refering to the same "list" of items!

Like endian issues, you just wish someone, in the earliest days of computing, had won the argument one way or the other, with everyone following the rule forever forward. You don't care who or which side, you just wish one had been picked :-)

0 is more natural for programming, IMHO. But this is thing 1 the designer of a new framework should decide: do lists start with 0 or 1? And then they should stick to it.

You'll notice that the original designer of REALbasic tried to deal with this intelligently. So rather than a Count(Array), we have UBound (Array), so you can index from 0 to that and it works. Sadly, this sort of policy is not followed throughout the framework, either.

What's even worse, in REALbasic, the docs are such that it is often difficult to determine whether a given index starts with 0 or 1. It's *usually* there, somewhere, but often not on the page you're looking on. Sometimes you've got to look at the examples.

I hate playing hunt-the-do-we-start-with-0-or-1. Hate it.

I wish I could convince REAL that:

a) Good docs are really important; and
b) Theirs ain't.

So far, certainly no luck with b).

Regards,

Guyren G Howe
Relevant Logic LLC

guyren-at-relevantlogic.com ~ http://relevantlogic.com

REALbasic, PHP, Ruby/Rails, Python programming
PostgreSQL, MySQL database design and consulting
Technical writing and training


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to