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

Discussion in 'Ruby' started by Neil Mc Laughlin, May 10, 2004.

  1. 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.
    Neil Mc Laughlin, May 10, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brandon J. Van Every

    What's TOTALLY COMPELLING about Ruby over Python?

    Brandon J. Van Every, Aug 18, 2003, in forum: Python
    Replies:
    51
    Views:
    1,041
    Christos TZOTZIOY Georgiou
    Aug 23, 2003
  2. Michael Sparks
    Replies:
    2
    Views:
    266
    Bruno Desthuilliers
    Aug 18, 2003
  3. Ray
    Replies:
    96
    Views:
    1,688
  4. ilana
    Replies:
    0
    Views:
    463
    ilana
    Nov 22, 2006
  5. Ryan Paul
    Replies:
    22
    Views:
    352
    Kristof Bastiaensen
    May 13, 2004
Loading...

Share This Page