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

Interesting. I think I saw this in Swift? Or c#? I guess in Python this is where EAFP comes in.

I definitely hate chains of guards to get at a nested property.



In haskell the lens library does this -- it's a useful feature to have.


Quite a few language have this feature, and it is a Stage 1 proposal to become a part of the JS spec



C# has it.


Yep, they're called null conditional operators[1].

[1]: https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...




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

Search: