I used to code in Python.
My compelling reason for using ruby was based around privacy of methods and
attributes. I just got fed up in python using __foo (and self.__foo) to
refer to private attributes and methods.
I prefered ruby’s approach which makes all instance variables private, but
allows effortless creation of accessor methods with the ‘attr_accessor’ and
other constructs.
Later, I got to like:
-
Principle of Uniform access: use of the same notation for function call
and attribute access. I’ve already said I liked that, but I got to like it
more. -
private and protected keywords for methods. No more "def __meth(self…)"
for me! -
The discovery that the attr_accessor, private and protected "keywords"
weren’t keywords, they were themselves methods (of Module). -
Ruby’s support for metacode.