News for hackers. Stuff that matters.
Re:Java 1.0 Turns 25 by kabes on Saturday January 23, 2021 @11:09AM (#25883252)
Javascript can do the same, but I think it's an anti pattern, since now the caller doesn't know what side effects, or performance characteristics you get by accessing the property with an implicit getter/setter.
Re:Java 1.0 Turns 25 by dragonwriter on Saturday January 23, 2021 @03:34PM (#25885806)
> now the caller doesn't know what side effects, or performance characteristics you get by accessing the property with an implicit getter/setter.

Beyond method call overhead (which may or may not be a given depending on how things are optimized in some languages), the caller doesn't know that automatically with explicit getters/setters, either; you'd have to read the source to know that just as much if they are explicit as implicit (or rely on documentation, which hopefully is complete and current).