in search of a compelling reason to use ruby....

N

Neil Mc Laughlin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top