Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualGlass_Knife

Posted 04 September 2013 - 09:55 AM

I think package names would really help to classify you code.  For example, take the TimerTextGenerator class.  I would expect different behaviors based on the package.  It's in the game.text package: deals with text.  It's in the game.art package: maybe it creates a ticking clock?  It's in the game.utility package: probably just a helper class.

 

As your stuff gets large, and you pass 100 files, it becomes easier to manage. 

 

Also, pay attention to the package scope for method names.  If you don't use public, protected, or private, then those methods can be seen only by classes in the same package.  This is great for hiding classes and methods from other sections of code.  If all the text classes that are only used by other text classes only have package scope, then when you use code completion in your IDE, but you're in the main game, all those classes will be hidden.  


#1Glass_Knife

Posted 04 September 2013 - 09:55 AM

I think package names would really help to classify you code.  For example, take the TimerTextGenerator class.  I would expect different behaviors base on the package.  It's in the game.text package: deals with text.  It's in the game.art package: maybe it creates a ticking clock?  It's in the game.utility package: probably just a helper class.

 

As your stuff gets large, and you pass 100 files, it becomes easier to manage. 

 

Also, pay attention to the package scope for method names.  If you don't use public, protected, or private, then those methods can be seen only by classes in the same package.  This is great for hiding classes and methods from other sections of code.  If all the text classes that are only used by other text classes only have package scope, then when you use code completion in your IDE, but you're in the main game, all those classes will be hidden.  


PARTNERS