Skip to main content
remove meta-commentary
Source Link
E_net4
  • 30.7k
  • 13
  • 120
  • 155

This answer has been rewritten since the downvote.

I learned from and upvoted @FDS's answer here, because it is good and correct. But, here's a form I find easier to read and understand.

This answer has been rewritten since the downvote.

I learned from and upvoted @FDS's answer here, because it is good and correct. But, here's a form I find easier to read and understand.

I learned from and upvoted @FDS's answer here, because it is good and correct. But, here's a form I find easier to read and understand.

added 200 characters in body
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401
deleted 7 characters in body
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401

This answer has been rewritten since the downvote.

I learned from and upvoted @FDS's answer here, because it is good and correct. But, here's a form I find easier to read and understand.

// The way preferred by pedantic people who don't want to "be redundant" with // an "unnecessary" `== NULL` check: if (!some_ptr) { printf("ERROR: NULLnull ptr.\n"); return; } // Versus the more-readable and understandable way which I prefer to use // whenever my peers will approve it without a fight or long argument if (some_ptr == NULL) // in C // if (some_ptr == nullptr) // in C++ { printf("ERROR: NULLnull ptr.\n"); return; } // Note: I just want to get my code merged and move on with life, so if they // won't easily approve my preferred version above, I'll switch to the other, // more-pedantic version of code to try to get a quick approval so I can be // more productive. // There are few things more discouraging than being blocked over // silly "pedantry" when your code is correct, bug-free, well-written, and does // what it says it does. 

I learned from and upvoted @FDS's answer here, because it is good and correct. But, here's a form I find easier to read and understand.

// The way preferred by pedantic people who don't want to "be redundant" with // an "unnecessary" `== NULL` check: if (!some_ptr) { printf("ERROR: NULL ptr.\n"); return; } // Versus the more-readable and understandable way which I prefer to use // whenever my peers will approve it without a fight or long argument if (some_ptr == NULL) { printf("ERROR: NULL ptr.\n"); return; } // Note: I just want to get my code merged and move on with life, so if they // won't easily approve my preferred version above, I'll switch to the other, // more-pedantic version of code to try to get a quick approval so I can be // more productive. // There are few things more discouraging than being blocked over // silly "pedantry" when your code is correct, bug-free, well-written, and does // what it says it does. 

This answer has been rewritten since the downvote.

I learned from and upvoted @FDS's answer here, because it is good and correct. But, here's a form I find easier to read and understand.

// The way preferred by pedantic people who don't want to "be redundant" with // an "unnecessary" `== NULL` check: if (!some_ptr) { printf("ERROR: null ptr.\n"); return; } // Versus the more-readable and understandable way which I prefer to use // whenever my peers will approve it without a fight or long argument if (some_ptr == NULL) // in C // if (some_ptr == nullptr) // in C++ { printf("ERROR: null ptr.\n"); return; } // Note: I just want to get my code merged and move on with life, so if they // won't easily approve my preferred version above, I'll switch to the other, // more-pedantic version of code to try to get a quick approval so I can be // more productive. // There are few things more discouraging than being blocked over // silly "pedantry" when your code is correct, bug-free, well-written, and does // what it says it does. 
deleted 7 characters in body
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401
Loading
added 3470 characters in body
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401
Loading
added 3470 characters in body
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401
Loading
added 23 characters in body
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401
Loading
added 294 characters in body
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401
Loading
Source Link
Gabriel Staples
  • 57.2k
  • 35
  • 304
  • 401
Loading