2 ms·
Is it possible that there are other factors that could take even more time than writing a little boilerplate? Maybe dueling with the borrow checker?
by throwaway894345 6y ago
Is it possible that there are other factors that could take even more time than writing a little boilerplate? Maybe dueling with the borrow checker?
- viraptor 6y agoIt's a tradeoff. I'd rather duel with the borrow checker a little bit every day then have a long debugging session figuring out where's a missing copy causing values taken from a map to be not available - that is a fun multi-hour challenge sometimes.
- throwaway894345 6y agoThat’s perfectly reasonable if you’re writing lots of parallel code, but frankly 95% of web server code isn’t the sort of hairy parallel code that would benefit from a borrow checker on balance.
- viraptor 6y agoThere are no threads in this scenario. You can easily lose ownership / crash on bad references when using golang maps in a single thread.
- throwaway894345 6y agoHow do you get "bad references" in a Go map in a single thread? Are you thinking of nil pointers? That's a separate issue.