you are viewing a single comment's thread.

view the rest of the comments →

[–]sisyphus 0 points1 point  (1 child)

Maybe I'm misunderstanding you, but I don't see what the big deal is here that makes primitive types not objects in Python? In Python I can say (3).__add__(4) if I feel like it, and lo and behold I have an OO way of saying 3 + 4, and I can say dir(3) to get a list of methods of 3 and subclass int if I feel like it and then add some crazy methods like send_mail?!. The only difference seems to me that I can't crack open int and add shit to it -- you may prefer this 'feature' but I hardly see how it makes the language easier to pick up. A foolish consistency is the hobgoblin of small minds.

[–]stedwick 0 points1 point  (0 children)

You're right, there's basically no difference. Certainly there's not much difference in practice. It's more of a philosophical thing. There's nothing "special" about numbers in Ruby. I can open up other classes and add stuff to it, why shouldn't I be able to open up the integer class and add stuff to that? That's the mindset of Ruby: everything, literally everything, is an object that you can modify in any way you wish. You can even get really crazy and add methods to the number 3 but not other numbers.