Hacker News new | past | comments | ask | show | jobs | submit login

This is the "uniform access principle": https://en.wikipedia.org/wiki/Uniform_access_principle



I’m well aware. It’s just a bad concept. Knowing that something behaves as a function invocation is extremely important. The idea that this knowledge should not have consequences for the mental model of the caller is a bad idea. Setting up a design that achieves this (where, from the caller’s perspective, attributes vs side-effectful argumentless methods appear the same) results in a bad design.

I see this a lot with Named Principles and Design Patterns. They have Capitalized Names and Entries on Wikipedia so people believe they are Pragmatically Successful and Deserve Respect.

But they are usually just junk. Things like Liskov, all kinds of nominal design patterns, mischaracterizations of least astonishment, etc.

A good heuristic is to ignore all that garbage and just use common sense.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: