Click here to Skip to main content
15,887,398 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
Richard MacCutchan5-Mar-23 5:51
mveRichard MacCutchan5-Mar-23 5:51 
JokeRe: Why do so many "developers" not understand 'null'? Pin
Daniel Pfeffer5-Mar-23 5:57
professionalDaniel Pfeffer5-Mar-23 5:57 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
0x01AA5-Mar-23 6:19
mve0x01AA5-Mar-23 6:19 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
megaadam5-Mar-23 6:55
professionalmegaadam5-Mar-23 6:55 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
Slacker0075-Mar-23 8:56
professionalSlacker0075-Mar-23 8:56 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
lmoelleb5-Mar-23 9:18
lmoelleb5-Mar-23 9:18 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
Mycroft Holmes5-Mar-23 10:07
professionalMycroft Holmes5-Mar-23 10:07 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
jmaida5-Mar-23 17:41
jmaida5-Mar-23 17:41 
trønderen has also said it well.

Even the C language has confusion on this topic.
Yes, I too believe that they have distinct meanings.

Remember my posing the question of why is this a valid statement in C

zero = 0;
value = malloc( zero );
value is not null nor zero.

Why would I want to allocate zero memory?

Here is what ChatAI says

In the C programming language, calling malloc(0) is allowed and returns a pointer to a memory block of size 0. This is specified in the C standard, which states that malloc(0) is equivalent to malloc(1).

The reason for this behavior is that malloc is intended to allocate memory dynamically, and a request for 0 bytes of memory is considered a valid request. Allocating a block of memory with a size of 0 can be useful in certain situations, such as when you want to create a zero-length array or when you want to allocate memory that you will later reallocate to a different size using realloc.

However, it is important to note that malloc does not guarantee that it will return a pointer to a block of memory that is truly 0 bytes in size. The implementation of malloc may choose to return a block of memory that is larger than the requested size, in which case the additional memory will not be accessible to your program.

Clear as mud.
"A little time, a little trouble, your better day"
Badfinger

GeneralRe: Why do so many "developers" not understand 'null'? Pin
haughtonomous6-Mar-23 12:53
haughtonomous6-Mar-23 12:53 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
trønderen6-Mar-23 13:46
trønderen6-Mar-23 13:46 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
jmaida6-Mar-23 16:17
jmaida6-Mar-23 16:17 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
jmaida5-Mar-23 17:46
jmaida5-Mar-23 17:46 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
Sander Rossel5-Mar-23 20:25
professionalSander Rossel5-Mar-23 20:25 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
CPallini5-Mar-23 20:30
mveCPallini5-Mar-23 20:30 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
den2k885-Mar-23 20:44
professionalden2k885-Mar-23 20:44 
RantRe: Why do so many "developers" not understand 'null'? Pin
Martijn Smitshoek5-Mar-23 20:50
Martijn Smitshoek5-Mar-23 20:50 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
giulicard5-Mar-23 22:38
giulicard5-Mar-23 22:38 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
Richard MacCutchan5-Mar-23 23:28
mveRichard MacCutchan5-Mar-23 23:28 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
MikeCO106-Mar-23 1:53
MikeCO106-Mar-23 1:53 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
englebart6-Mar-23 2:35
professionalenglebart6-Mar-23 2:35 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
Cpichols6-Mar-23 3:14
Cpichols6-Mar-23 3:14 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
agolddog6-Mar-23 3:19
agolddog6-Mar-23 3:19 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
BillWoodruff6-Mar-23 3:25
professionalBillWoodruff6-Mar-23 3:25 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
englebart6-Mar-23 15:01
professionalenglebart6-Mar-23 15:01 
GeneralRe: Why do so many "developers" not understand 'null'? Pin
Bruce Patin6-Mar-23 4:42
Bruce Patin6-Mar-23 4:42 

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.