[squeak-dev] Balance of metrics

tim Rowledge tim at rowledge.org
Mon Mar 12 19:55:44 UTC 2018



> On 12-03-2018, at 12:42 PM, Tobias Pape <Das.Linux at gmx.de> wrote:
> 
> 
>> On 12.03.2018, at 20:26, tim Rowledge <tim at rowledge.org> wrote:
>> 
>> Personally I'd be more inclined to go for "methods are private unless explicitly set to public" as a way to aggressively make people think about what they're doing!
> 
> welcome to java world, where everyone is making everything final, because, why yes, nobody should use that but my code!

I'm a long way from a java expert, having taken a look at it in the late 90's and reeled in horror, but I thought 'final' was a way to say that no subclass can be made, or no subclass can over-ride a method? Is it used for runtime privacy?

> I've been bitten by that, and I've always appreciate the kind of responsibility that Smalltalk gives to the client of objects: "you send that message, you're gonna be responsible for it".

My problem here is that people just don't seem to take that responsibility often enough.

> Where was I? Oh yeah, the safety argument.
> There's a German road security specialist who says, the way to make driving the safest is to put a point stick right on the driving wheel so that should you brake too hard, it'll puncture your skull. That way, nobody would ever dare to drive too fast or dangerously. Casualties  would certainly drop, considering everything.
> [side note]
> No, I'm not making this up
> [/side note]

That's a very old joke indeed, along with "What's the most dangerous part of a car? The nut that holds the steering wheel"

> The other method he suggests is better education and better awareness, combined with better helpers (viz. tools)
> 
> I'd rather have the latter, in Smalltalk, than a pointy stick. :)

Yes indeed but see my previous point.
>> 
>> 

>> And while I'm being all dictatorial, I really hate to see code like
>> 
>> self foo bim baz wibble at: weeble state count + 1
>> 
>> ie chains of accessors that imply far too much knowledge of the type of what you get returned. Should be more like
>> 
>> self wibbleStateAt: weeble nextState
>> 
>> with suitable delegations though whatever foo is, and its baz, and its wibble, and so on.
> 
> Clearly, Law of Demeter! We teach that our students every year in quite some detail with quite some emphasis.

Good to hear. It needs applying massively in the image.  :-(

> 
> But I think both points are orthogonal here. :)

Maintaining orthogonality is important. Save the orthogones!


>> 
>> Strange OpCodes: FA: Failsafe Armed
> 
> HCF!

If you have NetFlix and you are lucky you might be able to watch the really rather fun series called Halt and Catch Fire. It's one of those historidramas that is completely not how it happened and yet completely true to what happened. I loved it. PARC and Smalltalk even get a mention!


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
The colder the X-ray table, the more of your body is required on it.




More information about the Squeak-dev mailing list