Hacker News new | ask | show | jobs
by duckerude 2047 days ago
This is also known as the uniform access principle: https://en.wikipedia.org/wiki/Uniform_access_principle

I believe Ruby and Smalltalk more or less work that way.

1 comments

Thanks a lot for the pointer! I was initially distracted by listing C#, JS and Python as examples, but the article clearly states:

"Many programming languages do not strictly support the UAP but do support forms of it. Properties, which are provided in a number of programming languages, address the problem Meyer was addressing with his UAP in a different way. Instead of providing a single uniform notation, properties provide a way to invoke a method of an object while using the same notation as is used for attribute access. The separate method invocation syntax is still available."