Programmers will understand

Jun 4, 2017 9:06 PM

Ryeore

Views

117242

Likes

2062

Dislikes

82

It's the year 2017. Use nullptr, not NULL.

8 years ago | Likes 3 Dislikes 0

Unless it's Pointer

4 years ago | Likes 1 Dislikes 0

Am programmer can confirm

8 years ago | Likes 2 Dislikes 0

0, null and blank. My team never fully king gets it. Same with boolean, only store false if null means something!

8 years ago | Likes 1 Dislikes 0

Love it :-)

8 years ago | Likes 3 Dislikes 1

Idk programming but I think I get it

3 years ago | Likes 1 Dislikes 0

Just started learning programming and I do sort of understand :D

8 years ago | Likes 1 Dislikes 0

Isnull(tp,'')

8 years ago | Likes 6 Dislikes 0

WHAT ABOUT N/A?

8 years ago | Likes 1 Dislikes 0

Also NaN

8 years ago | Likes 1 Dislikes 0

I'm not a programmer and I still got it. :\

8 years ago | Likes 1 Dislikes 0

There are 10 types of people in the world...those who understand binary and those who don't.

8 years ago | Likes 1 Dislikes 0

I'm not a programmer and i understand. Not sure why though

8 years ago | Likes 1 Dislikes 0

That resonates more than thirty minutes worth of office hours with !y programming 1 professor

8 years ago | Likes 1 Dislikes 0

It's a trap, I mean switch

8 years ago | Likes 1 Dislikes 0

So when I used to say between 0 and none, there was actually something between them.

8 years ago | Likes 1 Dislikes 0

For people who don't understand. When computers see 0 they only see it as a value, null tells the computer there is nothing there

8 years ago | Likes 1 Dislikes 0

oh shit!

8 years ago | Likes 1 Dislikes 0

Meanwhile, I'm trying to explain how much better this type of toilet paper dispenser is. Japan over engineers everything.

8 years ago | Likes 1 Dislikes 0

I'm not a programmer but I still understand it, does that make me smarter than all programmers?

8 years ago | Likes 5 Dislikes 2

It means you are logical. Congrats! Coding is just a logical way of expressing statements.

8 years ago | Likes 6 Dislikes 0

There is many other things you need when coding. Patience, planning and dedication are all important too. E.g. I always forget semicolons.

8 years ago | Likes 2 Dislikes 0

Now you're talking about software construction as a whole. Avoid languages with semicolons.

8 years ago | Likes 1 Dislikes 0

thank god im ....bi-polae

8 years ago | Likes 1 Dislikes 0

I don't get it.

8 years ago | Likes 37 Dislikes 6

While 0 and "null" are basically the same outside of logic (empty), 0 is still "something". Like an empty tp roll vs nothing at all.

8 years ago | Likes 11 Dislikes 0

I totally couldn't even tell they were TP rolls.

8 years ago | Likes 1 Dislikes 0

Like, 0 is you've run out of X and null is you didn't even had X to begin with?

8 years ago | Likes 2 Dislikes 0

not really, 0 is a numerical value of X. Null is X doesn't have a value what so ever.

8 years ago | Likes 2 Dislikes 0

Stupid programming joke that isn't funny.

8 years ago | Likes 6 Dislikes 36

Just because you say "only programers understand" that doesn't make it funny

8 years ago | Likes 5 Dislikes 10

Fuck you and opinion

8 years ago | Likes 2 Dislikes 0

public void SenseOfHumor() { throw new NotImplementedException();}

8 years ago | Likes 1 Dislikes 0

Zero means none of something. Null means there is no something.

8 years ago | Likes 133 Dislikes 1

what about undefined

8 years ago | Likes 1 Dislikes 0

Zero just non and o takes a full alphabet

8 years ago | Likes 1 Dislikes 0

So an empty cup vs no cup?

8 years ago | Likes 12 Dislikes 0

Depends on language. Some, yes. Others, knowing there is no cup vs not knowing where to find a cup, trying anyway, and grabbing "something"

8 years ago | Likes 2 Dislikes 0

Yes.

8 years ago | Likes 6 Dislikes 0

Memory allocated, no value assigned?

8 years ago | Likes 9 Dislikes 2

Null is a constant. Null is null is null.

8 years ago | Likes 3 Dislikes 0

Depends.

8 years ago | Likes 4 Dislikes 0

?

8 years ago | Likes 3 Dislikes 0

14 years after C++ now i get it

8 years ago | Likes 66 Dislikes 2

[deleted]

[deleted]

8 years ago (deleted Jun 5, 2017 8:42 PM) | Likes 0 Dislikes 0

You are a very slow learner

8 years ago | Likes 25 Dislikes 1

It's important to know the difference, but you can get by without knowing why (1+1 = 2: doesn't really matter if you don't understand why)

8 years ago | Likes 1 Dislikes 0

Thanks internet stranger.

8 years ago | Likes 10 Dislikes 1

This is the the worst lie anyone has ever told.

8 years ago | Likes 5 Dislikes 0

It's more complicated. Imagine you try to grab the toilet paper and instead you grab a random item in your household while someone (...)

8 years ago | Likes 45 Dislikes 2

Mm, depends on the language. For C that's perfect, for Java less so. Either way you're gonna have a bad time.

8 years ago | Likes 8 Dislikes 0

True. I gave lessons in C when I was working at the university.

8 years ago | Likes 2 Dislikes 0

It's true in the context of having toilet paper available for not I think?

8 years ago | Likes 1 Dislikes 0

Dereferencing a null-pointer doesn't yield a random bit of memory. It's an instant access violation (i.e. crash).

8 years ago | Likes 2 Dislikes 0

what would an uninitialized toilet paper roll look like?

8 years ago | Likes 1 Dislikes 0

(...) bangs against the door and yells that your not allowed to touch that.

8 years ago | Likes 35 Dislikes 1

You're

8 years ago | Likes 1 Dislikes 0

And a majority of people won't understand just how perfect this analogy is.

8 years ago | Likes 14 Dislikes 2

Going by upvotes there's at least a few XD

8 years ago | Likes 1 Dislikes 0

I just finished a course using C not too long along... yeah, this is perfect. :D

8 years ago | Likes 3 Dislikes 1

There are 10 kinds of people in this world, those who understand binary and those who don't.

8 years ago | Likes 9 Dislikes 4

There are 2 kinds of people, those who can extrapolate from incomplete data.

8 years ago | Likes 6 Dislikes 0

Brilliant Android sheerly brilliant (and I know sheerly isn't really a word but it's soo win).

8 years ago | Likes 2 Dislikes 0

There are three kinds of people. Those who can count and those who can't

8 years ago | Likes 3 Dislikes 0

I never got why this isn't saying there's 3 types of people 0, 1, 10.

8 years ago | Likes 3 Dislikes 2

Nicely done!

8 years ago | Likes 2 Dislikes 1

0 is still 0 in binary.

8 years ago | Likes 2 Dislikes 0

At least I think it is

8 years ago | Likes 1 Dislikes 0

But in a list the third item is 2

8 years ago | Likes 1 Dislikes 0

Yes, but that's because the first item is item index 0. It's waste of memory not to use 0 as an index.

8 years ago | Likes 1 Dislikes 0

So.... 0, 1, 10 is 3 items... if those items are people who understand binary are there not then 3 of them?

8 years ago | Likes 1 Dislikes 0

If(!$tp){panic()}

8 years ago | Likes 133 Dislikes 3

@TheDisco

8 years ago | Likes 1 Dislikes 0

Haha

8 years ago | Likes 10 Dislikes 0

Else{wipe()}

8 years ago | Likes 3 Dislikes 0

As a c++ programmer no semi colon hurts

8 years ago | Likes 16 Dislikes 0

As somebody who only is self taught in basic... errrrrr.

8 years ago | Likes 1 Dislikes 0

As a programmer, using PHP hurts in general.

8 years ago | Likes 9 Dislikes 0

As a Java programmer, same.

8 years ago | Likes 6 Dislikes 0

nah man, just gotta keep a cool head. if(!$tp){usesock()}

8 years ago | Likes 40 Dislikes 0

Totally (I don't)-[know$any+thing]-Insert: Anything value: About-((Programming))

8 years ago | Likes 4 Dislikes 1

8 years ago | Likes 21 Dislikes 0

jQuery FTW

8 years ago | Likes 1 Dislikes 1

jQuery isn't even a language.

8 years ago | Likes 1 Dislikes 0

That's not jQuery. It looks like PHP.

8 years ago | Likes 2 Dislikes 0

Dollar sign says PHP, but lack of semicolon excludes that. Python?

8 years ago | Likes 2 Dislikes 0

Looks like php to me. Source: I develop in php

8 years ago | Likes 1 Dislikes 0

Not any Python that I've ever seen. I'm not even sure Python allows for variables with dollar sign in their name. Javascript, however, does.

8 years ago | Likes 1 Dislikes 0

Powershell, then? @128k what's your syntax?

8 years ago | Likes 1 Dislikes 0

I am pretty sure that it is jQuery

8 years ago | Likes 2 Dislikes 0

Also known to non-javascript devs as a heaping pile of nope.

8 years ago | Likes 2 Dislikes 0

You are not syntactically required to punctuate a statement that immediately precedes a curly-bracket.

8 years ago | Likes 1 Dislikes 3

Edit: Actually, I'm full of shit. I must be confusing this with JavaScript, where it's entirely optional, but I don't neglect them anyways.

8 years ago | Likes 2 Dislikes 1

lol I recently had a debate with a coworker about JavaScript and doing away with semicolons - I'm firmly against ditching them :-p

8 years ago | Likes 2 Dislikes 1

That's like arguing to get rid of periods. Unless you're using Python where that is the defined syntax it's preposterous.

8 years ago | Likes 1 Dislikes 0

Really? I seem to recall getting errors for missing semicolons in PHP. I haven't done PHP in quite a while, though, so I may be mistaken.

8 years ago | Likes 2 Dislikes 0

I tried it out and I'm wrong. I'd never be that lazy, but I swear I've seen it done. It may be a php.ini setting.

8 years ago | Likes 1 Dislikes 0

That's the best way to explain it

8 years ago | Likes 361 Dislikes 4

I can also smell it from here.

8 years ago | Likes 1 Dislikes 0

!false. Its funny because its true.

8 years ago | Likes 4 Dislikes 0

This was on my computer science club shirts... Its cringy af

8 years ago | Likes 2 Dislikes 0

I'm going to use this in future tutorials I give. Well played indeed. Although, its really not concept I find folks struggle with.

8 years ago | Likes 3 Dislikes 0

Like say recursive functions and such.

8 years ago | Likes 3 Dislikes 0

You know, it really is

8 years ago | Likes 33 Dislikes 1

If needExplanation(){ explain(well); };

8 years ago | Likes 5 Dislikes 2

I don't understand... Could you explain?

8 years ago | Likes 8 Dislikes 0

0 is an integer, null means there is no value whatsoever.

8 years ago | Likes 2 Dislikes 0

I think 0 = empty and null = nothing.

8 years ago | Likes 8 Dislikes 0

Declaring a variable as 0 is something, it literally takes up a space of memory, null is nothing. There's nothing there to use up memory.

8 years ago | Likes 5 Dislikes 1

0 = Value that's 0, aka the number. Null = nothing what so ever.

8 years ago | Likes 22 Dislikes 0

It's like "Air vs Vaccum"

8 years ago | Likes 19 Dislikes 1

[deleted]

[deleted]

8 years ago (deleted Oct 15, 2017 9:08 PM) | Likes 0 Dislikes 0

[deleted]

[deleted]

8 years ago (deleted Oct 15, 2017 9:07 PM) | Likes 0 Dislikes 0

But...but...an int isn't a nullable type. Oh, ok fine, I'll allow it.

8 years ago | Likes 3 Dislikes 1

if it's javascript it doesn't matter

8 years ago | Likes 1 Dislikes 0

In databases all types allow null

8 years ago | Likes 2 Dislikes 0

Ah, yeah, good point

8 years ago | Likes 1 Dislikes 0

it could be an int*? Wait no that just makes them both null...

8 years ago | Likes 2 Dislikes 1

That's why nullptr is the better choice. int* x = nullptr is clearer than int* x = 0

8 years ago | Likes 1 Dislikes 0

nullptr is still 0x00000000, but you're right that nullptr should always be used over the NULL macro (as long as your compiler supports it).

8 years ago | Likes 1 Dislikes 0

I guess the bit on the NULL macro is microsoft compiler specific, im not as familiar with the linux c++ world.

8 years ago | Likes 1 Dislikes 0

ToiletPaper.Count = 0. Empty list vs uninitialized list ????

8 years ago | Likes 2 Dislikes 0

Yeah but an empty object is different than "0". That's probably the closest thing though

8 years ago | Likes 1 Dislikes 0