Skip to content

Instantly share code, notes, and snippets.

Don't Chain Failure States in Returns
public void Process()
{
foreach (string line in file)
{
string[] columns = line.split(',');
foreach (string column in columns)
{
if (hasBadData(column))
{
LogErrorMessage();
return;
}
Print(column);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment