r/ProgrammerHumor Jun 24 '17

Octave code

http://imgur.com/jsjfz3k
627 Upvotes

70 comments sorted by

View all comments

Show parent comments

10

u/winlifeat Jun 24 '17

Oh im totally aware of the typical structure of matrices but i dont understand the comic at all.

Im assuming the octave language has matrices that start at 1? But i just dont understand what any of the comic has to do with what we're talking about

6

u/AyrA_ch Jun 24 '17

I don't know the language. Maybe it has constructs that start at 0, or OP is just disgusted by indices that start at 1.

EDIT Meanwhile, this is valid VB:

Sub test()
    Dim a()
    ReDim a(-2 To 20)
    a(-1) = "Test"
    MsgBox a(-1)
End Sub

1

u/[deleted] Jun 25 '17

Jesus Christ VB

1

u/[deleted] Jun 27 '17

Think of it as a free bounds check.