4 ms·
I would be concerned by someone not knowing || - it is used all the time by almost every major project. Not knowing what that one did outside of an if functions
by nmjohn 12y ago
I would be concerned by someone not knowing || - it is used all the time by almost every major project. Not knowing what that one did outside of an if functions tells me 1.) Said person hasn't actually looked at any code other than their own OR 2.) They saw it and didn't care enough to learn what it did. Either way, strike against them.
The && though, I've never used in this context. And I'm not sure if I've seen it out in the wild or not. I knew what it did right away so I imagine if I have seen it before I wouldn't remember.
- talles 12y agoI second that. I use the || trick really often, but never the && one. By the way, why not use a one-liner if instead? if (condition) something; I find more readable this way.
- nmjohn 12y agoIt is definitely more readable. Best practices would say always to use curly braces though. I go back and forth on my opinion of that. Also, for example I use a sublime plugin to automatically tidy my code, and that isn't an option in it, so I don't do it anymore.
- vlunkr 12y agoOr 3.) They are new developers. I learned to use that at some point and so did you.
- nmjohn 12y agoWell yes, absolutely, but the context was someone being hired for a job and seeing the codebase. Someone that green is, at least in my opinion, not yet qualified to be hired as a programmer.