Click here to Skip to main content
16,007,843 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [OT(sort of)] Beginning a Project Pin
cnleek410-Jun-03 8:45
cnleek410-Jun-03 8:45 
GeneralRe: [OT(sort of)] Beginning a Project Pin
basementman10-Jun-03 10:11
basementman10-Jun-03 10:11 
GeneralRe: [OT(sort of)] Beginning a Project Pin
Maximilien10-Jun-03 10:06
Maximilien10-Jun-03 10:06 
GeneralAdd push buttons to the CListCtrl Pin
Harendra10-Jun-03 7:42
Harendra10-Jun-03 7:42 
Generalcalling functions in another class Pin
johnstonsk10-Jun-03 7:34
johnstonsk10-Jun-03 7:34 
GeneralRe: calling functions in another class Pin
Dean Goodman10-Jun-03 8:23
Dean Goodman10-Jun-03 8:23 
GeneralRe: calling functions in another class Pin
johnstonsk10-Jun-03 9:57
johnstonsk10-Jun-03 9:57 
GeneralRe: calling functions in another class Pin
Dean Goodman10-Jun-03 12:08
Dean Goodman10-Jun-03 12:08 
It removes clutter for one. Your header should be as clean as possible. Think of it as a reference for the functions that are contained in the class. If you can't remember how to call a function, you open up the header and find the prototype -- all that extra code in the file makes that task more difficult.

The other (more important) reason for separating the two is known as "separating interface from implementation". Say you write a class and someone else wants to use it later on. They don't need to know how your class works -- only that it does the job you say it will. It keeps things simple for everyone -- it's basically another layer of abstraction.

Plus, if you don't want anyone to see your source code for whatever reason, you can give them the header file and a compiled library to link against and they won't be able to tell how you did what you did with your class (at least not without a bit of extra work.) Then if you change your implementation later on (say for instance you find a faster algorithm for one of your functions) all you have to do is compile a new version of your code library and give it to your users. Then rather than having to recompile their whole program, your users only need to relink their application to your new library rather than recompiling their whole program.

Hope that all makes sense.

--Dean
GeneralRe: calling functions in another class Pin
johnstonsk10-Jun-03 17:19
johnstonsk10-Jun-03 17:19 
GeneralWindows Message Pin
Nick Parker10-Jun-03 6:43
protectorNick Parker10-Jun-03 6:43 
GeneralRe: Windows Message Pin
Miszou10-Jun-03 7:33
Miszou10-Jun-03 7:33 
GeneralRe: Windows Message Pin
Nick Parker10-Jun-03 7:44
protectorNick Parker10-Jun-03 7:44 
GeneralRe: Windows Message Pin
basementman10-Jun-03 8:33
basementman10-Jun-03 8:33 
GeneralCView And CSpliterWnd Pin
MinhHai10-Jun-03 5:44
MinhHai10-Jun-03 5:44 
GeneralRe: CView And CSpliterWnd Pin
valikac10-Jun-03 6:45
valikac10-Jun-03 6:45 
GeneralShipping .h files for .DLL classes Pin
Theopulus10-Jun-03 5:16
Theopulus10-Jun-03 5:16 
GeneralRe: Shipping .h files for .DLL classes Pin
Nemanja Trifunovic10-Jun-03 6:07
Nemanja Trifunovic10-Jun-03 6:07 
GeneralRe: Shipping .h files for .DLL classes Pin
Peter Weyzen10-Jun-03 20:21
Peter Weyzen10-Jun-03 20:21 
GeneralMix casing a name field Pin
Bryster10-Jun-03 4:13
Bryster10-Jun-03 4:13 
GeneralRe: Layered window problem Pin
Bedas10-Jun-03 4:11
Bedas10-Jun-03 4:11 
GeneralRe: Layered window problem Pin
Ryan Binns10-Jun-03 4:26
Ryan Binns10-Jun-03 4:26 
Questionhow to size an app to fit a PC's display size Pin
johnstonsk10-Jun-03 4:06
johnstonsk10-Jun-03 4:06 
AnswerRe: how to size an app to fit a PC's display size Pin
Florin Ochiana10-Jun-03 4:17
Florin Ochiana10-Jun-03 4:17 
GeneralRe: how to size an app to fit a PC's display size Pin
Ryan Binns10-Jun-03 4:37
Ryan Binns10-Jun-03 4:37 
AnswerRe: how to size an app to fit a PC's display size Pin
Ryan Binns10-Jun-03 4:35
Ryan Binns10-Jun-03 4:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.