5 ms·
> What did I miss? Perhaps a tool to generate header files, so we don't have to write every function declaration twice?
by amelius 11y ago
> What did I miss?
Perhaps a tool to generate header files, so we don't have to write every function declaration twice?
- MichaelCrawford 11y agoI design my programs by writing the header files first.
- huu 11y agoThis approach makes me happy. Interface is key.
- nulltype 11y agoI use makeheaders: http://www.hwaci.com/sw/mkhdr/ http://www.hwaci.com/sw/mkhdr/ It's pretty amazing. If you can't use makeheaders, I prefer the Plan 9 include style where header files are not allowed to include header files: http://doc.cat-v.org/bell_labs/pikestyle http://doc.cat-v.org/bell_labs/pikestyle
- ndesaulniers 11y agoSuch as? Take my money!
- exDM69 11y agoAs annoying as it is, especially when updating function signatures, I kinda enjoy having separate header files. It clearly defines the public vs. private interface(s), it's a place to put your docstring comments in and a single file that can provide a quick glance to how a module works. Although it is much less practical in C++ than in plain C, when you have to put the whole class definitions (including private member functions) in a header. A good editor/tags system/ide should support jumping between definition and declaration quickly, this definitely makes it a bit less painful (e.g. vim + ctags + cscope work fine).