When we create a missing method in debugger - why does it end with a dot?
I am looking at porting my missing class creation code into Pharo 7, and I notice there is a DynamicMessageImplementor that does this for methods - but Iâm wondering why when we create a missing method with âself souldBeImplemented.â with a trailing â.â? The Smalltalk style guide normally says the last statement shouldnât have a dot - and I notice some recent cleanups removed some dots on methods (presumably the formatter). This is a bit of a special case as the intent is to replace that method - but shouldnât we create without the dot to set a good example anyway? If so, I can include that change in my pr. Tim
On 30 Aug 2018, at 06:36, Tim Mackinnon <tim@testit.works> wrote:
I am looking at porting my missing class creation code into Pharo 7, and I notice there is a DynamicMessageImplementor that does this for methods - but Iâm wondering why when we create a missing method with âself souldBeImplemented.â with a trailing â.â?
The Smalltalk style guide normally says the last statement shouldnât have a dot - and I notice some recent cleanups removed some dots on methods (presumably the formatter).
This is a bit of a special case as the intent is to replace that method - but shouldnât we create without the dot to set a good example anyway?
If so, I can include that change in my pr.
I think there are both schools around⦠with some preference of no . at the end. Sometimes I think that a system that would have a good pretty printer and *always* pretty print would be nice: you would configure this once, and all code would be shown in your âbest readableâ style⦠Marcus
Agreed, Marcus. In case of the trailing dot it is not only about beauty, however. Most people who favor the dot think about the poor developer who comes after them and needs to append new statements to existing methods. Some people would say: whatâs the deal here? The deal is that syntax highlighters and autoconpleters tend to fail for the new statements, and most certainly your method change will not compile just because of that missing dot. Again: oust a few seconds to understand whatâs wrong, easy to fix and no big deal. But it costs brain capacity that could be spent better. Not sure a âvirtual dotâ visually added by a pretty printer would help here. Iâm afraid it would make things worse, unless it is intelligent enough to know when to âmaterializeâ that virtual dot (I.e. add it to the method whenever somebody writes code after the last statement. Joachim ...ainât it funny this little dot is back in discussions decades after it was fought over and cost lives back in the 90ies? Seems weâre not over it yet
Am 30.08.2018 um 09:59 schrieb Marcus Denker <marcus.denker@inria.fr>:
On 30 Aug 2018, at 06:36, Tim Mackinnon <tim@testit.works> wrote:
I am looking at porting my missing class creation code into Pharo 7, and I notice there is a DynamicMessageImplementor that does this for methods - but Iâm wondering why when we create a missing method with âself souldBeImplemented.â with a trailing â.â?
The Smalltalk style guide normally says the last statement shouldnât have a dot - and I notice some recent cleanups removed some dots on methods (presumably the formatter).
This is a bit of a special case as the intent is to replace that method - but shouldnât we create without the dot to set a good example anyway?
If so, I can include that change in my pr.
I think there are both schools around⦠with some preference of no . at the end.
Sometimes I think that a system that would have a good pretty printer and *always* pretty print would be nice: you would configure this once, and all code would be shown in your âbest readableâ styleâ¦
Marcus
participants (3)
-
Joachim Tuchel -
Marcus Denker -
Tim Mackinnon