Hacker News new | ask | show | jobs
by danso 4852 days ago
Wow, I must have missed the point. Because I could've sworn the OP was talking about how he thought that 'and' and 'or' could be stand-in's for && and ||, but he found out that they aren't quite equivalent. Because if they were equivalent, he would substitute words for symbols because, as I quoted, "[his] code became so much readable."

I'm not evaluating what he discovered at the end of the post. I'm evaluating his original intent for using 'and' and 'or' in the first place, which was readability. I'm simply stating my opinion on that comparison.

And yes, "a = true and false" doesn't make sense. I just copy-pasted his sample code as a quick example. I didn't expect people to take it literally, as if I were showing off a best practice.

1 comments

Hmm you're absolutely right. I guess I'm projecting, I just read that as using `and` and `or` in places that seemed logical to him, but the paragraph is quite clear in that he just replaced all instances of the symbols with the words.

Since that is the case, I fully agree with you and shouldn't have been so snarky. I apologize :(

Well, it's a Friday afternoon :) You were right I didn't read to the very end (I kind of guessed what the OP was going to conclude)...I was mostly interested in seeing of other people thought 'and' and 'or' were good Ruby idioms to use (ignoring the precedence confusion).