News for hackers. Stuff that matters.
Re:Ruby is beautiful (but I'm moving to Python) by masklinn on Monday November 29, 2010 @02:31AM (#1949693)
> I haven't studied OOP extensively in a strict setting, but I would have said that in the OO world, a property is completely separate to a method.

There is absolutely no reason for that, and the grandparent of all things object-oriented (Smalltalk) very strongly disagrees with you: everything is a message, and there are no properties.

> A property defines data about an object, and a method defines something you can 'do' with the object.

A getter method is a property and a method. Properties are irrelevant, access should be uniform, the implementation details of an object (whether a "property" provides direct access to internal data or not) is of no concern to the user of the object.

A property is nothing more than a method whose contract is "give me some data"

Re:Ruby is beautiful (but I'm moving to Python) by axod on Monday November 29, 2010 @04:27AM (#1949841)
That's a fine answer, and some people may find that a helpful way to organize programs.

However, for me, and the CPU, we treat code execution differently to data access.