Re: static class inheritance, generalized



On Jun 8, 9:37 am, "Frans Bouma [C# MVP]"
<perseus.usenetNOS...@xxxxxxxxx> wrote:

<snip>

So, because that set of using statements makes it already less clear,
you're perfectly OK with making it VERY unclear for the reader with
further scope increases?

double d = Sqrt(foo);

where does 'Sqrt(foo)' live? I have NO idea.

Do you *really* have no idea, in real life rather than in theory?
Would you not *guess* that it was in System.Math, given no other
information, and considering the context?

Sure, with fancy tooling
I might find the place where this is. But reliance on tooling to READ
and UNDERSTAND code is IMHO a slippery slope I at least don't want to
be on. Code should be understandable and clear for the reader who reads
it. ANY degration to that is IMHO bad. Sure your suggestion might save
a few keystrokes, but it also introduces degration of the clarity of
code written. I simply fail to understand how you can ignore that fact.

We apparently view clarity differently. If I'm working on something
which I know from the context uses trigonometry, then formulae which
just have things like:

double x = Pow(Sin(alpha)+Cos(theta), 2);

have more clarity for me than formulae such as:

double x = Math.Pow(Math.Sin(alpha)+Math.Cos(theta), 2);

Have you read much C# code that requires extensive use of System.Math?
It's horrible currently, and would *greatly* benefit from this. The
ambiguity due to the *possibility* of Cos/Sin/Pow etc is greatly
dwarfed by the *guaranteed* extra cruft of having to prefix everything
with "Math".

Jon

.



Relevant Pages

  • Re: static class inheritance, generalized
    ... information, and considering the context? ... Code should be understandable and clear for the reader who reads ... ANY degration to that is IMHO bad. ... We apparently view clarity differently. ...
    (microsoft.public.dotnet.languages.csharp)
  • [RFC PATCH 1/5] Priority Sifting Reader-Writer Lock v13
    ... Priority Sifting Reader-Writer Lock excludes reader execution ... Very frequent writers could starve reader threads. ... * slow path context lock. ...
    (Linux-Kernel)
  • Re: Shall I use the before an of phrase?
    ... for a reader. ... "Advanced neuroprosthetic systems must interact directly with remaining parts ... A guideline is when your object of "this" is in the same paragraph, ... a few sentences and context has not changed dramatically, ...
    (alt.usage.english)
  • Re: Yet more crypt cards
    ... > one message in the tree. ... that sounds like a big drawback to your reader. ... > It's how Google works. ... Or that the onus for digging out context should ...
    (rec.games.trading-cards.jyhad)
  • Re: Natural Disambiguation: A New Kind of Machine Translation
    ... I observe how a native reader disambiguates a word in context and show ... "fishing" suggests all fish-related concepts will be in that row. ...
    (sci.lang)