Mesothelioma Lawyers, New York
This might sound strange for a non-programmer, but there were good technical reasons for it. For one thing, it made it easy to calculate the memory address of any element in an array. The memory address of the element with index i was the starting address of the array itself, plus i times the size of an element.
Modulo arithmetic was also simpler, leading to more elegant implementations of things such as hash tables. For several reasons, it has now become more or less a standard for programming languages to start indexing arrays from 0.
Anyway, 0-indexed arrays meant that instead of the ranks being 2 to ace as they were in Pascal, they were now 0 to 12. Similarly, the suits no longer went from spades to clubs, but from 0 to 3.
It was no problem to do the conversion, but I had to always keep in mind the difference between the real world entities and their representation. The 6 of clubs was no longer represented as the 6 of clubs, but as the 4 (six) of 3s (clubs).
This kind of thing happened quite often when migrating Pascal programs to C. It was very common to use 1 rather than 0 as a starting index in a Pascal array. If you were a novice programmer (which most Pascal programmers were), and you had to represent a street with 10 houses, wouldn't you make the array go from 1 to 10?
Next: Page 78
Current: Page 77
Previous: Page 76
Table of Contents: Mesothelioma Lawyers, New York
Privacy Policy