[squeak-dev] tim rants (was Re: The Trunk: ToolBuilder-Kernel-pre.122.mcz)
Levente Uzonyi
leves at caesar.elte.hu
Wed Apr 25 17:29:04 UTC 2018
On Wed, 25 Apr 2018, tim Rowledge wrote:
>
>
>> On 24-04-2018, at 10:38 PM, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
>>
>> Ooops... kind of a paradox I stumbled upon here. :-D Well, you know what I mean...^^
>
> Yup.
>
> It's just another occasion to mumble my long-running rant objecting to bad programming style. If we had private methods then defaulting to creating setter/getters might well make sense, so long as they were private. Indeed, you could even make the compiler create them as part of generating a class - or even allow the inverse so that adding such a method automagically added the instvar to the class.
Why would you want to create private accessors when you can just access
the variable directly?
Creating accessors for a variable that should not be accessed externally
is bad practice IMHO.
Levente
>
> As it is, the unthinking use of getter/setters is like handing sweating C programmers a syringe loaded with BadCodium and assuring them it feels great.
>
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Drugs may lead to nowhere, but at least it's the scenic route.
More information about the Squeak-dev
mailing list
|