3 ms·
One other thing I'd like to add is greppable comments! In the same vein as TODO and FIXME, I use hashtags in comments to drop hints to future me reading the cod
by vijucat 2y ago
One other thing I'd like to add is greppable comments! In the same vein as TODO and FIXME, I use hashtags in comments to drop hints to future me reading the code. #learning is a universal one:
// #learning: transparent color using color.new(color.white, 100). This is GREAT for hiding plot() lines during inapplicable periods (such as when no trade is on)
But project-specific hashtags are quite useful, too.
// #60within600: bunch API calls to not hit the 60 calls within 10 minutes limit
// This memoizes fn call results to prevent #60within600
The hashtagging was inspired long ago by del.icio.us, if you remember that. https://en.wikipedia.org/wiki/Delicious_(website) https://en.wikipedia.org/wiki/Delicious_(website)
- philipwhiuk 2y agoSeems like you're trying to implement a ticketing system in your code to me. If you need to prevent 60 within 600, write a test.
- vijucat 2y agoI'm documenting the (scattered) implementation changes related to the feature / bug-fix, in both code and test cases, using the hashtag. You could just use the JIRA ticket number, too, but it's a bit dry.