View Single Post
  #19  
Old 05-05-2007, 03:38 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
They can be useful if you know how to use them well. Stuff like using enums for every month of the year. Gives them the appropriate monthly number. Can also be used for things like colours. It may be easier to use 'purple' rather than a 3 in code.

Another example could be parameters. Say a function takes an integer as a parameter to change the object. For instance, a baddy and it's mode. It may be easier for people to understand if they send 'attack' rather than a 3 as a parameter. In essence, the number 3 will still be sent as the parameter but the code will make more sense for the programmer.

Enums are a method of documentation. They have there uses. I think it's much more efficient to use enums to represent integer values rather than creating a TStaticVar() for them.

Last edited by Twinny; 05-05-2007 at 03:49 PM..
Reply With Quote