Bad code examples

I wanted to share example of how not to write code:
https://github.com/NoelFB/Celeste/blob/master/Source/Player.cs

(and to get more posts on this forum)

4 Likes

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

2 Likes

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…

1 Like

Wow, that’s a lot of lines Haha

3 Likes

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.

3 Likes

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”)

5 Likes

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

sweat

4 Likes

hey dont diss my man noel fb

2 Likes

dumbCode
i take it back

2 Likes

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

4 Likes

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.

2 Likes

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.

2 Likes

That code is from the game

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

3 Likes

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

2 Likes

They got lucky !

2 Likes

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

2 Likes

{
if brain=off
then.execute(brain_activate)
}

ERROR 101: No brain found

YOU HAD TO REVIVE THIS THREAD

(you are the necromancer of posts so…)

1 Like

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

2 Likes

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.