Re: 'with' statement
- From: "Michael A. Covington" <look@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 1 May 2007 22:34:49 -0400
"Peter Bromberg [C# MVP]" <pbromberg@xxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:D2C6048B-431E-4141-B215-62D31F5C3B90@xxxxxxxxxxxxxxxx
I've seen this particular question come up at least 4 or 5 times in the
last
year or so, and I have to agree. "With xyz ".... is simplyunnecessary in a
concise and elegant language like C#. Hard core classic VB programmers who
are resistant to change are usually the ones who harp on this (among other
silly issues).
Peter
What I'd much rather have is a concise notation for mathematics.
Programming as we know it originated with Fortran (Formula Translation),
which allowed you to write such things as:
Y = SIN(X)**2 + COS(Z)**2
In C#, if I'm not mistaken, we're now stuck with
y = Math.Pow(Math.Sin(x),2) + Math.Pow(Math.Sin(z),2)
which is a great deal farther from normal mathematical notation. I know
it's nice and object-oriented, but something valuable has been lost.
It could have been worse. They could have given us:
Object.Assign(ref y,
Math.Add(Math.Pow(Math.Sin(x),2),Math.Pow(Math.Sin(z),2)));
If + has special status as a math operator, then why not ** and the Math
functions?
.
- Follow-Ups:
- Re: 'with' statement
- From: Jon Skeet [C# MVP]
- Re: 'with' statement
- References:
- Re: 'with' statement
- From: Mark Rae
- Re: 'with' statement
- Prev by Date: Re: OT: "scaffolding" ?
- Next by Date: default button gray color
- Previous by thread: Re: 'with' statement
- Next by thread: Re: 'with' statement
- Index(es):
Loading