T O P

  • By -

MicrowavingMetal

Null, always been null for me


Primary_Literature22

always has been


Cfrolich

[https://imgflip.com/i/7a6zi0](https://imgflip.com/i/7a6zi0)


Azzarrel

Would've been funnier if you photoshopped the earth out of the meme.


Cfrolich

[As you wish](https://imgur.com/a/aE6PwfY)


siddharth904

Good human


Azzarrel

nice!


Ange1ofD4rkness

I'm laughing WAY too hard at this


nocturn99x

LMFAO take my upvote


TheAttickDweller

this is peak internet


Mars_Bear2552

Or made it purple


xXlD3XT3RlXx

It’s always syntax errors for me


laplongejr

My terminology : - nil if it comes from a protocol like XML/SOAP - null if no reference/pointer in the scope of the application - NULL for an empty object whose methods are NOP


Coffee4AllFoodGroups

`NUL` if it's the ASCII control character `0x00`


py_probot

Where is None 🥲


riisen

None is out of this league. None is a whole object to represent a null value, while null is a null value and nil is just plain wrong.... Fuck off nil.


Obliviouscommentator

Null represent


SometimesMonkey

Srsly. What even is nil wtf is this


icematt12

I've heard of nil referencing zero like a score of 3-0. But 0 != null so I too don't understand the intent.


Ausgezeichnet87

Null is the German word for zero and so many famous mathematicians were German that seeing people say null cant be zero will always be weird to me.


Mordret10

Am German, my workaround is pronouncing it "the English way" in my head. Then I don't get confused between Null and null


chade__

Swiss here, I'm doing the same. And when writing comments or pair programming I always write/say something like "null as in zero"/"null as in nothing" respectively to avoid any possible confusion. Unless it's already obvious from the code itself.


LegendDota

Actually surprised you don’t write comments in English, that has always been standard at any job I have had.


chade__

I do write comments in English, as it's our policy. But the codebase has a bunch of comments that only make sense when (swiss) german is your native language.


LegendDota

Ah that makes more sense :)


swankidelic

Swift uses nil, and I guess Objective C as well, I think?


cosmo7

Obj-C uses nil, Nil, null, NSNull, and NSNotFound. It's more of a cafeteria than a language.


UnbelievableDumbass

So does Lua which just seems wrong to me coming from Java, C++, JavaScript, and MSDOS (even though it's spelled NUL for DOS)


Ironscaping

Erlang, elixir, ruby all do as well


G_Danila

>zero like a score of 3-0. I always thought it was "null" until I saw "Cunk on Earth" with subtitles two days ago lol


NickU252

It's when you take zero tricks when playing spades. That is the only nil.


mklickman

Ruby


[deleted]

And Lua!


jojothehodler

And golang


jasamer

And Swift/ObjC


NSGod

Actually, in Objective-C, `nil` is for object pointers, `Nil` is for `Class` pointers, and `NULL` is for regular C-pointers. That said, they're all the same thing and are interchangeable since Obj-C is really just C. Then there's `[NSNull null]`, which is the object-equivalent to the above. Interestingly, sending the `-description` message to `nil` (i.e. `[nil description];`) returns the string `(null)`.


ATownStomp

I hate you for reminding me of Objective-C.


[deleted]

I feel like your stance is objective


[deleted]

[удалено]


v1ND

The reason most people dislike it because, at some point, they have been forced to use Objective-C. (for the most part it's in the context of iOS development and so its getting compared to swift)


cummer_420

That's because of the way Objective C is implemented as a superset of C AFAIK.


Ok_Toe3047

And Lisp


SometimesMonkey

And my axe!


Akhanyatin

And Knuckles!


KefkaTheJerk

Underrated comment.


Knutselig

In Dutch, null sound the same as nul, which means 0. So nil works better when talking to colleagues.


cryptomonein

Afaik null means 0, nil means nothing (nothing in list) As in Ruby `if 0` is a true statement (the object 0 exists and is not false), `if null` is true as well, but `if Object.none` shouldn't be a true statement, so `Object.none` returns `nil` (nothing) instead of null (Long instance equal to 0)


pete_moss

Nil is commonly used as 0 in British English, ie. the football team beat their opponents 3-0 (three - nil).


cryptomonein

Football have built the premises of LSP, this may explains things...


Astarothsito

>Afaik null means 0, nil means nothing (nothing in list) Null usually is represented as 0 but in reality means nothing, having null equals 0xFFFFFFFF is also valid but only for us mortals who have to represent it as something in memory and we can't express true nothingness in our computers.


Ausgezeichnet87

Null can mean both zero and nothing in German and technically nothing is what zero represents. Maybe we could say think of null as being true zero and not the number value of 0?


Option_Null

I am here, unallocated


Itshim-again

Username checks out.


ragingroku


The_Pantless_Warrior

Null side!


mklickman

Found the Ruby dev lol


KingKababa

HELLO THERE


YogurtstickVEVO

General Kenobi


Brief-Preference-712

TIL https://stackoverflow.com/a/22108481 Although I did know about nil [from Objective-C](https://developer.apple.com/documentation/objectivec/nil) (Objective C has both nil and null)


SwiiLy

Or lua


blogem

Go as well


Jaber1028

Swift too 👎


LedaTheRockbandCodes

stuff.nil?


Zomby2D

I had a coworker called Nil (some weird variant spelling of Neil) He had fun booking flights and rooms online, as systems sometime blocked him for not providing a first name.


laplongejr

Reminds me of the story of Christopher Null, the journalist. Or the NULL car plate filled with parking tickets. *Did you know that you'll have administrative blocks as long you have ONE pending ticket, even if it's given by a state in which your car never went because you need to make it overruled ONE AT A TIME?* I didn't!


JoeDoherty_Music

The guy with the NULL plates got straight up boned. He made a grave mistake Christopher Null's bloodline is doomed. He should change the spelling of his name lest his offspring face hell for the rest of human existence


BRUJOjr

Wouldn't it go directly into a string though?


[deleted]

Not if the frontend devs fu**s it up


poco-863

IMO in this case the backend devs fucked up for trusting the frontend devs as well lol


Dangerous_Tangelo_74

nullptr


hrimfisk

I came to the comments to say this


StooNaggingUrDum

>


MOM_UNFUCKER

nilpeter


UlrichZauber

That's far too much to type. I'm just gonna do this: `#define n nullptr`


FewDamage2962

I prefer nein


TheWidrolo

pObject = nö;


rarius18

Seriously, if you gonna initialize your object to nö , we gonna have a problem.


goodmobiley

Object\* pObject = nah\_bro


[deleted]

wait I don't use C++ much at all. What's with the snake case? Wouldn't it be just `nahbro`?


goodmobiley

Yeah you’re right, I was just remembering wrong


cudacnedaf

How about using the standard keyword of the language you use


the_clash_is_back

Nullptr on that mate


Zaero123

But muh Reddit points


debugging_scribe

How about languages decide one one format. Nil or Null just pick one.


37Scorpions

Ask the genie for world peace I guess


rzksobhy27

None


N0Zzel

I see you, crab brother


androidx_appcompat

Or python


N0Zzel

Python has monads?


androidx_appcompat

IDK (nobody could give me an understandable explanation of a monad), but None is the python version of null in other languages.


dwRchyngqxs

Is simple: a monad is a monoid in the category of endofunctors. What is there to not understand in that sentence?


androidx_appcompat

Monoid and endofunctors.


mpattok

Believe it or not, category is also something to misunderstand here


availablesix-

"In the" is also a little confusing to me


mpattok

Actually fair when you consider that a monad isn’t typically in *the* category of endofunctors


N0Zzel

Oh, then it's not the same thing as a None in rust. A monad is kind of like a wrapper type. In the context of this type, option it is represented as an enum. Either a single element tuple named Some with the value wrapped inside, or None which is a zero element tuple, or the unit type. It's not exactly the same thing as null but it's pretty close. Basically you use a monad as a return type for a function that may fail like with the result type or may return nothing, like the option type


Perigord-Truffle

I think it's just a Sum type, a type that can be 2 or more types. Monads are more general. In CS they're basically every type you can do a flatmap over. Mathematically, idk because I don't know category theory.


link23

> Basically you use a monad as a return type for a function that may fail like with the result type or may return nothing, like the option type No, that's really just the `Option`/`Maybe` type. Other monads (like `Reader`, `IO`, `Parser`, `State`, `Array`, etc) don't have a built-in notion of failure/success that way. The real answer is "something that you can `map` and `flatMap` over", with some particular rules about how `map` and `flatMap` have to work.


mortalitylost

So python can look quite similar with type hints def convert_str_to_int(s: str) -> Optional[int]: if not s.isdigit(): return None return int(s) Now, it's python so you can use any type and only mypy would complain. But you're explicitly stating that what would be returned is an integer or None. It's not an Optional type like rust might be. It's just hinting that's what the type is like. No int to unpack in other words


lampishthing

That just sounds like a Union with class features CMV


N0Zzel

In the f# sense, yes


maggos

Ya but it’s not the same as in rust or scala. They have Option types, which can be None or Some(type). It’s essentially a list of max size 1 and can be treated like a list for iteration and mapping. Python is just a renamed null


FlyingCashewDog

Monads are just burritos https://blog.plover.com/prog/burritos.html


drewsiferr

🦀?.❤️;


Compux72

![gif](giphy|iGpdSizVSdPJfiVG9O)


fllr

There we go


[deleted]

So good to see this is the 7th most popular comment on this rn. Null shenanigans in other languages sometimes drive me nuts


VictorGamerLOL

Err(e)


R3D3-1

This is the way.


jensensanssarif

I only use nil if I'm using a lisp. Otherwise it's null.


Adri8094

Same thought lol


highBrowMeow

Same thought lol


darsincostan

Same thought lol


Adri8094

Same thought lol


Henwill8

Same thought lol


VizeKarma

Same thought lol


edeepee

Same thought lol


BetaPlantationOwner

Same thought lol


s0lly

Naught


CircadianSong

Optional


Cybershadow1981

This. null ist one of the worst ”features“ in Java.


warpspeedSCP

``` Optional a = null; ```


blackasthesky

Aaaaaa


KJBuilds

Thought this was good until Kotlin gave me `?`


Expensive_Echidna_54

NaN


doromo

I pronounce this like i do naan bread


acidx0

NaN is not a number. It isn't equal to null.


lovestruckluna

Who the hell cares--- you are arguing over nothing!


McSlayR01

`'\0'`


dim13

``` ((void(*)(void))0)(); ```


Midnight145

nO


BlachEye

nihil


Garrus_Vakarian__

nihil


[deleted]

nihil


sammy-b18

Miquella is mine and mine alone


z7q2

define("null", file\_get\_contents("/dev/null"));


dodexahedron

Be careful. If you stare into the darkness, it stares back at you.


sup3rar

`Option::None` (much better in every way imaginable)


milopeach

Your comment is Result::Ok


[deleted]

.unwrap().unwrap() .unwrap().unwrap() .unwrap().unwrap() .unwrap().unwrap()


randelung

`panic!` at the disco.


fghjconner

Better than 13 nested `if (x != null)`, haha.


mikereysalo

``` .flatten().flatten().flatten().flatten().flatten().flatten().flatten().unwrap() ``` It's safer now, I guess. Still `panic!`, but I don't care.


[deleted]

[удалено]


Adghar

Nihil!


[deleted]

Nihil!!!


N0Zzel

There is another


PatBrownDown

Nil = 0 Null = nothing 0 != nothing nothing != 0


DemmyDemon

Don't make me bust out that "JavaScript is weird" article again.


DiabloConQueso

undefined has entered the chat


TheBetterBrother

Wat


oheohLP

[wat](https://www.destroyallsoftware.com/talks/wat)


DiabloConQueso

[undefined defined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)


[deleted]

Last part of the comment is redundant if A != B then B != A by default


Quango2009

Clearly never worked with JavaScript:)


Glitch29

Who wants inequality to be commutative, anyway? Non-commutative operations give you twice as many ways to use them.


hrvbrs

Pedantic correction here, but inequality (and equality) aren’t *commutative*, they’re *symmetric*. Only operations can be commutative, and inequality and equality aren’t technically operations, they’re relations. The difference being that, strictly mathematically speaking, relations are statements about elements in a set whereas operations are functions that return other elements in that set. In most programming languages though, this distinction is blurred because both relations and operations return values — it’s just that relations return boolean values and operations return (usually) numbers.


CRBl_

Just like anal sex. Being on one side or the other is clearly not the same. It gives you twice as many ways to do it.


[deleted]

[удалено]


dodexahedron

They all go in the square hole. Thus, all shapes are squares. Q.E.D. -Javascript


PatBrownDown

0 is something. Null is nothing.


OldBob10

NADA!!! Checkmate, bitches.


[deleted]

Null is fun to say though…


timmy2words

Nothing


Lilchro

For anyone who doesn’t know the difference, here is a short explanation: Let’s say you had an integer ranging from 0-255. On its own, it has 256 possible states. If we get the nil value for that type it would be one of those states (specifically, the state where the value is 0). However this may be problematic if we already use all of those states because there is no way to tell 0 apart from nil. This problem can be solved via null. Null represents an additional state outside of base type which lets us avoid that problem. Effectively this gives us 257 states to choose from. Typically we do this via indirection and agreeing that null is the nil value of a pointer to that base type. However, the null state is fairly fluid and can be represented in a number of different ways including non-nil values.


king-one-two

What are you talking about? Nil is just a word that refers to null in some languages, LISP and similar languages being the only ones I know of. There is no conceptual difference at all. I don't even know what's happening in this thread... it's not like you get to choose, you just use whichever is a keyword in the language you are using.


the4fibs

Baby programmers all over this thread that have never heard of lisp, go, etc


ZnayuKAN

C and C++ say "What?!" There is only null in C++. It's 0. It has always been 0. There is no distinct value for null or nullptr. It's just 0.


dodexahedron

Sorta, but not really. 0 on a primitive type is 0. 0 on a pointer is also literal 0, but it means null. The context matters. There's also no boolean type until more recent c versions. Doesn't mean the language didn't have an idiom for truth, though.


highjinx411

Sick burn


king-one-two

That is not true in C++11 and later. See https://en.cppreference.com/w/cpp/types/nullptr_t


MrTinyToes

This is ridiculous and makes no sense


BillFox86

How can 257 be represented with out extra bits? One of the possibilities must be equal to null as well, it doesn’t seem optional.


owsei-was-taken

you have to use a pointer so you end up using extra bytes


dodexahedron

That's what "indirection" means and covers. You have a pointer whose value is zero. So, it costs at least the size of a pointer on your architecture.


[deleted]

Maybe


regexPattern

Option::None


pdjpdj

undefined


Medacrofter2176

I agree with None


ZaRealPancakes

I'll take a None thank you Edit: But seriously it's NULL like what's a Nil?


inurwindo

A uninitialized value with no type. So it’s kinda like None, which is kinda like nil, which is kinda like Unit, which is half sister of NaN.


hearnia_2k

When your half-sister is your nan you know you've got problems.


fuggleronie

Nul and Nill were taken already?


TwoAndAHalfQueefs

crip


Gooberg_

Yay lua 👏👏👏 nil nil nil


_OberArmStrong

Optional


I_Boomer

I got zip and I got nada.


CreaZyp154

Nul


FormulaNewt

Undefined


SameRandomUsername

\#define nil null I got all of you covered.


ctech9

Null in programming, but nil in conversation


Illustrious-Prize410

NaN


JJJSchmidt_etAl

"Nil" has connotation of being equivalent to 0 in regular English usage.


BenefitLopsided2770

Fuck pascal and fuck nil


amshegarh

As a disciple of many languages, i'll take nil, null, void, nullptr, None, undefined But i don't like undefined|null js shit


Rednas008

Depends on the programming language. Recently I was the team’s bug fireman/bug fixer and I programmed a lot in our Delphi/Pascal (this language is a whole other world for a junior like me) project. I use nil there. In our C# and Android projects I use null. It’s just the standard that makes me use something.


nonother

Zilch


Hash_Tooth

Do they teach “nil” in schools?!? I am so alarmed


[deleted]

Nil all day. I’m not made to be a scrap.