Semicolon & Sons
X
About
Contact & Support
Code Diary
Episodes
Blog
Subscribe
Sign in
Semicolon & Sons
About
Screencasts
Code Diary
Blog
Contact & Support
Subscribe
Sign In
Algorithms Code Diary Entries
This is part of the Semicolon&Sons
Code Diary
- consisting of lessons learned on the job.
Always check upper and lower bounds
Always considering rounding direction
Avoid dependency on starting time
Check for false meaning failure in your functions
Consider kernel call counts for performance
Double input size to test performance
Exact matching against state lifecycle attributes can be a smell
Explicitly check for presence instead of making guesses at fickle falsity rules
How to ensure something only happens once when provisioning
How to sort by string length
Lock and release as tightly around contented entity as possible
Make sure you are hashing strings and not full objects
Only round at the last possible moment
Remember zero padding when producing numerical codes like bar codes
Sorting gotchas
Sorting on time alone might be insufficient to guarantee a repeatable ordering
There are four combinations of a and b
Use deque for tracking last n whatever
Whenever using next in a map loop you likely need to remove the nils