4 ms·
"In some languages, you have some objects with methods named size, some with length, etc." In ruby you dont. It's #size and ruby is quite consistent in this re
by xtho 16y ago
"In some languages, you have some objects with methods named size, some with length, etc."
In ruby you dont. It's #size and ruby is quite consistent in this respect. So it's remembering a method name vs remembering a function name (in a supposedly OO language).
- nanairo 16y agoActually in Ruby you can often use both #size and #length. It's part of the Ruby's philosophies to have synonyms like that.