Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

True, False, FileNotFound

Sign in to follow this  
Evil Steve


Sigh. From the SDK of a certain big-name console:

enum GraphicsBoolean

Graphics's version of bool-type values.


That makes me sad.

EDIT: Censored the library name
Sign in to follow this  


Recommended Comments

this is all too common. When the enum starts out its just a replacement for the lack of a boolean data type in C, and its used as a return code; true for success and false for error, but then what always seems to happen is that more error codes are needed; file not found, and so on. THe only real mistake is calling the enum Boolean rather than ErrorCode.

To avoid this, always call your true-for-ok/false-for-error enums something like ErrorType and use NO_ERROR or similar. Problem solved.

Share this comment

Link to comment
It's worse than that. It's the equivilent of YES, NO, TRUE, FALSE. So now you have to test for multiple values (did it return YES or TRUE?). And given that you most likely wrote or are using documentation that existed before GRAPHICS_DISABLE and GRAPHICS_ENABLE were added, you won't check for those. Not only that, but who checks for "other" in what is supposed to be a boolean test?

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!