Early returns vs nested positive if statements
问题 Here is some hypothetical code sample: if (e.KeyCode == Keys.Enter) { if (this.CurrentElement == null) { return false;} if (this.CurrentElement == this.MasterElement) { return false;} if (!Validator.Exist (this.CurrentElement)) { return false;} if (!Identifier.IsPictureElement (this.CurrentElement)) { return false;} this.FlattenObjects(this.CurrentElement); } VS if (e.KeyCode == Keys.Enter) { if (this.CurrentElement != null) { if (this.CurrentElement != this.MasterElement) { if (Validator