Skip to content

Instantly share code, notes, and snippets.

@danesparza
Created April 7, 2011 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danesparza/908231 to your computer and use it in GitHub Desktop.
Save danesparza/908231 to your computer and use it in GitHub Desktop.
Bad usage of status codes
// Example of poor design...
// Note the lack of any useful constraints on the 'status' member. You can type anything there!
// What happens if you're trying to pass this across a web service boundary to somebody consuming
// your service and you made a typo in one of your status responses. Tracking down this bug is hard.
// Pandas are very sad.
public class WsResponse
{
public string Status;
public string StatusDescription;
public WsResponse() {}
public WsResponse(string status, string statusDescription)
{
Status = status;
StatusDescription = statusDescription;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment