A
Abubakar
Hi,
I'm working on a project in unmanaged c++. I was writing all (most of) my
code in header files, that is, no seperation of code in header and cpp
files, as usually is done in c++. I feel pretty comfortable doing this as it
my first time writing code in c++. My background is in C#. Now one senior
guy ( a non-developer ), came up and wanted to see my code, and he said what
I was doing is wrong. What I should do is declare all my code interface
stuff (function prototypes for classes) in header files, than create a cpp
file in which include the header file and provide definitions of those
delarations.
Although I have never worked on c++ projects before, but I have read a lot
of c++ code before and I know that what the senior non-dev guy is saying is
right. But whats wrong with writing all the code in header files (is it
called inlining?)? What difference does it make? Any performance problems? I
think "of course not". I just feel pretty ok dealing only with header files.
Plz advice.
Regards,
Abubakar.
I'm working on a project in unmanaged c++. I was writing all (most of) my
code in header files, that is, no seperation of code in header and cpp
files, as usually is done in c++. I feel pretty comfortable doing this as it
my first time writing code in c++. My background is in C#. Now one senior
guy ( a non-developer ), came up and wanted to see my code, and he said what
I was doing is wrong. What I should do is declare all my code interface
stuff (function prototypes for classes) in header files, than create a cpp
file in which include the header file and provide definitions of those
delarations.
Although I have never worked on c++ projects before, but I have read a lot
of c++ code before and I know that what the senior non-dev guy is saying is
right. But whats wrong with writing all the code in header files (is it
called inlining?)? What difference does it make? Any performance problems? I
think "of course not". I just feel pretty ok dealing only with header files.
Plz advice.
Regards,
Abubakar.