Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3488564
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:17:10+00:00 2026-05-18T11:17:10+00:00

This question was inspired by this answer . I’ve always been of the philosophy

  • 0

This question was inspired by this answer.

I’ve always been of the philosophy that the callee is never responsible when the caller does something stupid, like passing of invalid parameters. I have arrived at this conclusion for several reasons, but perhaps the most important one comes from this article:

Everything not defined is undefined.

If a function doesn’t say in it’s docs that it’s valid to pass nullptr, then you damn well better not be passing nullptr to that function. I don’t think it’s the responsibility of the callee to deal with such things.

However, I know there are going to be some who disagree with me. I’m curious whether or not I should be checking for these things, and why.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:17:11+00:00Added an answer on May 18, 2026 at 11:17 am

    While in general I don’t see the value in detecting NULL (why NULL and not some other invalid address?) for a public API I’d probably still do it simply because many C and C++ programmers expect such behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Inspired by the discussion in this question . We have all been taught that
This question inspired me to ask the following question. Does the DllImport attribute always
This question was inspired by this answer to another question, indicating that you can
This question is inspired from the accepted answer here . Why does the following
Inspired by the encoding scheme of the answer to this question , I implemented
This question was inspired by a previous question posted on SO, Does the order
This is directly inspired by this question . There are numerous references/statements that bitwise
G'day, Inspired by a comment I made in my answer to this question on
This is inspired by this question and the comments on one particular answer in
Inspired by this question and answer , how do I create a generic permutations

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.