Because I won’t dare tell her she’s a zero

Feb 11, 2023 4:15 PM

repsac

Views

84083

Likes

900

Dislikes

26

twitter

*MATLAB noises*

3 years ago | Likes 1 Dislikes 0

She's coding in Pascal. I get it.

3 years ago | Likes 1 Dislikes 0

3 years ago | Likes 1 Dislikes 1

3 years ago | Likes 60 Dislikes 1

Matlab agrees

3 years ago | Likes 1 Dislikes 0

Option base 1

3 years ago | Likes 1 Dislikes 0

She's easily pleased.

3 years ago | Likes 1 Dislikes 0

Off by 1 count error

3 years ago | Likes 2 Dislikes 0

zero based array?

3 years ago | Likes 1 Dislikes 0

Hey, in VBA, arrays are zero based, while collections are one based...

3 years ago | Likes 1 Dislikes 0

Well, he might be programming in LUA and thus romantic.

3 years ago | Likes 4 Dislikes 0

Or Matlab...*shudders*.

3 years ago | Likes 1 Dislikes 0

In C, where "arrays" are just a pointer to a block of memory, you advance the pointer by steps to access elements. Hence 0 steps is first.

3 years ago | Likes 3 Dislikes 0

This convention persisted in every subsequent C-like language

3 years ago | Likes 3 Dislikes 0

she might be Julia

3 years ago | Likes 2 Dislikes 0

Maybe she’s a Matlab user

3 years ago | Likes 2 Dislikes 0

Haha..what?..haha

3 years ago | Likes 4 Dislikes 2

Depends on the programming language though! Some start at 1 some at 0

3 years ago | Likes 2 Dislikes 0

Keep it up and she might become NULL

3 years ago | Likes 99 Dislikes 1

!

3 years ago | Likes 1 Dislikes 0

Only if she is a pointer, better make her a reference to be sure though.

3 years ago | Likes 1 Dislikes 0

Or Undefined.

3 years ago | Likes 1 Dislikes 0

Careful now, you gonna end up with a dangling pointer.

3 years ago | Likes 18 Dislikes 0

3 years ago | Likes 6 Dislikes 0

3 years ago | Likes 84 Dislikes 0

3 years ago | Likes 25 Dislikes 0

hunter2

3 years ago | Likes 7 Dislikes 0

3 years ago | Likes 6 Dislikes 0

The programming language will often decide that, not the programmer.

3 years ago | Likes 5 Dislikes 0

bash?

3 years ago | Likes 7 Dislikes 0

3 years ago | Likes 4 Dislikes 0

*array in ascending order by priority

3 years ago | Likes 2 Dislikes 1

Dear downvoter: You don’t actually think an array is necessarily in any specific order, do you?

3 years ago | Likes 2 Dislikes 0

for you friends, [1] is the second item in an array. The first being [0]

3 years ago | Likes 508 Dislikes 2

Thanks for explaining this to me. You’re the real MVP.

3 years ago | Likes 2 Dislikes 0

A programming chat-friend once wrote: "I really would like to have an F0-key on my keyboard." :-D

3 years ago | Likes 4 Dislikes 0

He’s a vba programmer

3 years ago | Likes 1 Dislikes 0

#Matlab #Lua - ordinal vs. offset

3 years ago | Likes 2 Dislikes 0

(and fortran... fogetaboudit)

3 years ago | Likes 1 Dislikes 0

For this reason, especially when I talk to students, I refer to items 0–3 as the zeroth, oneth, twoth, and threeth elements.

3 years ago | Likes 24 Dislikes 0

Way to give the joke away

3 years ago | Likes 2 Dislikes 1

his wife assured me she doesn't visit imgur

3 years ago | Likes 1 Dislikes 0

Unless youre on Matlab. Fuck Matlab

3 years ago | Likes 9 Dislikes 0

I was looking for this comment....XD

3 years ago | Likes 4 Dislikes 0

Depends on the language. In most C-descendant languages that is true. But for instance in Fortran it isn't, indices start at 1 there.

3 years ago | Likes 9 Dislikes 0

isn´t there one where you when you delcare the array if 0 or 1 is the start?

3 years ago | Likes 2 Dislikes 0

You save this for if she ever figures it out. Babe, my metaphorical code life is actually one-based-indexed!

3 years ago | Likes 9 Dislikes 0

Unless you’re programming in R. Then the first row is 1 - sensible, there is no 0th data point. Under the hood, the 0th might be col names.

3 years ago | Likes 3 Dislikes 0

It might be sensible, but 0-index is convenient. It's the amount of offset from the start of the array. Of course it's more convenient the >

3 years ago | Likes 4 Dislikes 0

How is it more sensible it's 2^0 -> 2^1 etc. in binary as well. Changing it to 1 is absolute lunacy. Java SB fs web dev though so I'm a .

3 years ago | Likes 1 Dislikes 0

lower your abstraction level is (the memory location for item is [start_of_array]+[index*space_single_item_takes]) and largely a leftover >

3 years ago | Likes 4 Dislikes 0

from older times. But when iterating an array you are as likely to need the "number of previously completed iterations" as the alternative.

3 years ago | Likes 4 Dislikes 0

Same in Fortran. Both R and Fortran have been made for Data/Math while C is for general systems programming, where index 0 makes sense.

3 years ago | Likes 4 Dislikes 0

R is built on top of Fortran. Same with MATLAB. So those aren't independent instances of this decision.

3 years ago | Likes 1 Dislikes 0

And as a mathematician, zero indexing makes sense a lot of the time. So the math background is not really a good argument.

3 years ago | Likes 2 Dislikes 0

For many but not all programming languages.

3 years ago | Likes 118 Dislikes 2

You're THAT guy at the party

3 years ago | Likes 1 Dislikes 0

Shaking my head at Lua

3 years ago | Likes 11 Dislikes 0

And MATLAB

3 years ago | Likes 3 Dislikes 0

And maxscript (3ds Max)

3 years ago | Likes 1 Dislikes 0

Also, elementat vs inserts, vs array.length, not even consistant in own languages. Still funny as hell. Only 10 types of PPL, 1 will get it

3 years ago | Likes 3 Dislikes 0

For the ones that matter

3 years ago | Likes 97 Dislikes 3

And also cobol. Your bank account (likely) appreciates cobol

3 years ago | Likes 2 Dislikes 0

For the [0]s that matter.

3 years ago | Likes 7 Dislikes 0

Fortran, MATLAB and R are somewhat important.

3 years ago | Likes 23 Dislikes 3

"somewhat" fortran underlies a huge amount of computational software distributions (including matlab), matlab rules programming for R&D

3 years ago | Likes 1 Dislikes 0

Cobol

3 years ago | Likes 2 Dislikes 0

Cobol

3 years ago | Likes 5 Dislikes 0

Clearly not to Sslvek Parenica.

3 years ago | Likes 2 Dislikes 0

Sure. But mattering to him and mattering, period, are two very different things.

3 years ago | Likes 2 Dislikes 1

Not to me.

3 years ago | Likes 23 Dislikes 3

Almost no programming languages are important to you. How many are you actively using? 2? 3?

3 years ago | Likes 1 Dislikes 3

I feel like these are all just about as antiquated as they get. Index zero is very important for a lot of base level math.

3 years ago | Likes 1 Dislikes 0

People still write in C. Antiquated does not mean anything.

3 years ago | Likes 2 Dislikes 0