[Vm-dev] Fwd: Merging FilesAttributesPlugin

Jakob Reschke forums.jakob at resfarm.de
Wed Jan 3 18:52:09 UTC 2018


2018-01-03 19:04 GMT+01:00 Eliot Miranda <eliot.miranda at gmail.com>:
> On Tue, Jan 2, 2018 at 2:42 AM, Alistair Grant <akgrant0710 at gmail.com> wrote:
>> On 2 January 2018 at 06:46, Jakob Reschke <forums.jakob at resfarm.de> wrote
>> > Am 02.01.2018 04:43 schrieb "Eliot Miranda" <eliot.miranda at gmail.com>:
>> >
>> >  ... inst vars such as sCOFfn are set up in initialiseModule.  You're querying the SecurityPlugin on every access as in
>> >
>> > canStatFilePath: aPathCString length: length
>> > ...
>> > (hasSecurityPlugin = 0) ifTrue: [^ true].
>> > sCOFfn := interpreterProxy ioLoadFunction: 'secCanOpenFileOfSizeWritable' From: 'SecurityPlugin'.
>> > sCOFfn ~= 0
>> > ...
>> >
>> > I have never looked at this before, so: can this variable name be spelled out, please, so it becomes legible for the uninitiated folk?
>>
>> I've made this change in my image, so it will flow through on the next update.
>
> I don't think it's necessary.  The long vars are unwieldy and I'm sure Jakob understands the convention now.
>

Actually I did figure this out myself, but nevertheless I think it
unnecessarily complicates reading the code when things are
abbreviated. Even if you already know/knew what it stands for. In the
case of "sCOF", I would probably have to look the meaning up again
every time I return to that code after a few months, if I were to do
that.

Sure, this is a matter of style preferences, but I consider it
suboptimal if you have to think harder to understand something when it
could also have been made clear and easy at writing time (without
sacrificing functionality and performance too much, of course). Please
spare the newcomer readers some "wtf" moments if you can. ;-)
Especially for things like inst vars, whose initialization (and
explanation) may be far away from their usage.

Kind regards,
Jakob


More information about the Vm-dev mailing list