Hacker News new | ask | show | jobs
by rileymat2 750 days ago
I have very mixed thoughts about headers, there is something I kind of love about being able to document the public declarations in one slim text file; and put the definitions elsewhere. There are lots of ways to do that, but other languages don't seem to bother. There are automated solutions, to pull these out, but I rarely see, for example, a python file will often just be a series of functions with no way to tell.

But they have a ton of warts, and require duplicate maintenance.

2 comments

Python does enable this, actually. __init__.py can act as a "header" file that lets you define your porcelain interface separately from internal interfaces.
Typescript's .d.ts files are basically this