HN2new | past | comments | ask | show | jobs | submitlogin

I'd say the elvis operator would make things worse, especially wrt the parent post.

The problem isn't that `user && user.username` style validation is verbose, but that it's very error-prone. Making it less verbose just means you'll more likely use it before you reach for a better validation strategy, like a declarative validation library.



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

Search: