[squeak-dev] Shadows (was: The Trunk: Morphic-eem.1742.mcz)

Marcel Taeumel marcel.taeumel at hpi.de
Fri Apr 16 11:50:24 UTC 2021


Hi all!

Hehe. "shadows + morphic" got me distracted. ^__^

Hmm... personally, I prefer "owner" over "anOwner" as block variable. That is, I don't care about shadowing the instVar name -- just locally focused readability. That is, I am a fan of accessors and thus rarely (? never ?) bitten by confusing instVar access and tempVar access. :-) For classes with longer methods and extensive instVar access (...Compiler?), shadowing can be an issue for code readability, though.

> In a larger context, I would strongly opt for (finally) introducing a
> mechanism for linter/compiler annotations in CodeHolders. Most modern
> editors and IDEs have it, even Pharo; if Squeak does not want to get left
> behind, we should support something like this, too. It could or should be
> configurable, of course.


How come? While structured information is nice, I am opposed to introducing more things that are prone to errors. :-) What would you expect me to annotate in such a case? Marking intentional shadowing? I wouldn't want to. ;-) Tool-specific configuration/annotation -- yes, linter and compiler are tools -- should not interfere with an artifact's primary representation. For example, it's problematic that there is only a single #inspectorClass or #explorerContents per domain object. That does not scale; it can also obfuscate the object's interface. In a similar manner, if one would start to "enrich" source code with various annotations for all kinds of supported compilers/parsers/linters etc. ... nah. 

There are already pragmas, which can be used to annotate methods. Sub-method annotation might be beneficial in not-too-frequent situations ... thus, maybe not worth the effort.

Best,
Marcel
Am 12.04.2021 21:32:34 schrieb Christoph Thiede <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi Eliot,

I fear that changes like this will not be very durable unless tested in any
way. At the moment, you won't even notice a new shadow unless you have
opened a Transcript by accident when accepting a method. Should we maybe
show a message window for shadows instead when compiled interactively,
analogously to the warnings about superfluous temps?

(In a larger context, I would strongly opt for (finally) introducing a
mechanism for linter/compiler annotations in CodeHolders. Most modern
editors and IDEs have it, even Pharo; if Squeak does not want to get left
behind, we should support something like this, too. It could or should be
configurable, of course.)

LBNL, if I understand Chris correctly, "anOwner" might be a suboptimal name
for a variable that holds Morph instances, right? :)

Best,
Christoph



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210416/936a9121/attachment.html>


More information about the Squeak-dev mailing list