r/programminghorror • u/DroneCyn • Oct 11 '26
Lua i sure do love not using local variables!
getfenv getfenv getfenv getfenv!
299
Upvotes
r/programminghorror • u/DroneCyn • Oct 11 '26
getfenv getfenv getfenv getfenv!
107
u/SceneOutside4377 Oct 11 '26
Me when my professor says "Make sure your code is readable, I'll be reviewing it manually"
5
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Oct 11 '26
WTF, are they storing everything in environment variables???
42
u/emazv72 Oct 11 '26
Stack allocation sucks. I'm joking
36
u/MMORPGnews Oct 11 '26
Fent env
23
u/boiledbarnacle Oct 11 '26
Hey! He was paid by the char.
18
u/No-Point8651 Oct 11 '26
The type of shit you see in legacy production code. Bonuspoints if its security critical, contains files and api calls
16
u/akoOfIxtall Oct 11 '26
This gets me wondering what people consider good code, because apparently there isn't a consensus it's just how much the code manages to be functional, not verbose where it shouldn't, readable and maintainable
6
u/WannaCry1LoL Oct 12 '26 edited Oct 12 '26
getfenv()forces luau to deoptimize the environment because it's considered tainted so this actually hurts both readability and performance5
u/Sophira Oct 12 '26
I love having impossible-to-debug race conditions.
3
u/Jazzlike_Platypus430 Oct 11 '26
What the hell
2
u/JohnVonachen Oct 11 '26
DRY. Don’t repeat yourself.
2
u/DesiresQuiet Oct 12 '26
Lua just makes me sad.
2
u/Havunenreddit Oct 13 '26
This is very inefficient code btw...
2
u/kwead Oct 14 '26
LMAO i think we were all once roblox studio spaghetti chefs
1
u/anderbaka Oct 12 '26
Classic Luau.
1
u/hammerclawz Oct 12 '26
W roblox luau
1
u/dosenscheisser Oct 13 '26
I dont even know where to start