Hacker News new | ask | show | jobs
by carterehsmith 3535 days ago
> I guess not. Sometimes the cleanest thing to do is to just mutate a field - particularly for GUI objects.

I don't know if it's worth the overhead of having unthinking developers writing { get; set } for every field in every class because it makes things "easier".

I do not understand your point. First you claim that we should not mutate the field, then you claim that we should mutate the field.

Which one is it? Mutate or not?

1 comments

Generally not mutate. And if we must mutate, mutate in a batch with a single method with a descriptive name.

We should generally not use goto or local variables either. Avoid reaching for these constructs first. But if it's by far the cleanest, and simplest way of solving the problem - which it usually isn't - go ahead and do it.