If you return enumerations to indicate errors and not to throw exceptions, you are, of course, in a state of sin.
Are callers really interested in the state of something? I usually found these things in C-style function libraries where there are no objects to represent state. It depends on what you are trying to do, but if you (say) create code to manage communication sockets, I highly recommend wrapping them in classes and letting client code determine their state through properties, and not as a result of the Open () method.
source
share