Click here to Skip to main content
15,888,233 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: returning std::pair Pin
Erudite_Eric7-Nov-11 21:30
Erudite_Eric7-Nov-11 21:30 
GeneralRe: returning std::pair Pin
User 5838527-Nov-11 22:05
User 5838527-Nov-11 22:05 
GeneralRe: returning std::pair Pin
Malli_S8-Nov-11 1:39
Malli_S8-Nov-11 1:39 
GeneralRe: returning std::pair Pin
Albert Holguin9-Nov-11 9:30
professionalAlbert Holguin9-Nov-11 9:30 
AnswerRe: returning std::pair Pin
jschell8-Nov-11 9:58
jschell8-Nov-11 9:58 
Questionif(NULL == MyPointer) Pin
User 5838527-Nov-11 15:37
User 5838527-Nov-11 15:37 
AnswerRe: if(NULL == MyPointer) Pin
Dr.Walt Fair, PE7-Nov-11 15:45
professionalDr.Walt Fair, PE7-Nov-11 15:45 
AnswerRe: if(NULL == MyPointer) Pin
Chuck O'Toole7-Nov-11 17:43
Chuck O'Toole7-Nov-11 17: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 18:08
professional«_Superman_»7-Nov-11 18:08 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:46
Stefan_Lang10-Nov-11 3:46 
AnswerRe: if(NULL == MyPointer) Pin
Malli_S8-Nov-11 1:05
Malli_S8-Nov-11 1:05 
AnswerRe: if(NULL == MyPointer) Pin
Eytukan8-Nov-11 7:36
Eytukan8-Nov-11 7:36 
GeneralRe: if(NULL == MyPointer) Pin
Chuck O'Toole8-Nov-11 8:39
Chuck O'Toole8-Nov-11 8:39 
GeneralRe: if(NULL == MyPointer) Pin
David Crow8-Nov-11 8:44
David Crow8-Nov-11 8:44 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:54
Stefan_Lang10-Nov-11 3:54 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 17:03
Eytukan10-Nov-11 17:03 
GeneralRe: if(NULL == MyPointer) Pin
User 5838528-Nov-11 11:12
User 5838528-Nov-11 11:12 
AnswerRe: if(NULL == MyPointer) Pin
Chuck O'Toole8-Nov-11 11:55
Chuck O'Toole8-Nov-11 11:55 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 17:05
Eytukan10-Nov-11 17:05 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:52
Stefan_Lang10-Nov-11 3:52 
AnswerRe: if(NULL == MyPointer) Pin
Dave Doknjas8-Nov-11 9:51
Dave Doknjas8-Nov-11 9:51 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:38
Stefan_Lang10-Nov-11 3:38 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 17:01
Eytukan10-Nov-11 17:01 
AnswerRe: if(NULL == MyPointer) Pin
jschell8-Nov-11 10:03
jschell8-Nov-11 10:03 
AnswerRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:25
Stefan_Lang10-Nov-11 3: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.