r/badcode • • Jun 09 '20

c++ EA published their Command&Conquer Code on github. This is my favorite part so far.

Post image
1.6k Upvotes

36 comments sorted by

View all comments

119

u/[deleted] Jun 09 '20

I don’t fully agree this is bad code. This depends a lot on the context like:

  • is there a company rule that requires every assignment to be documented (in which case the rule itself is the “problem”, not the code)

  • the name magic number might be very meaningful to everyone working on this project or even the whole industry (I’m not a game dev so I don’t know but I’ve seen the term magic number in other software where people were aware of its meaning)

9

u/gu3st12 Jun 09 '20

0

u/[deleted] Jun 09 '20

[deleted]

22

u/survivalking4 Jun 09 '20

No, don’t you see? It’s on the badcode subreddit, so it clearly MUST be bad code!