r/C_Programming • u/Just_Government3790 • Sep 12 '26
Question What C function would you delete and rewrite first, and why?
For me it's fnmatch - mostly because it's 40 year's old and smell's funny.
93
Upvotes
View all comments
-3
u/jwzumwalt Sep 13 '26
I have not used header files since 1995. I have been programming in C for over 55 years. I avoid C headers files like the plague.
Every other programming language is able to operate just fine without them and in my opinion C should be no different. For large projects I do use a few include files if it contributes to clarity, but header files often make tracing a programs flow about as hard as trying to figure out what a object oriented program is doing. There is no reason that .h files (or at least whatever info they provide) can't be generated at compile time from the source itself.
In my opinion C headers where a product of experimentation. At the time C was written everything under the sun was being tried and experimented with. When you worked on a computer with 8K of memory it made sense to break things up into many files and directories. As I remember, Pascal was the next popular language and it (and all other languages) dropped headers. Headers are an experimental relic.