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
Explore this link on the map →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
- Stevey's Google Platforms Rant · GitHubgist.github.com
- https://danluu.comdanluu.com
- Best practices for Claude Code - Claude Code Docsanthropic.com
- Software Engineering at Googleabseil.io
- Google Testing Blog: Code Health: Reduce Nesting, Reduce Complexitytesting.googleblog.com
- llm-wiki · GitHubgist.github.com
- Introducing FrontierCode | Cognitioncognition.ai
- Google Testing Blog: Communicate Design Tradeoffs Visuallytesting.googleblog.com
- Google Testing Blog: Testing on the Toilet: Test Behaviors, Not Methodstesting.googleblog.com
- Google Testing Blogtesting.googleblog.com