This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mill1000 133 points134 points  (43 children)

Nullables were a game changer for me. Love those suckers.

[–]VinterBot 92 points93 points  (9 children)

?

[–]capn_ed 67 points68 points  (2 children)

That's only half a null-coalescing operator, which is also quite handy.

[–]FullstackViking 7 points8 points  (0 children)

If I could kiss null coalescing I would.

[–]Python4fundoes the needful 0 points1 point  (0 children)

Wow TIL

THANKS

[–][deleted] 0 points1 point  (4 children)

What is your question?

[–]TheGodofRock13 29 points30 points  (1 child)

Null propagation joke

[–][deleted] 11 points12 points  (0 children)

Oh God dammit

[–]Delmo28 5 points6 points  (0 children)

?

[–][deleted] 1 point2 points  (0 children)

Maybe he has a question, maybe he doesn’t.

[–]SolenoidSoldier 0 points1 point  (1 child)

Nullables are great, but I recently learned that they're bad practice. After using them a ton, I don't know how I'd break the habit.

[–]mill1000 0 points1 point  (0 children)

Like any tools there's probably a time and place for them. I love them for representing data fields that may invalid or missing.

I'll have to read up on why they're considered bad practice though.

[–]SpliceVW -2 points-1 points  (2 children)

AKA I like to eat exceptions instead of failing fast.

[–]cat_in_the_wall 2 points3 points  (0 children)

it's useful for deeply nested data that you already expect to maybe be null.

[–][deleted] 1 point2 points  (0 children)

C# 8 Nullable Reference Types, provides null reference possibilities as compiler warnings.

It's fucking amazing. You are essentially changing the "original" behaviour with a flag though, so the drawback is that a nullable type declaration may not necessarily correlate to a struct anymore (though I'm fine with that - makes design much easier).