[erlang-questions] Improve $handle_undefined_function

Rustom Mody rustompmody@REDACTED
Thu Jan 24 19:23:10 CET 2013


On Thu, Jan 24, 2013 at 10:51 PM, Loïc Hoguin <essen@REDACTED> wrote:

>
> What is it with zero-based indexes that make people so morbidly
>> fascinated by them. If you are talking *offsets* then I agree that
>> zero-based is fine, it's saying how far away something is from a some
>> point. But here we are talking *indexes*, you know like first, second,
>> third, etc. No indexes start at one! And don' go on about how C does it
>> because C doesn't have arrays and indexes it has pointers and offsets,
>> foo[3] is just syntactic sugar for *foo+3. And don't go on about how
>> much easier it is to count from zero, I don't buy that, we can all add
>> and subtract one without problems. Or at least I hope so.
>>
>
> There are only two hard problems in computer science: cache invalidation,
> naming things, and off by one errors.



I can drive a car with European controls or one with American controls.
And yet whenever I change over, I end up turning on the wiper when I want
to turn on the turning lights.

Its fine to make fun of people who fixate over 0/1 based indexing.
Having both in the same language is really an invitation to chaos.
We are seeing that in our project where the initial list based prototype is
now being replaced by an array based one.

How much time is spent on this debugging is left to the imagination!

"Should array indices start at 0 or 1? My compromise of 0.5 was rejected
without, I thought, proper consideration." -- Stan Kelly-Bootle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130124/2ce1498e/attachment.htm>


More information about the erlang-questions mailing list