Pages

Tuesday, May 31, 2011

Class and Function Name Stylings

While designing frameworks and systems, class and function names are important to identify what the code is doing, but these names are often purposeful and inherently dry.

I've  slowly been changing my naming style in favour of common fantasy terminology to help keep the mindset of a Creator of Worlds and Forger of Lore. Here are some examples:

  • "EntityFactory"->"EntityForge",  
  • "SpriteManager"->"SpriteOverseer", 
  • "Enemy.Initialize()"->"Enemy.GiveBreadth()"

This is certainly fun, but it's an extra step to find a suitable name and it's important to avoid names that would be overly confusing. For example "AnimationController" helps "give life" to your characters (by animating them), but "LifeGiver" would be fantastically vague name.

No comments:

Post a Comment