November 20, 2021

On Saturday, 20 November 2021 at 16:42:02 UTC, Atila Neves wrote:

>

On Friday, 19 November 2021 at 10:21:35 UTC, Max Samukha wrote:

>

On Thursday, 18 November 2021 at 19:32:36 UTC, Atila Neves wrote:

>

Works with ref prop() { return _fld; }.

The whole point of properties is to hide private state.

I don't agree - I think the point is to treat getters like state.

>

Exposing a private member for direct mutation is generally a bad idea.

I agree wholeheartedly. Getters are a code smell, setters stink.

It is not a code smell if:
You are concern with the private member integrity.
You wanted to call other functions such as log audit every time a variable is being written.

  • Alex
November 21, 2021

On Saturday, 20 November 2021 at 16:42:02 UTC, Atila Neves wrote:

>

I don't agree - I think the point is to treat getters like state.

Ok, I get your point. I think you've changed my mind.

> >

Exposing a private member for direct mutation is generally a bad idea.

I agree wholeheartedly. Getters are a code smell, setters stink.

November 23, 2021

On Saturday, 20 November 2021 at 16:42:02 UTC, Atila Neves wrote:

>

On Friday, 19 November 2021 at 10:21:35 UTC, Max Samukha wrote:

>

On Thursday, 18 November 2021 at 19:32:36 UTC, Atila Neves wrote:

>

Works with ref prop() { return _fld; }.

The whole point of properties is to hide private state.

I don't agree - I think the point is to treat getters like state.

>

Exposing a private member for direct mutation is generally a bad idea.

I agree wholeheartedly. Getters are a code smell, setters stink.

I 100% agree

4 5 6 7 8 9 10 11 12 13 14
Next ›   Last »