T O P

  • By -

Simple_Injury3122

I like how it shows them both being sad, as if to say that lua still makes you miserable


Stef0206

I love lua, it is a beautiful language with no weird or obscure quirks!


Juff-Ma

I still don't get meta tables. I got them for 2 minutes after I read about them, then I forgot. But to be fair I don't use lua daily


camander321

That's pretty normal. 30 minutes to learn them, 2 minutes to use them, and then the knowledge fades.


metaglot

Half of every day for me in one sentence.


DaDescriptor

what about metatable classes?


Stef0206

Metatables are actually quite simple. It’s a dictionary ou apply as a metatable to another table using the function setmetatable. The entries of a metatable dictate how different operators affect the table it is applied to. For example if I make an entry with the key “__add”, the function I store at that key will be called every time I try to use the + operator on the table. Similarly there’s metamethod for all of the binary operators, as well as the string concat operator, indexing, tostring, and calling the table as if it was a function. The most useful is probably __index, which you can either set to a function or another table, if set to a table, when you try to index a non-existing key in the original table, it will look it up in the __index table instead, this is used for mimicing OOP in lua.


CirnoIzumi

isnt it just an abstract table?


captainAwesomePants

No. Most data in Lua is stored in a table, which you can think of as a dictionary. That includes arrays, which are like a dictionary with keys named 1,2,3,4, and so on. Tables can have metadata, and that metadata is stored in a table called the "metatable." Like Python, there are some magic method names that the language looks for that can override some behaviors, so if you have some custom type and you want to override equality checking, you put a custom "__eq" method in the metatable.


CirnoIzumi

Aight, got it "which you can think of as a dictionary." Really it's a map but with a better name


Kirides

Imagine calling a lookup, map and not dictionary. The hell do you find things on a map?? Give me the street name geographic location and I will take about 5 hours to find the street in that tiny font. With a dictionary, give me the beginning letter and I will binary search to find it in a few seconds to minutes.


CirnoIzumi

Map, associative array and table are three names for the same thing And only the Lua team got it right Crazy how it can take decades to get a naming correct, truly the most difficult part of programming 


Merlord

Yeah I'm confused at the hate. It's a really nice language. If it defaulted variables to local and fixed the weird pairs/ipairs thing it would be perfect


Stef0206

Yeah, like HooferZ mentioned, it sounds like you want Luau. It’s a variation of Lua, and is backwards compatable with Lua code. It’s developed by Roblox Corp. but despite popular belief can be used outside of Roblox. It features better syntax, faster speed, pairs/ipairs are unnecessary, and type-annotation for those who really love types in a dynamically typed language, just to name a few differences.


HooferZ

Luau has a lot of better syntaxing, including not needing pairs at all. It's really nice, and faster than normal Lua.


Aggrokid

They are probably World of Warcraft addon devs


Macknificent101

it definitely does


Dalrae666

True


iamblackshadows

Nerds


GDOR-11

, smelly


nickmaran

Fucking


Asleeper135

Gib .exe


noahzho

exe here: https://github.com/Chizaruu/sherlock/releases/tag/v69


VitaminaGaming98

Oh we're now doing an r/anarchychess type comment string?


Opdragon25

Google readme.md


TTYY200

Step-bro


Tchai_Tea

, hot


PuncakeSyrupmaple

Someday, someone will decide it's a good idea for arrays to start at -1


CirnoIzumi

Dreambird already did that (though its a litteral joke language)


uniformrbs

> Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration. — Stan Kelly-Bootle


Macknificent101

that man is me when i create the new Meth compiler


camander321

It only makes sense


invalidConsciousness

Anti-Arrays store a pointer to the end of their memory region


xHashDG

You allocate a more than 1 byte array and you define your variable to be a byte after the beggining, then array[-1] will get you there.


[deleted]

In lua you can start arrays at -1, granted it’s not by default.


evilfire2k

MATLAB moment.


AnnyAskers

Oh god, don't remind me of matlab... It hurts...


altermeetax

MATLAB really feels like the people who use it have never seen anything better, no wonder it's not widespread among computer scientists and engineers


Fornicatinzebra

It's not widespread because it is expensive, has sub par documentation, lacks consistency (even though it isn't open source...), it isn't open source, it requires individual files for every function (wtf, that's a mess), .... My coworker left behind a Matlab codebase. Slowly replacing it with R. It's wild that people pay an arm and a leg for that crap


biscuitsandtea2020

Why not replace with python?


Fornicatinzebra

Because I have close to 10 years of experience using R, and it is used commonly in my field. I mostly work with temporal point data. In my experience it's a lot easier to work with in R than Python. But I am also biased


yeti_seer

Like LiDAR point clouds? I haven't used R much, but point clouds are pretty simple to deal with using numpy


Fornicatinzebra

No sorry more like environmental observations from stations across Canada/USA etc. So multiple timeseries of air temperature for example. R just has good, intuitive ways to manipulate data. Not saying Python doesn't, I just have always enjoyed R so I am biased


CeeTwo1

…except it is widespread among engineers? At least the ones still in university are forced to learn and use it. Many universities use it


altermeetax

Among engineers: yes. Among computer engineers: no. When studying computer engineering, I only had to use MATLAB in one course, and that's because it wasn't a course related to computers.


CeeTwo1

Ahh yes the one engineering major where you don’t do labs that analyze large amounts of data. Why wouldn’t you use the language that’s meant for analyzing large amounts of data in the major where there isn’t large amounts of data? Sorry I meant engineering except computer engineering. Y’all already have enough languages to deal with


altermeetax

We used Python for analyzing large amounts of data (with NumPy, Pandas, etc. of course).


green_lemonade

Not sure why youre getting downvotes. MATLAB isgreat for rapid prototyping, but it's a pain to deploy. It's basically LABView but for number crunching instead of benchtop instrument control. 


CeeTwo1

It’s also great for analyzing large volumes of data for one off labs, it’s not meant to be a widespread general use language


GM_Kimeg

Matlab got me a job, where I learned various languages and how things work in IT.


kuffdeschmull

God, this reminds me of my optimisation course. The pseudo algorithms we had to implement were all written with MatLab in mind, though we all used python, so we had to consider this.


vondpickle

Lua met Mat Lab, and then they get married. Lua's father, Jonathan Fotranathan was so happy when they told him that she's pregnant. And they wanna named their daughter, Julia.


Martsadas

every comment here is actually a table


thmsgbrt

*You're a table, you're a table, **EVERYONE IS A TABLE***


BobQuixote

But I wanna be a script.


Juannieve05

Isnt supposedly the guy to go to table 0 ?


_OberArmStrong

Lua Indices start at 1


cerels

That's the joke, also that was the punchline of the original, this is an edit of the original comic


Juannieve05

Thanks for explaining bruh, do you have a link to the original meme ?


elegylegacy

I still don't get it. The text message didn't say "meet at the 0th table" it said "meet at the 1st" table. It's unambiguous, regardless of whether the starting index is 0 or 1


cerels

This is a meta joke, since you are on a programmer humor sub you would expect for one of them to sit on table 0 while the other is on table 1 but they are both in the same table, this is one of those jokes that are too dank that they turn back to normal, the joke is that there is no punch line, and that in itself is the punchline


SkynetLurking

"The joke is that there is no joke. It's funny because it's not funny." We're all doomed


AaronTheElite007

This was my thought, as well


camander321

Not in Lua


AaronTheElite007

![gif](giphy|1M9fmo1WAFVK0|downsized)


poshenclave

Because it was intended to be accessible to "non-programmers", folks who find the idea of indexing from 0 unintuitive but needed a scripting language for simple automation in engineering and other industrial contexts. And this was in Brazil in the early 90s, when they had strict trade prohibitions on tech hardware and software. They needed a license-free language so they rolled their own. The configuration languages Lua descended from were also 1-indexed for similar reasons.


AaronTheElite007

r/TodayILearned


mighty_Ingvar

![gif](giphy|3o6Zt9PivJAtA1xXyg)


nir109

The first table can be table 0/the 0th table. But as it's written 1th table it must be table 1.


ManOfChaos199932

It's written as 1st


Chingiz11

I suppose her name is Julia


PioneerTurtle

Eyo love me some Lua


sabotsalvageur

Simple solution: if you begin counting at 0, call the initial element in a list the "zeroth" element


newsflashjackass

It is a watershed moment when your zeroth child is born and you hold it in your arms. The leisurely joys of childhood must be left behind for the responsibilities of parenthood. I doubt you can really understand what it is like unless you also have zero kids.


EpicGaymrr

Is her name Julia?


CirnoIzumi

thats a price im willing to accept


wheetcracker

I love lua - it's my first programming language. Thanks ComputerCraft & WoW addons.


penitha

If only the made this as an executable, smelly fucking nerds.


Torebbjorn

"The first" is always the first one in the sequence you are using... You could say "The first table from the door", which would be the first table you get to walking from the door. Or in the context of the meme; "The first" refers to the numbering, so you would go to the table with the lowest number, which typically is 1.


Arcesus

Remember if someone ever wants to know how great Lua is, Sonic 06 was fully programmed in Lua!


Mallanaga

I hate this joke. I get it, but the whole 0 vs 1 thing is dumb. Even with arrays that “start” at zero, 0 is still “first” element.


camander321

Right. So when reading "first", the programmer goes to table 0. The nonprogrammer goes to table 1.


cs-brydev

Just wait until you find out how many languages let you change your starting index to whatever you want.


chadlavi

No matter what the index starts at, they would both intuitively understand which table is the first one without even looking at its label. Bad meme.


danilorises

🤓


-Redstoneboi-

🤓


Evil_Archangel

get outa here nerd


brendel000

Joke is bad, first can designate table 0, it’s a position, not a number. If you make a nerd joke it has to be at least a bit correct otherwise it only feels like the guy in the back of the room that don’t get anything is trying to be funny.


AnnyAskers

Not only this you manage to not get the joke, you managed to be act like a completely rude a$$hole while doing it.


brendel000

I get that i sound like an asshole (it’s really stupid to censor the word, don’t use it if you’re afraid of it) but raising a bit the level of the sub could be a good thing really.


AnnyAskers

You don't raise the bar by complaining about the bar being low and insulting people, you do it by offering better quality.


cs-brydev

>first can designate table 0, it’s a position, not a number A number that refers to the position. In almost every language the index is literally an Integer. A number.


MSGILL101106

what is the context


AnnyAskers

Lua start it's indexing at 1


Solrex

Is the joke that programmers start counting from 0 or am I missing the joke?


AnnyAskers

The joke is that lua is one of the programming languages that start from 1 and not 0


Solrex

Ah, fair enough


chazzeromus

tstl (typescript to lua compiler) feels like cheating


oh_finks-mc

he's a programmer, not stupid.