Google Testing Blog: Code Health
Testing Blog Code Health: Reduce Nesting, Reduce Complexity Monday, June 05, 2017 This is another post in our Code Health series. A version of this post originally appeared in Google bathrooms worldwide as a Google Testing on the Toilet episode. You can download a printer-friendly version to display in your office. By Elliott Karpilovsky Deeply nested code hurts readability and is error-prone. Try spotting the bug in the two versions of this code: Code with too much nesting Code with less nesting response = server.Call(request) if response.GetStatus() == RPC.OK: if response.GetAuthorizedUser(): if response.GetEnc() == 'utf-8': if response.GetRows(): vals = [ParseRow(r) for r in response.GetRows()] avg = sum(vals) / len(vals) return avg, vals else: raise EmptyError() else: raise AuthError('unauthorized') else: raise ValueError('wrong encoding') else: raise RpcError(response.GetStatus()) respon
Google Testing Blog: Code Health Testing Blog Code Health: Reduce Nesting, Reduce Complexity Monday, June 05, 2017  5 comments Google Labels: Code Health , Elliott Karpilovsky , TotT Code Health: Google's Internal Code Quality Efforts Monday, April 03, 2017  3 comments Google Labels: Code Health , Max Kanat-Alexander    Labels  TotT 112 GTAC 61 James Whittaker 42 Misko Hevery 32 Code Health 31 Anthony Vallone 27 Patrick Copeland 23 Jobs 18 Andrew Trenk 13 C++ 11 Patrik Höglund 8 JavaScript 7 Allen Hutchison 6 George Pirocanac 6 Zhanyong Wan 6 Har
saved by
related reading
- Google Testing Blog: Less Is More: Principles for Simple Commentstesting.googleblog.com
- Google Testing Blog: Code Health: Too Many Comments on Your Code Reviews?testing.googleblog.com
- Agentationagentation.dev
- https://danluu.comdanluu.com
- Agentationagentation.com
- UI Skills for Design Engineers | UI Skillsui-skills.com
- GitHub · Change is constant. GitHub keeps you ahead.github.com
- Google Testing Blog: Code Health: Reduce Nesting, Reduce Complexitytesting.googleblog.com
- Software Engineering at Googleabseil.io
- React Doctorreact.doctor
- Best practices for Claude Code - Claude Code Docsanthropic.com
- Cyclomatic complexityen.wikipedia.org