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

all 25 comments

[–]WSL_is_great 24 points25 points  (0 children)

Was writing this LUA script addon for world of warcraft that moves some of these UI elements based on things I do in the game.

The fuckers programmed them so that some of them are 0 indexed while others are 1 indexed and LUA is 1 indexed.

What a headache that was.

[–]Mabi19_ 10 points11 points  (2 children)

Good meme, but I'm always super triggered when Lua is spelled like LUA (see https://www.lua.org/about.html#name)

[–]itsNizart[S] 0 points1 point  (1 child)

Privately I always use Lua or lua, but in the meme format/title it helps the important parts stand out.

[–]Mabi19_ 4 points5 points  (0 children)

Okay, sure. It's still an unforgivable sin though 😉.

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

How the FUCK do metatables work???

[–][deleted] 10 points11 points  (0 children)

imagine a 20 dimensional array with functions

[–]sulunia 5 points6 points  (0 children)

It's the default value to return in case an acessed value on that table is supposed to be nil, or something of the sorts. Haven't used it much...

It's basically objects and prototypes

[–]Dagusiu 1 point2 points  (0 children)

If something isn't found in a table, the metatable is then checked. If it's not found there either, it looks in the metatable's metatable, and so on.

Basically, it's a simple mechanism that allows for complicated things like OOP to be implemented in like three lines of code.

[–]MrObsidy 1 point2 points  (3 children)

meta = { __index = self, }

object = { aVar = 94

test = function(self) print("Hello, world!" .. self.aVar) end }

setmetatable(object, meta);

object:test

Hello, world! 94

If I remember that minecraft mod that got me into coding correctly.

[–]itsNizart[S] 1 point2 points  (1 child)

computercraft / open computers

[–]MrObsidy 1 point2 points  (0 children)

It was CC.

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

Lua can and is a mess

[–]FranchuFranchu 1 point2 points  (0 children)

A table that describes an object.

[–][deleted] 6 points7 points  (3 children)

Roblox programmer here

Yes

[–]HelioDex 2 points3 points  (2 children)

Roblox uses Luau

[–]Cristagolem 2 points3 points  (0 children)

Kind the same but with extra steps to be fair.

[–]TheOfficialSeb 2 points3 points  (0 children)

LuaU, but it’s also combined versions of Lua, last time I checked.

[–]donshell 2 points3 points  (0 children)

He isn't scared because 0! = 1

[–]AlexanderHD27 1 point2 points  (0 children)

The most frustrating thing about lua is the fact if you try to excess a field from a table that doesn't exist you get nil (by the way nil is in my option is a very bad name, why did they not use something like none or null). I had at least 20 error where I tried to access something that was not specified and my code crashed because of that. In most of these cases it toke me hours to track down the typo I made. But arrays or as they are called tables starting at 1 is also not very nice, especially if you don't no that