| Thread overview |
|---|
May 28, 2002 language features | ||||
|---|---|---|---|---|
| ||||
Hey,
A quick question. I like C#'s implementation of reflection. Does D do reflection?
Also, Does D do variable parameters? C# has a good convention for variable parameters using the params keyword like this:
void Print(params string stuffToPrint[])
{
foreach(oneThing in stuffToPrint) System.Console.WriteLn(oneThing);
}
Then you would call it like this:
Print("Printing ", "variable ", "parameters");
I know it seems like I'm bragging on C#, but I'm not really. I would never use it since I do a lot of scientific applications that are too computationally intensive for an interpreted language. C# is too slow. I've used it. I do think that C# has beautiful syntax, though.
Thanks,
Craig
| ||||
May 31, 2002 Re: language features | ||||
|---|---|---|---|---|
| ||||
Posted in reply to cblack01 | "cblack01" <cblack01@cox.net> wrote in message news:ad0t37$a9c$1@digitaldaemon.com... > I know it seems like I'm bragging on C#, but I'm not really. I would never > use it since I do a lot of scientific applications that are too computationally intensive for an interpreted language. People keep bring this up and it's un-true. Although C# can be interpreted but many versions can also compile code with the same or better efficiency then C++. | |||
June 01, 2002 Re: language features | ||||
|---|---|---|---|---|
| ||||
Posted in reply to anderson | > > I know it seems like I'm bragging on C#, but I'm not really. I would
> never
> > use it since I do a lot of scientific applications that are too computationally intensive for an interpreted language.
>
> People keep bring this up and it's un-true. Although C# can be interpreted but many versions can also compile code with the same or better efficiency then C++.
>
C# does NOT compile down to binary code. It uses a JIT and it is very slow. I know. I've done the benchmarking myself. I tested it to be about 5 times slower than native C++ with simple object-oriented test programs. I suspect it would be even slower for more complex projects. The only way C# performs comparably well is with non-object-oriented simple monolithic programs, like a simple for loop. Then C# has good performance. Don't trust benchmarks that say, "C# is as fast as C++", or even "C# is only twice as slow as C++". This is just not true. Word to your momma.
Perhaps one day there will be a native code compiler for C# but I suspect not in the near future.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply