Hacker News new | past | comments | ask | show | jobs | submit login

that’s not the bug here. they got caught by precedence rules



I believe what GP is saying is: coming from python, which uses `and` and `not` and `or` you expect those to be the binary operators in ruby as well. You are then surprised when they behave unexpectedly. Who is then to blame for your frustration? Is ruby a bad language for having both `and` and `&&`, or are you at fault for not doing enough research? (I don't see why someone coming from python would look any further after trying `and` and seeing that it seems to work just fine). I think this is an unfortunate situation, but one that doesn't really happen to someone that does ruby day-to-day; so it shouldn't really factor in as an argument to write ruby off.

But then is being surprised by `["0","1","10"].map(parseInt) // => [0, NaN, 2]` in JavaScript a sign of bad language design or does it just mean that you don't have enough experience with the language yet?


I suppose “|| and or” mean different things was a little too loose or broad a way of expressing that, but I agree what the big is and you see how it fits in with my overall point I’m sure




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: