Skip to content

Comment on Zest: a programming language for malleable and legible systemsparent

Comments

Rust has this, and it just makes so much sense. Especially when you write a library in which the basic demo is also the basic unit test you want to make. Instead of writing a specific unit test that's hidden in source code, you just embed it in the docs and then you (a) don't have code duplication and (b) have verification your documentation's code samples are actually correct.

and (b) have verification your documentation's code samples are actually correct.

I find a lot of libraries don't go through the effort to actually use doctests, and just stick `no_run` everywhere, which defeats a lot of the purpose.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.