Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Oh my, please don't apologize! I'm learning a lot from this thread, and I think others are as well.
I agree that 'and' and '&&' have different precedences, and new programmers should not assume 'and' is just a pretty way to say '&&'. That doesn't make the solution incorrect. 'and' still short circuits, so both values have to be true in order for the method to return true. For logical evalutation, the two function the same way.
The problem happens when, like your link says, in when you try to do control flow with '&&', assuming it has the same presedence as 'and'.
For this kata, I really don't see a problem with this solution, but I 100% agree that ruby coders need to be aware of the subtle difference between 'and' and '&&'
@surajreddy thanks for the link! I assumed it was a prettier way of writing && and ||...I was way off!
I'll keep that in mind when deciding to use &&/|| or and/or (I mean &&/|| || and/or haha..)