A collection of programming protips
How to use this website
This website aims to save code reviewers from typing out the same explanations for common issues/patterns.
Instead, you may provide a link to a protip, which contains a "bad" example, a "good" example, and an explanation why the pattern is encouraged/discouraged.
If you'd like to add or edit protips, please visit our GitHub repo: magicmark/programming-protips-wiki
- /assert-type-conditions/ Use assertions for possibly null values
- /avoid-network-in-unit-tests/ Avoid making network requests in unit tests
- /custom-errors/ Use custom errors for error handling and control flow
- /dont-outsmart-typechecker/ Don't try and outsmart the typechecker
- /dont-pass-huge-objects/ Don't pass huge monolithic objects to helper functions
- /file-reading-race-condition/ Don't check if a file exists before reading it
- /give-reason-for-suppression/ Give a reason when using suppression statements
- /limit-logic-in-try-block/ Limit the amount of logic in a try/catch block
- /limit-what-you-catch/ Limit what errors you catch in a try/catch block
- /return-early/ Return early from a function when checking initial conditions
- /use-permalinks/ Link to code and docs with permalinks where possible