Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C#'s ?? operator does exactly that.

`x ?? y` returns y iff x is null.

In daily practice, I've hardly ever used it. I use early returns all the time, though, and the code becomes very nice and readable.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: