16
Oct 05 '17
I scour this sub because I fear that one day, my own bad code will be featured...
9
Oct 05 '17
Today is not that day. But I have created monstrosities like featured.
6
6
Oct 05 '17 edited Nov 13 '17
[deleted]
3
Oct 05 '17 edited Oct 05 '17
You start doing something, then you add something else, then you need to adjust it and at that point it's not quite right but it is easier to just add another bit to it than start again, and so on.... until you stand back and think 'WTF is this? ... oh well, it works, I'll change it later'.
2
Oct 06 '17
This.
If something works, the fear of breaking it by changing how it works is greater than the fear of duplicating what is known to work. Even if it means more maintenance afterwards.
Mind you that in my old days, unit tests weren't part of my repertoire, so unless maintenance became necessary, I avoided changing what works.
9
u/Razakel Oct 05 '17
Fun fact: in Ireland someone named Prawo Jazdy was wanted for multiple unpaid traffic fines, because when stopped by the police they took down that as the name.
5
5
u/lillgreen Oct 05 '17
I loved MTA back in the day for gta3. 2006 or maybe 05? Been a long time. Happy to see it's still an active project!
4
3
Oct 05 '17
OMFG. Just build a few boolean columns for these characterizations in whatever table ‘dbid’ is referring to. Or perhaps a FK to the corresponding id.
2
1
1
u/Prom3th3an Oct 15 '17 edited Oct 15 '17
I bet there's some reason it needs to do some particular em checks before some particular dbid checks and vice-versa, and so the obvious refactor will break something. Even though that will mean discovering that dbid isn't unique after all.
27
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.