
05-06-2007, 01:57 AM
|
|
Malorian
|
 |
Join Date: May 2004
Posts: 5,289
|
|
Quote:
Originally Posted by 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.
|
How about posting examples how it can be useful. |
__________________
Follow my work on social media post-Graal: Updated august 2025.
|
|
|
|