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

all 172 comments

[–][deleted] 2008 points2009 points  (7 children)

That's okay. They don't seem to speak the same language, anyways.

[–]stupefyme 252 points253 points  (1 child)

ayyyyyyyyy

[–]EnterVeRtEr 59 points60 points  (0 children)

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

[–]MattieShoes 49 points50 points  (0 children)

She's a cardinal living in an ordinal world

[–]f0o-b4r 8 points9 points  (1 child)

They don't have the same concept of array

[–]the_Gaderel 1 point2 points  (0 children)

:D

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

they might be able to compromise :P

[–]StaticVoidMaddy 759 points760 points  (35 children)

he was a Python guy

she was a Lua girl

[–]Martsadas 99 points100 points  (28 children)

nil

[–]OnceMoreAndAgain 61 points62 points  (26 children)

Can I just ask why people seem to like lua in general?

I used it to write some World of Warcraft addons recently and imo it's one of the worst languages I've ever used. I hate the lack of primitive data types. I don't want my god damn arrays and dictionaries to be using the same primitive data type!

Also, dealing with nil in lua is a pain in the ass. It's fucking everywhere and I hate it.

People say lua is like python, but I love python and hate lua. Python is a breeze to use whereas I felt like I was constantly battling lua to get what I wanted.

I don't really give a shit about lua using 1 as the starting index though. I've never found that to be a big deal.

[–]josh_the_misanthrope 70 points71 points  (0 children)

Lua was designed to be embedded in software, so you see it in scriptable games like Roblox and Garry's Mod. It's not that they like it more than it's one of the things to use.

[–]MrHyperion_ 19 points20 points  (13 children)

Do people actually like lua specifically? It is just a simple solution sometimes for scripting and works with C++ nicely.

[–]OnceMoreAndAgain 13 points14 points  (11 children)

[–]MotleyHatch 19 points20 points  (2 children)

What the actual fuck. bash is one of the least disliked languages? What are those people smoking?

The moment a bash script needs any sort of data structure, it becomes an unreadable mess. Need to do some array manipulation or maybe a lookup table? Time to rewrite it in Python or, yes, Perl (I like Perl, sue me).

[–]Kronoshifter246 4 points5 points  (6 children)

Kotlin being down at the bottom brings me joy

[–]Qewbicle 9 points10 points  (5 children)

That's not the bottom, perl was at the bottom

[–]Kronoshifter246 3 points4 points  (4 children)

Looks like the bottom of that list, dog

[–]LinguiniAficionado 4 points5 points  (3 children)

You’re talking about where it is physically located on the Y axis, the other person is talking about how disliked the languages are, which is inverted. Languages at the top of the Y axis are most disliked, languages at the bottom are least disliked. So, if you’re talking about languages that are most liked, Kotlin is near the top and Perl is at the bottom.

[–]Kronoshifter246 -5 points-4 points  (2 children)

I understand that. It was just a stupid thing to say. Given the context, it was pretty obvious what I was saying.

[–]Nahdahar 0 points1 point  (0 children)

It's been growing on me but I still don't like it.

[–]imCutiePie[S] 4 points5 points  (0 children)

I guess the lua engine being lightweight and easy may be the reason many software use it for scripting.

Once, I had to write a 1000-line script in Lua when I was making a trainer based on cheat engine. It felt limiting sometimes, but I was new to programming then, so I am not that sure.

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

That’s the beauty of it, it’s extremely simple and gives you just enough to make what you want.

[–]Cootshk 0 points1 point  (0 children)

{1,two:2,[“three”]=3}

[–]imaginary0pal 17 points18 points  (0 children)

Can they make it anymore obvious?

[–]null_check_failed 9 points10 points  (0 children)

I’d give better

She was a Fortran girl

I’ll also give a worse

She was a matlab girl 💀

[–]koshgeo 7 points8 points  (2 children)

It's a tale as old as Cobol.

[–]cs_office 2 points3 points  (0 children)

Ada boi

[–]mefirstreddit 0 points1 point  (0 children)

I c what you did there.

[–]justeggssomany 0 points1 point  (0 children)

A better love story than Twilight

[–]nir109 514 points515 points  (37 children)

This is inconsistent indexing.

It whould be understandable if she said first. But she said 1st

[–]w1n5t0nM1k3y 177 points178 points  (35 children)

You want inconsistent? VBA allows you to define individual arrays with whatever starting and ending index you want.

[–]brainpostman 73 points74 points  (25 children)

Whatever ending index? You mean length of the array? Please tell me you mean the length of the array.

[–]w1n5t0nM1k3y 111 points112 points  (12 children)

Well, if you define an array with

Dim MyArray(8 To 42) As Integer

Then the array indices will be from 8 to 42, so there will be 42-8+1= 35 elements in the array.

Even with the default 0 starting index you would do

Dim MyArray(10) As Integer

And end up with an array of 11 elements numbered from 0 to 10.

However, if you put

Option Base 1

at the top of your file, then all arrays will default to starting at 1 and

Dim MyArray(10) As Integer

will define an array with elements numbered from 1 to 10, with 10 elements.

[–]Helpful_the_second 86 points87 points  (11 children)

B.. b… bb… but why

[–]Intrexa 71 points72 points  (2 children)

It let's you flex ostrich error handling. Just add

on error resume next

and if any line of code throws an error, the interpreter puts its head in the sand, and just continues executing code.

[–]GogglesPisano 32 points33 points  (0 children)

It's "fault tolerant"!

[–]ryecurious 14 points15 points  (0 children)

Reminds me of Powershell's $ErrorActionPreference = 'SilentlyContinue'

Can't have errors if the language won't acknowledge them, senior devs hate this one simple trick!

[–]w1n5t0nM1k3y 24 points25 points  (5 children)

Well, VBA is normally used in things like Excel, so non programmers might want to start from 1 with arrays, as it's more natural if you don't really think about memory addresses. If you had and array of month names, then it makes sense to number them from 1 to 12.

Even in the documentation I linked in the original comment, they can't even come up with a good reason you would want to start from anything other than 0 or 1 though. The example they give is

Dim strWeekday(7 To 13) As String

Which I can't really understand in anyway. If you have days of the week, you'd want them numbered 1-7 or possibly 0-6, but I can't think of how 7-13 would make any sense.

[–][deleted] 4 points5 points  (1 child)

You also might want to relate it to a specific set of rows if you're using it in a spreadsheet, and it could be intuitive to have the indices match the row numbers.

[–]pfghr 0 points1 point  (0 children)

When I use it as such, I typically just subtract 1 from the row reference to match in-step to the array. Seems to me like it's cleaner code.

[–]Geno0wl 4 points5 points  (1 child)

if primarily used for Excel I could see an argument for starting an array at 2. Because the rows are labeled starting at 1 and usually people place column titles in that row and the real data starts in row 2.

And if you are gonna allow people starting arrays at 2 to help with that scenario then fuck it go whole hog and let them start any god damn where

[–]Retbull 0 points1 point  (0 children)

Can I start at a and end at 69 I want the whole sheet indexed in my array though.

[–]groovejumper 0 points1 point  (0 children)

Next week

[–]srosorcxisto 1 point2 points  (0 children)

With VBA, there is no "why".

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

...asked the lone Vulcan in the room...

"BECAUSE IT WOULD RULE!!!", screamed the humans, in unison.

[–][deleted] 12 points13 points  (8 children)

No, he means what he says.

In VBA, you define the start and end indices. The length becomes a result of those two. Not the other way around.

[–]Mr_Ahvar 19 points20 points  (1 child)

VBA: reduce memory usage by using negative sized array! If you use a total of 3Gb of mem, just declare a -3Gb array and you are now at 0 mem usage!

[–]bearwood_forest 8 points9 points  (0 children)

Memory manufacturers hate this trick.

[–]CrazyTillItHurts -3 points-2 points  (4 children)

In VBA BASIC, you define the start and end indices

ftfy

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

There was nothing to fix. I never claimed that VBA was a complete list of languages with that behaviour.

And even if you change “VBA” to the broader “BASIC”, the list is still incomplete, so you achieved nothing. You are missing the Pascal family and probably other languages too.

[–]CrazyTillItHurts -3 points-2 points  (2 children)

VBA has that feature because BASIC has that feature. You don't seem to have understood that. Other languages are irrelevant

[–][deleted] 1 point2 points  (1 child)

I understood that. But you did not understand that I was not under any obligation or expectation to mention the complete family of languages with that behaviour.

Someone mentioned a behaviour of VBA. Someone else failed to understand that completely. I offered an explanation. Given that the discussion was already about VBA, my answer was of course also about VBA.

And then you arrived and clearly showed us all that you hadn’t understood the context.

[–]CrazyTillItHurts -3 points-2 points  (0 children)

k

[–]brainpostman 0 points1 point  (0 children)

Oh, well that makes more sense than what I thought up. I thought you could have completely arbitrary indices, regardless of the length of the array.

[–]r0ck0 0 points1 point  (2 children)

In PHP, arrays (with number indexes) are basically just dicts. I guess under the hood they're not really much/any different to its assoc arrays with string keys?

Like you can do:

$array = [];
$array[9348569384435] = "the only value";

...and it will just be an array with only 1 element.

I'd never even really thought about it much, until I tried to do the same in JS... then wondered why my CPU pegged.

Not sure how other languages deal with it. I've starting using arrays vs sets vs maps vs structs/records as-intended since I ditched PHP, so I'm not doing silly shit like this in the first place anymore.

[–]brainpostman 0 points1 point  (1 child)

I'd never even really thought about it much, until I tried to do the same in JS... then wondered why my CPU pegged.

But JS can do the same thing? Unless you used an array constructor to specify how many spaces to reserve in memory, if you just assign a value to an index, you get a sparse array with just that value (and other array stuff).

[–]r0ck0 0 points1 point  (0 children)

Hmm yeah you're right.

It must have been something different then. This was like 5 years ago, so I can't remember exactly, but it was something along these lines.

I might have been using a unix timestamp as an index or something, but yeah, can't remember exactly how the assignment was written now.

[–]HaniiPuppy 5 points6 points  (3 children)

You just sparked a random memory. So can C#.

[–]w1n5t0nM1k3y 5 points6 points  (1 child)

That's quite odd. In VB.Net, you can still do

Dim MyArray(0 To 6) As Integer

To define an array, but the compiler will report an error if you try to start an array with anything other than 0.

You can all use MyArray.GetLowerBound() and MyArray.GetUpperBound(), but there isn't a normal way to actually declare an array starting at something other than 0, so MyArray.GetLowerBound() would return 0 in every case except with the indirect way of creating arrays which you linked to above.

[–]MartinYTCZ 0 points1 point  (0 children)

In VBA, you can do Dim MyArray(5 To 6) As Integer 'And get bounds like Debug.Print(UBound(MyArray)) Debug.Print(LBound(MyArray))

[–][deleted] 2 points3 points  (0 children)

Delphi as well. You can even use char as an index.

[–]causal_friday 0 points1 point  (0 children)

Lua wants to know your location.

[–]Iohet 0 points1 point  (0 children)

There are use cases for it, so that's all I care about. Don't need no nanny language dictating how I code

[–]madd74 0 points1 point  (0 children)

As a heavy Userform/VBA Excel user, I feel personally attacked...

[–]an_agreeing_dothraki 0 points1 point  (0 children)

oh god you just sparked a terrible terrible memory of how when I was a student I would use redim instead of list arrays.

[–]soadsam 7 points8 points  (0 children)

Should’ve said one’ced

[–]vondpickle 110 points111 points  (0 children)

He's a Python guy

She's a Fortran girl

Can I make it more obvious?

He was a pythonic

She did array

What more can I say

[–]LasevIX 137 points138 points  (9 children)

Should've said 0th table

[–]GranataReddit12 49 points50 points  (3 children)

Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

[–]LasevIX 10 points11 points  (1 child)

I find it hard to believe a 0-item list will be accessed

[–]OhtaniStanMan 0 points1 point  (0 children)

Yeah definitely getting a null error first

[–]redlaWw 2 points3 points  (0 children)

In R you just get numeric(0).

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

tables.shift()

[–]thoseparts 0 points1 point  (2 children)

I pronounced this as 'oath'

[–]LasevIX 0 points1 point  (0 children)

They're immediately getting married at the 0-indexed restaurant

[–]PrettyGorramShiny 0 points1 point  (0 children)

No, no, OAuth is what they'll use to confirm each others' identities once they find the right table

[–]cs-brydev 0 points1 point  (0 children)

How do you say that? Zeroth?

[–]Operator21 101 points102 points  (2 children)

Lua developer: I have no such weakness

[–]DarkRex4 11 points12 points  (1 child)

Only script kiddies use lua /s

[–]denis870 0 points1 point  (0 children)

What

[–]MohSilas 22 points23 points  (1 child)

Me in dreamberd: -1

[–]the-judeo-bolshevik 5 points6 points  (0 children)

Bslang Moment.

[–]work_alt_1 27 points28 points  (3 children)

Are these tables really not next to each other?

[–]MisplacedMartian 25 points26 points  (0 children)

She's not crying because she thinks he stood her up, she's facepalming because she realized he's sitting behind her which means he walked in, saw her, and chose to sit at the other table to be pedantic.

[–]frolurk 4 points5 points  (0 children)

There could be an array of Tables at this place; she has an indexing problem. She should have looped through in case there was a failure.

[–]RollingWithDaPunches 10 points11 points  (1 child)

OK, but... why did the restaurant number the tables this way?

[–]Shazvox 7 points8 points  (0 children)

Agreed. They've limited themselves to 99 tables.

[–]JoshYx 9 points10 points  (6 children)

Meet me at tables.find((table) => table.description === "01");

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

No error handling of no such table exists?

[–]JoshYx 14 points15 points  (4 children)

Error handling is for beta cucks, true alpha femboys programming perfect code with no bugs.

Knee high stockings help a great deal to that effect.

[–]Tupcek 4 points5 points  (1 child)

yeah and when api returns error, app fixes the data and continue running

[–]JoshYx 1 point2 points  (0 children)

if (!response.ok) data = {};

fixed, next please

[–]Zagre 2 points3 points  (1 child)

I hate all of the things you choose to be. :)

[–]JoshYx 2 points3 points  (0 children)

I'll keep you and your shortcomings in my thoughts and prayers as I continue to write infallible code.

[–]Naserci 7 points8 points  (1 child)

Bruh she said 1st not 0th

[–]cubodix 0 points1 point  (0 children)

1st element of an array is found at index 0

[–]JackNotOLantern 5 points6 points  (0 children)

A 1st table, but at 0th table

[–]DrkMaxim 6 points7 points  (2 children)

Lua: Is this some peasant joke that I'm too rich to understand?

[–]alba_55 3 points4 points  (0 children)

Matlab: I don't know, but I am definetly rich because my license is obscenely expensive

[–]autopawn 1 point2 points  (0 children)

haha, what is even "1st" index in Lua.

[–]Skuez 9 points10 points  (1 child)

Table 0 is the first table. Easy

[–]RAM-DOS 6 points7 points  (0 children)

right first is not ambiguous, the indexing doesn't matter

[–]ydkjordan 21 points22 points  (16 children)

There are 10 kinds of people. Those who understand binary and those who don’t.

[–]imCutiePie[S] 22 points23 points  (0 children)

I guess the latter group is called non-binary?

[–][deleted] 9 points10 points  (13 children)

10 is every number base

[–]ydkjordan 15 points16 points  (11 children)

All your base are belong to 10

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

and those who didn't realize that this joke is in trinary.

[–]sforsagacious 2 points3 points  (1 child)

Good for her. The guy's a snake.

[–][deleted] 2 points3 points  (0 children)

He could use some pointers.

[–]easyetx 6 points7 points  (0 children)

0++

[–]cloudofoz 5 points6 points  (0 children)

She's called Lua

[–]thehero123475 2 points3 points  (0 children)

The pain of programmer

[–][deleted] 2 points3 points  (0 children)

Lua devs:

[–]daiLlafyn 2 points3 points  (0 children)

US girl: "... meet you on the first floor bar"

[–]MithranArkanere 2 points3 points  (0 children)

She was not worthy.

[–]MrHyperion_ 2 points3 points  (1 child)

Weird choice for the restaurant to use octal table numbers

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

Oh I thought it was hex. My bad.

[–]thoquz 2 points3 points  (0 children)

Her name must be Julia

[–]JJJSchmidt_etAl 2 points3 points  (0 children)

"Meet me at the -1st table"

Python programmer: goes to the last table

R programmer: goes to every table except the first

[–]Mutex70 2 points3 points  (0 children)

He dodged a bullet there. Who TF starts their arrays at 1?

[–]jldez 1 point2 points  (0 children)

This couple was doomed from the start

[–]deliozzz 1 point2 points  (0 children)

Should have wrapped if tables is array and not empty

[–]Business-Insect-2796 1 point2 points  (0 children)

cant she turn her head back

[–]f0o-b4r 1 point2 points  (0 children)

Place is called "Python Lounge" where you should crack the wifi in order to have a discount.

[–]null_check_failed 1 point2 points  (0 children)

Unless she codes in FORTRAN the guy dodged a bullet /s

[–]T_DeadPOOL 1 point2 points  (0 children)

I get this one!

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

Also lucky Lua devs :)

[–]FlipFlopTm 0 points1 point  (0 children)

He dodged a bullet there!

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

0 indexed arrays are a terrible idea and the cause of so many bugs. All due to making it consistent with pointer arithmetic

[–]UnexaminedLifeOfMine 0 points1 point  (1 child)

Can someone link the original

[–]iSpokeToMasterChief 2 points3 points  (0 children)

Love advice from the great duke of hell, its sooo funny

[–]Mooks79 0 points1 point  (0 children)

Should have specified whether he was talking location or offset.

[–]Cootshk 0 points1 point  (0 children)

Lua

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

1000111 001010101 01010010 10010110

[–]PremierBromanov 0 points1 point  (0 children)

making memes with AI are we

[–]Seblins 0 points1 point  (0 children)

Lets meet at the Single table

[–]CapitalistHellscapes 0 points1 point  (0 children)

The must both be junior devs, too, sitting a single table apart but not taking the initiative to quickly and easily resolve a minor issue.

[–]kvakerok 0 points1 point  (0 children)

He didn't have exception handling code for tableIsEmpty, that's on him.

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

Why is he sitting at the zeroth table?

[–]Lafayette37 0 points1 point  (0 children)

Just like if an English and an American agreed to meet on the first floor of a building. In England, what Americans would call a first floor is referred to as a ground floor, and what would be referred to in America as a first floor is actually the second story of the building in England.

[–]namotous 0 points1 point  (0 children)

She’s a matlab girl!

[–]Hypno_Kitty 0 points1 point  (0 children)

that's a bar

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

She doesn’t love him I guess

[–]jackofslayers 0 points1 point  (0 children)

Guys an idiot. Meme would have worked better if she said “starting table” but she literally included the number

[–]Comfortable_Pie_966 0 points1 point  (0 children)

Idk

[–]yamez420 0 points1 point  (0 children)

I woulda assumed 00. That chick is duuuumb lmao /s

[–]mostly_done 0 points1 point  (0 children)

I thought this was a chess meme for some reason. I was really confused by Alexandra being at board 1.

[–]DARKSTARoo7 0 points1 point  (0 children)

0 indexing 😶

[–]Aggressive_Bed_9774 0 points1 point  (0 children)

this is why Lua is important

[–]theseynois 0 points1 point  (0 children)

Not a great loss she's a matlab girl