你经常会看到这样一些代码多余else分支: public void bla()
{
if (conditionTrue)
{
// long code here
} else {
// otherwise do nothing
return;
}
// some more code
}
else分支显然是下滑向
我经常看到和使用枚举附带的属性做一些基本的东西,如提供的显示名称或说明: public enum Movement {
[DisplayName("Turned Right")]
TurnedRight,
[DisplayName("Turned Left")]
[Description("Execute 90 degree turn to the left