logoalt Hacker News

Jean-Papouloslast Tuesday at 12:20 PM3 repliesview on HN

>What this means is that you can explain all the intent of your code through the header file and the developer who uses your lib/code never has to look at the actual implementations of the code.

I hate this. If my intellisense isn't providing sufficient info (generated from doc comments), then I need to go look at the implementation. This just adds burden.

Headers are unequivocally a bad design choice, and this is why most of every language past the nineties got rid of them.


Replies

alextinglelast Tuesday at 2:05 PM

Separating interface from implementation of one of the core practices for making large code bases tractable.

show 1 reply
GhosT078last Tuesday at 1:26 PM

Look to Ada for “headers” (i.e. specs) done right.

show 1 reply
antonvslast Tuesday at 2:12 PM

C's text preprocessor headers were a pragmatic design choice in the 1970s. It's just that the language stuck around longer than it deserved to.

show 1 reply