r/computerscience • • Mar 03 '20

E.W. Dijkstra: Why array numbering should start at zero (1982)

https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
197 Upvotes

21 comments sorted by

13

u/teddyone Mar 03 '20

Fun, interesting and brief. Great read.

8

u/polymorphiced Mar 03 '20

glares at Lua

2

u/[deleted] Mar 03 '20

lol why _did_ they do that? a brief skirmish with it indicates much to like and some good intentions but, but, but ...

2

u/QuadraticLove Mar 04 '20

I remember reading this a long time ago. It's very good and concise.

3

u/SftwEngr Mar 04 '20

I've used a language that uses index starting at 1 not 0 and don't recall it ever making any significant difference.

3

u/quackchewy Mar 04 '20

Was it MATLab? If it was then it does make a difference because MATLab sucks

2

u/[deleted] Mar 04 '20

It does in R

1

u/phord Mar 04 '20

When I learned BASIC I thought the arrays started at 1. By default they had 11 elements so you could use 1 to 10. I was a long ways in before I realized there was a zero position.

-1

u/eastend183 Mar 04 '20

Yes I’m used to arrays beginning at 1.

0

u/[deleted] Mar 03 '20

[deleted]

1

u/Necessary_Pop Mar 04 '20

You had the opportunity to be taught by him. Wow I am young so I do not get to meet my legend.

0

u/[deleted] Mar 03 '20

[deleted]

27

u/Fedzbar Mar 03 '20

I’m not sure I understand? Python lists start at 0 too

6

u/[deleted] Mar 03 '20 edited Apr 10 '25

dime worry intelligent cautious friendly follow gold workable numerous reach

This post was mass deleted and anonymized with Redact

4

u/Impe98 Mar 04 '20

I thought he or she meant that they were used to arrays starting at 1 as opposed to 0 (through using older languages in which this was the case), so using Python that is 0-indexed is troublesome

0

u/taulover Mar 03 '20

And also end at length-1, as expected, and also have a lot of various functionality to make dealing with them easy.

1

u/Fedzbar Mar 03 '20

Yeah a variable start_list_index makes me think that they don’t really know what they’re doing in python (maybe a beginner though)

-68

u/[deleted] Mar 03 '20

[removed] — view removed comment

11

u/_Singh_ Mar 03 '20

bad bot

4

u/B0tRank Mar 03 '20

Thank you, Singh, for voting on WellWishesBot.

This bot wants to find the best and worst bots on Reddit. You can view results here.


Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!

6

u/c3534l Mar 03 '20

Reddit is not now, nor ever was, a bastion of positivity. Choke on shit, robit. You don't even bring any good news or insights.

87

u/[deleted] Mar 03 '20

[removed] — view removed comment

7

u/[deleted] Mar 03 '20

Good bot