this post was submitted on 28 Mar 2024
608 points (98.1% liked)

Programmer Humor

31800 readers
298 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 14 points 4 months ago* (last edited 4 months ago) (6 children)

The real naming fail is calling the class "GameManager", still my number one pet peeve. With a class name as vague as that you would have to add tons of information into the variable name. (Also the class name begs for unorganized code. I mean name one function or variable that you could not justify putting into the "GameManager" class. After all if it's managing the game it could justifiably perform any process in the game and access any state in it.)

Once you put the first bool into a class with a name like AccessibilitySettings, calling it something like HighContrast is completely sufficient.

[–] [email protected] 4 points 4 months ago (1 children)

Unity actually gives any class with the name GameManager a special gear icon. You cant just forgo the cool gear icon!

(Its not too terrible from an organizational standpoint because most of the scripts are attached to game objects. MonoBehavior is a component of GameObject. For instance, you’d never have player movement in the GameManager class, you would put it in the component class attached to the player character GameObject.)

[–] [email protected] 2 points 4 months ago* (last edited 4 months ago)

you’d never have player movement in the GameManager class

You want to bet? (Source: I teach game programming on a college level.)

But yeah, your comment about the gear icon is sadly more true than people may realize. Game developers do questionable things. => Engine developers cater to people. => Students argue that if something is supported it can't be that bad. Sometimes it feels like fighting windmills.

load more comments (4 replies)