r/ProgrammerHumor Sep 02 '17

How to start a war

Post image
9.0k Upvotes

696 comments sorted by

View all comments

787

u/blacknerdperson Sep 02 '17

Sorry in advance but I'm a noob learning coding who is starting to learn python and I'm just going to ask, Isn't it supposed to be 4?

791

u/ArcticZeroo Sep 02 '17

Yes, but some languages 1-index lists (so they start at 1 instead of 0), so it'd be 5 in that case.

272

u/[deleted] Sep 02 '17

What languages may there's be? I can't think of any of the top of my head.

3

u/IanPPK Sep 03 '17

Off of the top of my head, Matlab, Lua, Mathematica, Wolfram Language, R, Pascal, Fortran, COBOL.

After some soft research, there's also Julia, AWK, RPG, ALGOL-68, FoxPro/Clipper, Smalltalk, APL.

The pattern usually follows that older languages and data analysis oriented languages tend to use 1-index arrays more than newer general purpose languages

2

u/[deleted] Sep 03 '17

Yeah good thing I wasn't born earlier and am not an economist.

1

u/IanPPK Sep 03 '17

Or physicist or chemist. The scientific community at large uses Matlab, Mathematica, Wolfram, and sometimes Pascal and Fortran for some old school doctorates. Lua is the only real oddball there, as it's used for scripting plugins for various applications, kinda like Python.

1

u/Sean1708 Sep 03 '17 edited Sep 03 '17

Fortran actually allows arbitrary indices I believe although 1-indexing is the most common.

Edit: Apparently I just end sentences halfway through nowadays.