Click here to Skip to main content
15,918,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaldebug vs release Pin
Marissa18223-Sep-03 20:51
Marissa18223-Sep-03 20:51 
GeneralRe: debug vs release Pin
Abebe23-Sep-03 21:10
Abebe23-Sep-03 21:10 
GeneralRe: debug vs release Pin
Marissa18223-Sep-03 21:14
Marissa18223-Sep-03 21:14 
GeneralRe: debug vs release Pin
Abebe23-Sep-03 21:18
Abebe23-Sep-03 21:18 
GeneralRe: debug vs release Pin
Marissa18223-Sep-03 21:23
Marissa18223-Sep-03 21:23 
GeneralRe: debug vs release Pin
Michael P Butler23-Sep-03 22:00
Michael P Butler23-Sep-03 22:00 
GeneralRe: debug vs release Pin
Marissa18223-Sep-03 22:08
Marissa18223-Sep-03 22:08 
GeneralRe: debug vs release Pin
1.5kg23-Sep-03 22:02
1.5kg23-Sep-03 22:02 
GeneralRemove help button on CPropertySheet Pin
murali_utr23-Sep-03 20:27
murali_utr23-Sep-03 20:27 
GeneralTry this! Pin
Manikandan23-Sep-03 20:59
Manikandan23-Sep-03 20:59 
GeneralCProeperty Page OnOk() Pin
murali_utr23-Sep-03 23:18
murali_utr23-Sep-03 23:18 
Generalor Try this! Pin
Manikandan23-Sep-03 21:02
Manikandan23-Sep-03 21:02 
GeneralRe: or Try this! Pin
murali_utr23-Sep-03 22:20
murali_utr23-Sep-03 22:20 
GeneralRe: Remove help button on CPropertySheet Pin
Member 42425923-Sep-03 21:31
Member 42425923-Sep-03 21:31 
GeneralRe: Remove help button on CPropertySheet Pin
murali_utr23-Sep-03 22:19
murali_utr23-Sep-03 22:19 
GeneralDLL Registeration Issue Pin
fadee23-Sep-03 19:20
fadee23-Sep-03 19:20 
GeneralRe: DLL Registeration Issue Pin
geo_m23-Sep-03 21:09
geo_m23-Sep-03 21:09 
GeneralRe: DLL Registeration Issue Pin
fadee23-Sep-03 21:48
fadee23-Sep-03 21:48 
GeneralRe: DLL Registeration Issue Pin
1.5kg23-Sep-03 22:28
1.5kg23-Sep-03 22:28 
GeneralRe: DLL Registeration Issue Pin
fadee23-Sep-03 23:36
fadee23-Sep-03 23:36 
GeneralNeed help for STL Pin
zma6423-Sep-03 18:43
zma6423-Sep-03 18:43 
GeneralRe: Need help for STL Pin
Joaquín M López Muñoz23-Sep-03 20:14
Joaquín M López Muñoz23-Sep-03 20:14 
GeneralThanks Pin
Anonymous24-Sep-03 3:30
Anonymous24-Sep-03 3:30 
QuestionDo you write "precondition" and "postcondition" in your comment? Pin
Link260023-Sep-03 18:27
Link260023-Sep-03 18:27 
AnswerRe: Do you write "precondition" and "postcondition" in your comment? Pin
Michael Dunn23-Sep-03 18:46
sitebuilderMichael Dunn23-Sep-03 18:46 
Preconditions are very useful, however separating the assertion from the comment explaining the test is a bad idea IMO. Put the comment right above the assertion, so that when the assert fails and the debugger drops you at that line, the comment is right there explaining it.

Also, "n > 0" is a useless comment. No duh. That comment does nothing to explain why n is being tested. Something more useful would be:
void guess_game ( int nChosenNumber )
{
  // Validate parameters
  // Valid guesses are always >= 1.  The input routine 
  // should never pass this function an invalid guess.
  assert(nChosenNumber >= 1);
 
  // ...
}
As for postconditions, I've never used them. Assertions placed after key blocks of code, as a sanity check that the result isn't something out of the expected range, is more useful, again IMHO. Such a sanity check placed at the end of a function could be seen as a postcondition, I guess.

--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released

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.