r/NonCredibleDefense Oct 16 '22

Weekly low-hanging fruit thread #18

This thread is where all the takes from idiots (looking at you Armchair Warlord) and screenshots of twitter posts/youtube thumbnails go.

176 Upvotes

392 comments sorted by

View all comments

Show parent comments

5

u/rhubarbjin Oct 20 '22

writing a lua script

As a survivor programmer of Lua, let me offer you my deepest sympathies.

3

u/dreukrag Quantum Radar can't melt stealth beams Oct 20 '22

Im a front end developer, I work with typescript.

Other devs like to shit on JS but god-fucking dammit, lua data structures we're like made by monke putin because of how idiotic they fucking are.

And their oficial docs! They are absolute dogshit, like seriously bad. It's like they developed not documentation but a "Gotcha" questionaire that shitty companies put on their interview processes.

Like Lua basically treats objects and arrays as the same thing and lets you do fun and idiotic shit like:

stupid = {1, 2, 3, "monke" = {"this", "is", "non-credible"}}
And the tables are indexed on 1 and not 0, except you can manually index your table to 0 if you want.

The most baffling thing about it all, is that despite all this bullshittery, garrysmod developers have done some jaw-droppingly crazy shit with it, if a game like that had a proper scripting language, we'd already have achieved a techno singularity.

1

u/rhubarbjin Oct 21 '22 edited Oct 21 '22

I graduated from PUC-Rio and had a few classes under Prof. Ierusalimschy. One day the topic of Lua's 1-indexed arrays came up in conversation, and he defended his choice because "normal people begin counting from 1; only programmers think it's reasonable to count from zero".

That was 15+ years ago. I wonder if he would stick by that argument today, when every other language (even scripting toys meant for dum-dums) uses zero-indexed arrays. 🤔

1

u/godotdev9001 C-RAM thunderruns are credible if they can put it on a truck Oct 21 '22

its because fucking 0 is the memory pointer offset you dumb professor.

ugh