Bad code examples


I wanted to share example of how not to write code:

(and to get more posts on this forum)

(He who abuses the search function) #2

Looks… code-y? I really can’t see the issue. (though I’m not good at coding, so…)


The issue is that the file is a monster at 5000 lines long and there’s so much nesting and spaghetti in it that it’s hilarious to programmers. I remember seeing something similar for terraria. So actually released games must have bad code as a requirement for release.

And we are working on improving thrive’s code, so…

(Louix) #4

Wow, that’s a lot of lines Haha

(Uncertain Agent) #5

Despite the fact that I have barely done any coding and/or programming (besides Paradox mods), it still looked like bad coding to me, which… probably means something about me.

(He who abuses the search function) #6

Oh wow… I did not realize that this was only a small part of the whole file…
That does look rather confusing, and the notes don’t really help (What the Belgium is a “sweat move”)

(The Third Duke of Silly) #7

The code mentioned something about a sweat sprite, so I can only guess it’s the sweat sprite sweating.


(i cant code) #8

hey dont diss my man noel fb

(i cant code) #9

i take it back

(Zyad Mohamed) #10

is the whole game written in one script? :joy:

(Santa Corn during not-christmas) #11

You know a script is gonna be good when the first 250+ lines are just variable declarations xD
Edit: also this SO thread is relevant.

(Sometimes I dream of cheese ᕕ(☯෴☯)ᕗ) #12

Well did a novice programmer make this first off. If so I think this is pretty good for that person not everyone has godlike programmer status. I feel like I’m going to get 50 people telling me I’m an idiot :confounded:
I’m deleting the double post I accidently made, sorry.


That code is from the game

Which has been hyped recently. So they managed to make a good game with terrible programming.

(Sometimes I dream of cheese ᕕ(☯෴☯)ᕗ) #15

Oh, well does the game run without lag at least. But I’m not a programmer… yet, maybe.

(Louix) #16

They got lucky !

(Sometimes I dream of cheese ᕕ(☯෴☯)ᕗ) #17

Until Next time, MWAHAHAHAHA!!!:smiling_imp: (couldn’t find a devil face, this will have to do)

(@_@) #18

if brain=off

ERROR 101: No brain found

(𝒦𝒾𝓃𝑔 𝑜𝒻 𝒯𝒽𝒾𝓃𝑔𝓈) #19


(you are the necromancer of posts so…)

(ፕቿክፕልርረቿ ረዐዪዕ) #20

just let the dead rest in peace you monster :sob:

(Δф - Delta Phi) #21

So, I went around to making a bot for my private discord server. The first function I made for it is a random user selector.
However, my method of retrieving users is laughable - a static reference table. The reasoning being, that the rate of new user gain is less than once a month, so I can just add new users to the table and keep it simple.
The RNG in JavaScript is really bad, though. I might have a small sample size, but it’s been tagging the same three or four people (out of eight) with alarming frequency, and two of us (including me) haven’t even been tagged yet.