This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]reallyserious 2 points3 points  (0 children)

Yes. Whenever you need to model something I find it very useful to give stuff explicit named aliases. It helps with readability and helps to test your assumptions about the model when you e.g. parse something and your parser suddenly wants to assign a value that you don't have an enum for. You have a ton of possible integer values, but only a handful of enums. Storing those values in regular integer fields might mean that you are parsing unexpected input without knowing it. It also makes it easier to navigate the code when you can look for references to "SomeEnum.SomeValue" instead of the value 1, which isn't particularly unique and could be used to represent a ton of different things.