Re: static class inheritance, generalized
- From: "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx>
- Date: Fri, 08 Jun 2007 02:00:58 -0700
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
.
- Follow-Ups:
- Re: static class inheritance, generalized
- From: Frans Bouma [C# MVP]
- Re: static class inheritance, generalized
- From: Ben Voigt [C++ MVP]
- Re: static class inheritance, generalized
- References:
- static class inheritance, generalized
- From: Ben Voigt [C++ MVP]
- Re: static class inheritance, generalized
- From: Frans Bouma [C# MVP]
- Re: static class inheritance, generalized
- From: Christof Nordiek
- Re: static class inheritance, generalized
- From: Frans Bouma [C# MVP]
- Re: static class inheritance, generalized
- From: Ben Voigt [C++ MVP]
- Re: static class inheritance, generalized
- From: Frans Bouma [C# MVP]
- static class inheritance, generalized
- Prev by Date: Re: C#) How to keep drawing graphics by GDI
- Next by Date: Re: static class inheritance, generalized
- Previous by thread: Re: static class inheritance, generalized
- Next by thread: Re: static class inheritance, generalized
- Index(es):
Relevant Pages
|