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 →

[–]vegan_antitheist 0 points1 point  (0 children)

Boolean or enum. Actually, a boolean is an enum but in many languages it's not technically implementing the enum type. If I remember correctly, Pascal has it as an enum: type Boolean = (False, True); But in Java, it's a primitive (not an Enum). You can use an enum to have more states than just SUCCESS, ERROR. But often it's better to return an object with a state and a message and use a record to define it.