Hacker News new | ask | show | jobs
by andolanra 4210 days ago
The important thing is to make sure that your 'upgrade' is semantically indistinguishable from the non-upgraded version, and to the extent that it differs, document it. There's an old blog post[^1] where someone describes code that performed this kind of "interface upgrade" in a way that broke underlying assumptions about the code. This is a horrible (and unexpected!) kind of bug. One should be really, really sure that this is the correct way of solving a problem before actually reaching for this tool.

[^1]: In particular, a function which took a Reader would attempt to cast that Reader to something with a Close method, which broke the programmer's assumptions about that function. It didn't help that said behavior was at the time undocumentated: http://how-bazaar.blogspot.co.nz/2013/07/stunned-by-go.html and the HN discussion https://news.ycombinator.com/item?id=6060351