2 ms·
Because the former reads more like english. I would ask "is 2 even?" but I would never ask "does the quality of evenness apply to 2?" One of the things I disl
by JonnieCache 15y ago
Because the former reads more like english.
I would ask "is 2 even?" but I would never ask "does the quality of evenness apply to 2?"
One of the things I dislike about python is the word order you end up with. My eyes have to jump about to work out whats going on. Its like german ;)
- Locke1689 15y agoYour order is like English, but your semantics are the exact opposite. My code asks "is 2 even?" -- it calls the even? function to check to see if it's a boolean. If you notice, the even? object function is referentially transparant and implicitly contains its own argument. It's not really a function. It's a field. What Ruby has done is define a field of every Integer instance which returns True or False based on a separate function call that determines whether or not the object is even. It's irrelevant how the function is implemented because those are the semantics -- you have defined a method that answers if the quality of evenness applies to 2. Your own example is exactly why I dislike the semantics of this object method.
- JonnieCache 15y agoYes, but I like it like that you see.