Created
August 20, 2013 16:23
-
-
Save dadarek/6283752 to your computer and use it in GitHub Desktop.
Command-Query Violation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeClass{ | |
private int reason; | |
public bool Go(){ | |
int value = SomeBigCalculation(); | |
if( value > 5 ){ | |
this.reason = "Too Big"; | |
return true; | |
} | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeClass{ | |
private int reason; | |
public bool IsTooBig(){ | |
int value = SomeBigCalculation(); | |
return value > 5; | |
} | |
public void SetReason(){ | |
this.reason = "Too Big"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment