[PLUG] #include files.... in programming languages

Arun Khan knura at yahoo.com
Tue Jun 3 19:07:10 IST 2008


On Tuesday 03 Jun 2008, ഓം wrote:

> Why can't these .h files be called .i files, they are include files
> and what better suffix for include files that .i?
> Are we still following what some "stdio.h" wrote 15 or more years ago
> without bothering to why not change for better?

My C is quite rusty, the last piece of code I wrote was in 1994!

Nonetheless, from what I remember, .h is for header files.  It is a 
convention.

As the saying goes "don't fix it if it ain't broken".  Remember any 
small change requires regression testing, when the file is shared 
across several large scale projects, the cost is exponential;  unless 
you are volunteering to do regression testing for such orgs or don't 
believe in it.

> Any suggestion on this front?

You can call the files anything you want #include will simply pull them 
into your code e.g. a data initialization file foo.data (shared across 
many projects) and including it in your C code 

#include "foo.data"

-- 
Arun Khan





More information about the Plug-mail mailing list