5 ms·
Very nice collection. My favorite C feature is actually a gcc/clang feature : the __INCLUDE_LEVEL__ predefined macro. It made me code&maintain my C projects exa
by milgra 4y ago
Very nice collection. My favorite C feature is actually a gcc/clang feature : the __INCLUDE_LEVEL__ predefined macro. It made me code&maintain my C projects exactly twice as fast as before because file count dropped to half : https://github.com/milgra/headerlessc https://github.com/milgra/headerlessc .
- 3836293648 4y agoHow do you handle third party headers?
- milgra 4y agoI just include them, everything works as before. If I have to create a library then I create a separate header file for the api functions and only the internals are headerless.
- gavinray 4y agoThis is great!
- enriquto 4y agoI love this. Somehow it feels more elegant than "header-only" libraries.
- xigoi 4y agoHow does this help? It just moves the content of the .h file to the .c file, but you still need to Write Everything Twice.
- milgra 4y agoIt reduces file count in the project browser, renaming/refactoring is much simpler in one file, it just feels like working with a newer language.
- account42 4y agoIs having two files really that much of a bother? I have my editor set switch between the .c(pp) and the .h with a keyboard shortcut and that seems easier than scrolling between declaration and definition when you want to change something.