programming.protips.wiki
https://programming.protips.wiki
/put-units-in-names
Copy link to this page
#error-handling
Put units in names
https://ruudvanasseldonk.com/2022/03/20/please-put-units-in-names
More Tips
assert-type-conditions:
Use assertions for possibly null values
avoid-network-in-unit-tests:
Avoid making network requests in unit tests
chain-errors:
Chain custom errors to preserve stack traces
custom-errors:
Use custom errors for error handling and control flow
dont-outsmart-linter:
Don't try and outsmart the linter
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
provide-typechecker-errors:
Copy and paste error messages from the typechecker when using suppression statements
put-units-in-names:
Put units in names
return-early:
Return early from a function when checking initial conditions
use-permalinks:
Link to code and docs with permalinks where possible
Edit
put-units-in-names.md
on GitHub.