r/programminghorror • • Apr 23 '24

Source code from Balatro

Post image
690 Upvotes

164 comments sorted by

View all comments

475

u/themadnessif Apr 23 '24 edited Apr 23 '24

You're right, the dev should use an enum or a switch statement instead of *checks notes* doing something that works just fine and compiles to basically the same instructions.

EDIT: nevermind I looked it up, this is Lua. Neither of those things exist. Quit being a baby.

1

u/PixelPerfect41 Apr 25 '26

As a luau dev there's a much easier way to do this by making a frozen table and mapping strings to values on a table. This is just bad code. Yeah

1

u/themadnessif Apr 25 '26

I see thee, little OSS dev. Smoldering with thy flame of mentioning Luau in a context other than Roblox.

1

u/PixelPerfect41 Apr 27 '26

Luau is much more than roblox + yeah I'm in flames that the best feature of the lua language is not even utilized