MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/gzhnbb/ea_published_their_commandconquer_code_on_github/ftgdfp8/?context=3
r/badcode • u/Achereto • Jun 09 '20
36 comments sorted by
View all comments
36
You can find that piece of code here: https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/REDALERT/CONNECT.CPP#L98
Why is it bad?
The comment adds nothing to your code that isn't already explained by the code.
The name "magic number" is a very bad choice since it's not explanatory.
lots of visual noise around the code.
16 u/microwavedHamster Jun 09 '20 Serious question. Have you ever worked as a software engineer in the video game industry? 4 u/Achereto Jun 09 '20 No. I am a Software Engineer for ~5 years now, but I haven't worked in the game industry yet.
16
Serious question. Have you ever worked as a software engineer in the video game industry?
4 u/Achereto Jun 09 '20 No. I am a Software Engineer for ~5 years now, but I haven't worked in the game industry yet.
4
No. I am a Software Engineer for ~5 years now, but I haven't worked in the game industry yet.
36
u/Achereto Jun 09 '20
You can find that piece of code here: https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/REDALERT/CONNECT.CPP#L98
Why is it bad?
The comment adds nothing to your code that isn't already explained by the code.
The name "magic number" is a very bad choice since it's not explanatory.
lots of visual noise around the code.