←back to thread

78 points p2detar | 1 comments | | HN request time: 0s | source
Show context
Jean-Papoulos ◴[] No.46204131[source]
>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(3): >>46204695 #>>46205042 #>>46205098 #
alextingle ◴[] No.46205042[source]
Separating interface from implementation of one of the core practices for making large code bases tractable.
replies(1): >>46205184 #
valleyer ◴[] No.46205184[source]
Of course, but that's doable without making programmers maintain headers, and some modern languages do that.
replies(2): >>46206695 #>>46216635 #
1. 1718627440 ◴[] No.46216635[source]
I don't understand that hate against header files. It is just a separate file with the interface. Of course you also need to change it, when you change the API, which you might find annoying, but maybe you should use that to consider that you are just changing an API?