logoalt Hacker News

SatvikBeritoday at 10:40 AM1 replyview on HN

REPLs/notebooks are really nice in situations where you don't know what you want ahead of time and are throwing away 90% of the code you write, such as trying to find better numerical algorithms to accomplish some goal, exploring poorly documented APIs (most of them), making a lot of plots for investigating, or working a bunch with matrices and Dataframes (where current static typing systems don't really offer much.)


Replies

VorpalWaytoday at 10:50 AM

Yeah, this is a entirely different domain than what I work in (hard real-time embedded and hard real-time Linux).

Though poorly documented APIs exist everywhere, but they are not something you can rely on anyway: if it isn't documented the behaviour can change without it being a breaking change. It would be irresponsible to (intentionally) depend on undocumented behaviour. Rather you should seek to get whatever it is documented. Otherwise there is a big risk that your code will break some years down the line when someone tries to upgrade a dependency. Most software I deal with is long-lived. There is code I wrote 15 years ago that is still in production and where the code base is still evolving, and I see no reason why that wouldn't be true in another 15 years as well.

At least you should write tests to cover any dependencies on undocumented behaviour. (You do have comprehensive tests right?)

show 1 reply