On 06/06/2011, at 3:51 PM, Lazaridis Ilias wrote:
> So maybe all rarely used methods should be written in long  
> descriptive statements, to overcome non-semantic-hiding and become  
> more productive?

I thought you prided yourself on your ability to use reason?
Because the above is really an irrational statement, being
both a logical non-sequitur and unrelated to my argument.

> There's one simple fact:
> "if __FILE__ == $PROGRAM_NAME" is inconsistent with the language's  
> elegant OO design

I think that's entirely false.

If I was explaining the intent of my code to you, I'd say
"If we're running this file", or "if this is the file we're running".
These have the same semantic structure as the Ruby code
above... completely *unlike* the suggestion you make.

> And at this point, the "dispute" is about the method name.

No, it isn't. It's about how to make Ruby easier to read.

> Which method name would you choose, if you had two choices (.main?  
> | .executed?) ?

Neither. The meaning that is intended cannot be expressed using the
natural meaning of any single word. If the method was implemented,
I'd still write it out long-hand.

I want to minimise the *cognitive load* on people who read my code.

Clifford Heath.