Better HN
topnewbestaskshowjobs
Log inSign up

caffeine2

3 karma · joined Sep 17, 2011 (15y ago) · 1 submissions

Submissions

comment 15y ago · link · parent

The comments in his code are reminiscent of programming by contract (an idea I believe Djikstra himself was fond of). In Go the types of the interfaces are statically checked, which is good (in Python or Ruby, this isn't the case), but the contract the interface represents has to remain in comments and unit tests.

It would be nice to be able to specify tests that every implementor of the Heap interface must pass?