Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> What did I miss?

Perhaps a tool to generate header files, so we don't have to write every function declaration twice?



I use makeheaders: 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


Interesting. Do you know if it works with C++14?


My educated guess: not a chance. It's probably not going to grok C++ member declaration syntax, templates, namespaces, and so on.


I don't use C++, so I have no idea.


As 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).


Such as? Take my money!


I design my programs by writing the header files first.


This approach makes me happy. Interface is key.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: