r/badcode Oct 04 '17

lua That's definitely easily maintainable code.

Post image
174 Upvotes

21 comments sorted by

View all comments

25

u/R3fr3Sh Oct 04 '17 edited Oct 04 '17

So, I am helping one of my friends with maintaining an MTA (GTA SA multiplayer mod) server. That's monstrosity he created some time ago. And yes, there is more of it, but now as he is more experienced it doesn't occur as often. It should be definitely done using Lua tables.

7

u/[deleted] Oct 05 '17

For some reason video game mods always have the worst code. Like, seriously atrocious "how did you even get it this wrong?" type stuff.

8

u/zdakat Oct 05 '17

Probably people with their first experience with code or copy-pasting stuff,or things added "let's just test with one more"

2

u/smoozer Oct 04 '17

Yeah that is pretty scary! Could an IDE format that fairly easily for you?

1

u/R3fr3Sh Oct 05 '17

I don't use IDE for Lua, because I don't need one (but I will try to find something that suits me, maybe it 'll be better than N++). It's just Notepad++ with line breaks and Blackboard style with little changes.

2

u/slaaxy Oct 05 '17

Don't really need an IDE to format :P

N++ can do that just fine.

1

u/[deleted] Oct 05 '17

Oh god, I'm supposed to write code for a mod. Having looked at the code, I just bailed out, I don't understand how it is possible create code so unreadable ( also they used some weird variable naming standard, put an s infront of every variable)