3 ms·
Replace Nested Conditional With Guard Clauses
- 65b 14y agoIs the example fail-safe? Also wouldn't this result in the same machine code in either case (i.e. the code's simply being written in a more condensed fashion?)
- ramblerman 14y ago"Also wouldn't this result in the same machine code in either case" Well yes. But Martin Fowler's recommendation in this case has nothing to do with the machine code optimization and everything with the readability of the actual code.