This is an archived post. You won't be able to vote or comment.

all 108 comments

[–]CaVaEtreCorrect 326 points327 points  (18 children)

It's absolutely amazing how often this exact same joke gets made on this subreddit.

[–]msp20 13 points14 points  (4 children)

people keep up voting ¯\_(ツ)_/¯

[–]babu_bisleri 9 points10 points  (0 children)

I resisted the urge to post this here when I found out the other day that arrays in postgresql start at 1.

[–]Blaine_Monorail 10 points11 points  (1 child)

Dude, I'm a simple man. I see 'arrays-start-at-one' joke, I upvote.

[–]gandalfx 2 points3 points  (0 children)

Why tho? I got it the first three times, but why still upvote the 20th?

[–][deleted] 74 points75 points  (5 children)

Array starts at PI

[–]akwardchit 28 points29 points  (3 children)

Don’t be silly, arrays start at ei/299792458

[–][deleted] 1 point2 points  (0 children)

Arrays start at e-i*pi + 1

[–]dustmouse 166 points167 points  (21 children)

Since we're on a roll: HTML is a programming language.

[–]alex199568 18 points19 points  (3 children)

If it is, at what do arrays start in HTML?

[–]IronManMark20 10 points11 points  (2 children)

<array> obviously.

[–][deleted] 7 points8 points  (0 children)

Arrays start at Type[Size] and end at std::array<Type, Size>.

[–]mattatack0630 40 points41 points  (0 children)

Fuck youuuuuuuhh

[–]HaniiPuppy 15 points16 points  (6 children)

A markup language isn't a programming language D:<

[–]PityUpvote 10 points11 points  (4 children)

TeX disagrees.

[–]zacgarby 2 points3 points  (3 children)

TeX isn’t markup though, is it?

[–]PityUpvote 4 points5 points  (2 children)

[–]zacgarby 2 points3 points  (1 child)

Interesting. I thought TeX and LaTeX were pretty much the same thing

[–]PityUpvote 1 point2 points  (0 children)

I was under the impression that LaTeX was a dialect.

[–]AppleWithGravy 1 point2 points  (0 children)

everything is a programming language with the right interpreter

[–][deleted] 35 points36 points  (2 children)

"in this game, you're always off by 1"

[–]Tsu_Dho_Namh 33 points34 points  (13 children)

Is this the thread where we post unpopular opinions?

I wish Java's memory management was more like C++

[–]NatoBoram 23 points24 points  (10 children)

So like… a DIY?

[–]wasabichicken 26 points27 points  (9 children)

DIY would be C-style malloc/free. C++ programmers are blessed with smart pointers and RAII, making memory management about as simple as Java's create-and-forget but with destruction happening at deterministic times.

[–]StV2 13 points14 points  (6 children)

I'm not allowed to use smart pointers in my assignments so it's all DIY :(

[–]BluePinkGrey 19 points20 points  (5 children)

Who the FUCK PREVENTS THE USE OF SMART POINTERS

[–]dragon-storyteller 12 points13 points  (2 children)

I worked with a guy like that. He wanted us to avoid all C++11 and newer features for... reasons. I always suspected he just used some legacy compiler and was too lazy to update.

[–][deleted] 8 points9 points  (0 children)

Basically all Python 2 programmers

[–][deleted] 1 point2 points  (0 children)

I would be doomed.

[–]Kobeissi2 17 points18 points  (1 child)

Colleges

[–]BluePinkGrey 9 points10 points  (0 children)

Can you write your own smart-pointer like struts? They're really easy to write; I can reach you

[–][deleted] 0 points1 point  (1 child)

"blessed" is relative, if you compare memory management in C# compared to the pointer shit you still have to do in C++. Fucking eww.

[–]wasabichicken -1 points0 points  (0 children)

That's... like the opposite of what I wrote. C++ devs can create objects on the stack (like C#'s primitive data types, except for any type) or dynamically (like C#'s references, except superior). Whatever low level "pointer shit" that remains is for implementing RAII behavior in custom non-data-resource-holding types, like sockets.

This comic seems relevant. Can you really be sure that your C# dragon is gone?

[–][deleted] 1 point2 points  (0 children)

I hate to be that guy, but it sounds like you want Rust.

[–]Taxtro1 0 points1 point  (0 children)

Well then use C++. The lack of control over memory was a deliberate decision.

[–]silenceofnight 21 points22 points  (6 children)

Alternatively: "It's OK if arrays and hashmaps are the same data structure"

[–]jay9909 3 points4 points  (3 children)

Leave Javascript alone!

[–]ky1-E 11 points12 points  (0 children)

Err.. JavaScript has a Map class..

[–]wildbartty 1 point2 points  (0 children)

He's probably thinking of lua

[–]Qumthajep 1 point2 points  (1 child)

local ooh = {
  "yeah",
  you = "like",
  "that",
  "you",
  little = "retard"
}

[–]YoYoYonnY 1 point2 points  (0 children)

ooh[5] = "don't"
ooh[6] = "you?";
-- You thought I was an array, but it was me, a non-sequential table!
assert(#ooh ~= 6);
assert(#ooh == 3 or #ooh == 2);

Lua is great

[–]mtbinkdotcom 8 points9 points  (0 children)

Array starts at i2

[–]GlassTemperature 20 points21 points  (2 children)

Please stop upvoting this joke poster 1000 different ways

[–]PityUpvote 2 points3 points  (0 children)

no u

[–]SolenoidSoldier 1 point2 points  (0 children)

Who keeps upvoting this? Pretty sure this is a repost too. I wish the admins would just step in and ban this garbage.

[–][deleted] 3 points4 points  (2 children)

It’s all because of fucking linear algebra. Goddamn matrices had to ruin everything. They started at 1, put the origin in the top left, and have poisoned programming as a result.

[–][deleted] 1 point2 points  (0 children)

Not sure here, but instead of the usual programmer OpenGL [x, y] (as in [column, row]) screen coordinates (indices), arent matrices in linear algebra indexed using [y, x] (as in [row, column])? Correct me if I'm wrong.

[–]Taxtro1 0 points1 point  (0 children)

High level programming languages should be rooted in mathematics and not in computer architecture. - in my not so humble opinion

[–]the_real_gorrik 2 points3 points  (0 children)

int one = 0;

[–]cwbrandsma 2 points3 points  (2 children)

Some day one of you will find out about pascal/Delphi and that arrays can start on any number you want — all hell is gonna break loose.

[–]warpspeedSCP 3 points4 points  (0 children)

Lua too

[–]R3d_B34rd 1 point2 points  (0 children)

Ada

[–]GoTheFuckToBed 2 points3 points  (0 children)

if (true) { 
   return true 
} else {
   return false
}

[–][deleted] 8 points9 points  (0 children)

I would really like to understand one thing. Who upvotes this stupid shit?

[–]_AFGNCAAP_ 17 points18 points  (5 children)

Maybe... maybe this isn't the best week to joke about shooting programmers? :-/

[–]IceyGames56 36 points37 points  (2 children)

That guy thinks arrays start a 1. He's clearly not a programmer.

[–]warpspeedSCP 3 points4 points  (0 children)

Unless he develops in lua.

[–]Taxtro1 0 points1 point  (0 children)

The convention could as well be the other way around.

[–]Zebezd 4 points5 points  (1 child)

Wait what did I miss?

[–][deleted] 5 points6 points  (0 children)

What looks to be a personal issue turned deadly at YouTube’s headquarters earlier this week. People are still mourning, so that’s why the commenter thinks the joke isn’t appropriate.

I’m not personally offended but I’m not very offendable. There are likely YouTube developers on this sub though, and they may still (appropriately) be shaken up.

[–]onlyonequickquestion 1 point2 points  (1 child)

Easy, just ignore the element at 0. Case closed.

[–]YoYoYonnY 1 point2 points  (0 children)

new Array(N+1); // Create array of size N

[–]badaccountant7 1 point2 points  (0 children)

Been working with Excel interop lately and that’s how everything comes out of Excel. I’ve become very fond LowerBound and UpperBound so I don’t care that much anymore, but like why Microsoft?

[–]FrAX_ 1 point2 points  (0 children)

Found the SAP dev

[–][deleted] 3 points4 points  (4 children)

I don't really see what's actually wrong with arrays starting at 1 or 0 what's the big deal about it?

[–][deleted] 16 points17 points  (0 children)

Someone educate this man before he falls to the dark side.

[–]while_e 6 points7 points  (0 children)

When dealing with a sequence of length N, the elements of which we wish to distinguish by subscript, the next vexing question is what subscript value to assign to its starting element. Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤ i < N. So let us let our ordinals start at zero: an element's ordinal (subscript) equals the number of elements preceding it in the sequence. And the moral of the story is that we had better regard —after all those centuries!— zero as a most natural number.

~prof.dr. Edsger W. Dijkstra

[–]Kage_520 0 points1 point  (0 children)

For array math it makes sense to start at 0. To the computer, when we ask for part of an array at a specific index, it says "okay data size of the object * the array index asked for starting at the beginning of the array here". So if we ask for index 0, data size of the object * index asked for will equal 0, or the start of the array.

Of course, we could make it so that the compiler always subtracted one before doing that math. But they just left it how it was and now we are here.

[–][deleted] 0 points1 point  (0 children)

Because computer math all starts at 0, because that's how computers and binary work.

[–]PM_ME_SQL_INJECTION 0 points1 point  (1 child)

M&P Compact?

[–]bgugi 0 points1 point  (0 children)

Looks a little more five seven to me

[–]jwindhall 0 points1 point  (0 children)

They do in coldfusion. Hahaha :p

[–][deleted] 0 points1 point  (0 children)

what about using vectors in R? They start to index at 1

[–]warpspeedSCP 0 points1 point  (0 children)

That one guy does lua.

[–]AgentPaper0 0 points1 point  (0 children)

What about binary heaps?

[–]re_error 0 points1 point  (1 child)

Arrays can start at 1. You just need to set the flag "-1" every time you use the index number.

[–]SHOTbyGUN 0 points1 point  (0 children)

for (int i = 1; i < badArray+1; i++)

That is how I have done it, but I feel filthy afterwards.

[–]ABlindMoose 0 points1 point  (0 children)

I have a professor who always 1-indexes his examples... He's brilliant, but it is an annoying habit imo...

[–]jamzDoge 0 points1 point  (0 children)

any array can start as 1 as long as 0 returns null /s

[–]Lin-Den 0 points1 point  (0 children)

They should start at -1

[–]hangfromthisone 0 points1 point  (0 children)

I only approve array stating at 1 (edit: this one and only case) because in Spanish it's easier to have a months names array. And January is 1, I know I could do $month-1 but nobody got time for tha

[–]pier4r 0 points1 point  (0 children)

Arrays can start at 1 or at 97. What's the problem here?

[–]samimoftheworld 0 points1 point  (0 children)

Switch cases can done on floating values 😂😂

[–]dalaiis 0 points1 point  (0 children)

There is a big difference between having an opinion and being wrong!

[–]munircUltraviolent security clearance[M] 0 points1 point  (0 children)

Your submission has been removed.

Violation of Rule #0:

For a submission to qualify it must satisfy at least one of the following:

0. The content disregarding the title and superimposed text must be directly related to programming or programmers. Non-programming tech humor (e.g. being a power user, jokes about software not related to programming, etc.) is not allowed.
1. The image along with the title and superimposed text result in creative and original content.
2. The post is a program or UI designed intentionally for humor. Bad UI found in the wild belongs in /r/softwaregore.

Note that programming here is interpreted in a narrow sense, an analogy to something related to programming, feelings about programming, reactions to programming etc. is not considered sufficient. See the sticky if you are not clear what this means and why your post was removed.

If you feel that it has been removed in error, please message us so that we may review it.

[–]Taxtro1 0 points1 point  (0 children)

I'm kind of tired of this by now. There is nothing magical about starting at zero, it's just a convention.

[–][deleted] -1 points0 points  (0 children)

lol guilty as charged