Click here to Skip to main content
15,846,727 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: returning std::pair Pin
Erudite_Eric7-Nov-11 22:30
Erudite_Eric7-Nov-11 22:30 
GeneralRe: returning std::pair Pin
User 5838527-Nov-11 23:05
User 5838527-Nov-11 23:05 
GeneralRe: returning std::pair Pin
Malli_S8-Nov-11 2:39
Malli_S8-Nov-11 2:39 
GeneralRe: returning std::pair Pin
Albert Holguin9-Nov-11 10:30
professionalAlbert Holguin9-Nov-11 10:30 
AnswerRe: returning std::pair Pin
jschell8-Nov-11 10:58
jschell8-Nov-11 10:58 
Questionif(NULL == MyPointer) Pin
User 5838527-Nov-11 16:37
User 5838527-Nov-11 16:37 
AnswerRe: if(NULL == MyPointer) Pin
Dr.Walt Fair, PE7-Nov-11 16:45
professionalDr.Walt Fair, PE7-Nov-11 16:45 
AnswerRe: if(NULL == MyPointer) Pin
Chuck O'Toole7-Nov-11 18:43
Chuck O'Toole7-Nov-11 18:43 
Oh, I'm sure it saved somebody some debugging time. "saved" is a bit of a stretch unless somebody would have released something with insufficient testing. And if they do that, there'd be plenty of other bugs that will bite them due to the lack of testing.

Personally, I hate it too. I tend to read code like English, left to right, and reading it as "if my pointer is null" is more natural for me than the other way around. Speakers of other native languages may find the other order more natural.

In my opinion, if you are writing code that will be maintained by someone else, a support team or other engineers as you move on to bigger projects, then "readability" is more important. Readability include code structure / indents, comments (meaningful), reasonablly neumonic variable and function nammes, and making if statements readable as they convey the "branching logic" of the program.
AnswerRe: if(NULL == MyPointer) Pin
«_Superman_»7-Nov-11 19:08
professional«_Superman_»7-Nov-11 19:08 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 4:46
Stefan_Lang10-Nov-11 4:46 
AnswerRe: if(NULL == MyPointer) Pin
Malli_S8-Nov-11 2:05
Malli_S8-Nov-11 2:05 
AnswerRe: if(NULL == MyPointer) Pin
Eytukan8-Nov-11 8:36
Eytukan8-Nov-11 8:36 
GeneralRe: if(NULL == MyPointer) Pin
Chuck O'Toole8-Nov-11 9:39
Chuck O'Toole8-Nov-11 9:39 
GeneralRe: if(NULL == MyPointer) Pin
David Crow8-Nov-11 9:44
David Crow8-Nov-11 9:44 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 4:54
Stefan_Lang10-Nov-11 4:54 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 18:03
Eytukan10-Nov-11 18:03 
GeneralRe: if(NULL == MyPointer) Pin
User 5838528-Nov-11 12:12
User 5838528-Nov-11 12:12 
AnswerRe: if(NULL == MyPointer) Pin
Chuck O'Toole8-Nov-11 12:55
Chuck O'Toole8-Nov-11 12:55 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 18:05
Eytukan10-Nov-11 18:05 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 4:52
Stefan_Lang10-Nov-11 4:52 
AnswerRe: if(NULL == MyPointer) Pin
Dave Doknjas8-Nov-11 10:51
Dave Doknjas8-Nov-11 10:51 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 4:38
Stefan_Lang10-Nov-11 4:38 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 18:01
Eytukan10-Nov-11 18:01 
AnswerRe: if(NULL == MyPointer) Pin
jschell8-Nov-11 11:03
jschell8-Nov-11 11:03 
AnswerRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 4:25
Stefan_Lang10-Nov-11 4:25 

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.