Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Which of these methods is more efficient? Pin
Prakash Nadar8-May-04 22:35
Prakash Nadar8-May-04 22:35 
AnswerRe: Which of these methods is more efficient? Pin
Paul Ranson9-May-04 1:15
Paul Ranson9-May-04 1:15 
AnswerRe: Which of these methods is more efficient? Pin
Ravi Bhavnani9-May-04 4:29
professionalRavi Bhavnani9-May-04 4:29 
AnswerRe: Which of these methods is more efficient? Pin
Joe Woodbury9-May-04 7:59
professionalJoe Woodbury9-May-04 7:59 
GeneralRe: Which of these methods is more efficient? Pin
Tim Smith9-May-04 9:23
Tim Smith9-May-04 9:23 
GeneralRe: Which of these methods is more efficient? Pin
Joe Woodbury9-May-04 9:42
professionalJoe Woodbury9-May-04 9:42 
GeneralRe: Which of these methods is more efficient? Pin
Tim Smith9-May-04 13:47
Tim Smith9-May-04 13:47 
AnswerRe: Which of these methods is more efficient? Pin
Tim Smith9-May-04 9:27
Tim Smith9-May-04 9:27 
In general, you should use the second version.

When you have full knowledge of how GetValue is implemented, you can decide which is better. However, that makes caller dependent on the implementation of GetValue. If you ever need to change the implementation, any performance decisions might come back to haunt you. You really shouldn't be depending on GetValue being implemented as it is. Thus that makes the second version the better option.

You should always try to keep relationships between two classes limited to interface only and never the actual implementation. You can't always do this, but when you can, it is best that you do.

Tim Smith

I'm going to patent thought. I have yet to see any prior art.
GeneralUsing MFC Source Code Question Pin
nm_1148-May-04 8:26
nm_1148-May-04 8:26 
GeneralRe: Using MFC Source Code Question Pin
Joe Woodbury8-May-04 8:41
professionalJoe Woodbury8-May-04 8:41 
GeneralRPC: Problem in sending data Pin
ahsan_a8-May-04 8:17
ahsan_a8-May-04 8:17 
GeneralRe: RPC: Problem in sending data Pin
ahsan_a8-May-04 12:03
ahsan_a8-May-04 12:03 
GeneralRe: RPC: Problem in sending data Pin
Gary R. Wheeler8-May-04 13:42
Gary R. Wheeler8-May-04 13:42 
QuestionAccess WindowProc in MFC? Pin
Anonymous8-May-04 7:04
Anonymous8-May-04 7:04 
GeneralVoid Pin
soul.ripper8-May-04 7:03
soul.ripper8-May-04 7:03 
GeneralRe: Void Pin
Ryan McDermott8-May-04 7:08
Ryan McDermott8-May-04 7:08 
GeneralRe: Void Pin
soul.ripper8-May-04 8:17
soul.ripper8-May-04 8:17 
GeneralRe: Void Pin
toxcct9-May-04 10:27
toxcct9-May-04 10:27 
GeneralRe: Void Pin
sps-itsec468-May-04 22:34
sps-itsec468-May-04 22:34 
GeneralRe: Void Pin
soul.ripper9-May-04 7:09
soul.ripper9-May-04 7:09 
GeneralRe: Void Pin
Anonymous9-May-04 9:30
Anonymous9-May-04 9:30 
GeneralRe: Void Pin
toxcct9-May-04 10:26
toxcct9-May-04 10:26 
GeneralRe: Void Pin
soul.ripper9-May-04 12:54
soul.ripper9-May-04 12:54 
GeneralRe: Void Pin
toxcct9-May-04 20:56
toxcct9-May-04 20:56 
GeneralAssembley question Pin
Andrew Peace8-May-04 6:34
Andrew Peace8-May-04 6:34 

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.