What is the benefits and drawbacks of using header files?
Posted
by vodkhang
on Stack Overflow
See other posts from Stack Overflow
or by vodkhang
Published on 2010-05-09T15:53:07Z
Indexed on
2010/05/09
15:58 UTC
Read the original article
Hit count: 213
language-agnostic
|header
I had some experience on programming languages like Java, C#, Scala as well as some lower level programming language like C, C++, Objective - C.
My observation is that low level languages separate out header files and implementation files while other higher level programming language never separate it out. They use some identifiers like public, private, protected to do the jobs of header files.
I saw one benefit of using header file (in some book like Code Complete), they talk about that using header files, people can never look at our implementation file and it helps with encapsulation.
A drawback is that it creates too many files for me. Sometimes, it looks like verbose.
It is just my thought and I don't know if there are any other benefits and drawbacks that people ever see and work with header file
This question may not relate directly to programming but I think that if I can understand better about programming to interface, design software.
© Stack Overflow or respective owner