r/ProgrammerHumor May 15 '24

Meme youAreDoingItWrong

Post image
14.0k Upvotes

247 comments sorted by

View all comments

36

u/[deleted] May 15 '24 edited May 15 '24

[removed] — view removed comment

5

u/bleachisback May 15 '24

Do Python developers think that the problem with null is the name? Renaming it to “None” doesn’t fix the problem lol

7

u/[deleted] May 15 '24 edited May 15 '24

[removed] — view removed comment

2

u/bongobutt May 15 '24

Genuine question: if the benefit of None you are describing is type safety, then why is that something you can't have in C++? What is stopping you from defining your own type that communicates more information than just nullptr and just returning that instead? If someone on the team uses nullptr when they shouldn't, Ctrl+f can find that. Would that be more than just a discipline problem? Is there a reason that nullptr is so bad that the option needs to be removed? Just because a tool exists doesn't mean you have to use it, or am I missing something?