

C# versus C++ performance - swah
http://stackoverflow.com/questions/4257659/c-sharp-versus-c-performance/19505716#19505716

======
comex
Not to be ad hominem, but why do these posts advocating garbage collected
languages keep making exaggerated claims?

F# certainly is capable of expressing code more succinctly than C++, but 6,000
versus 1,000,000 lines is far beyond what that difference could account for;
the code could presumably have been rewritten in much less C++ as well. Nor,
in all likelihood, would it "have taken man-decades of work by real experts
and cost millions of pounds" to get "better performance"; quite possibly it
would to get to near-optimal performance, but compared to F#, it would
probably be relatively easy for a skilled C++ developer (and the author does
seem to be a skilled F# developer) to get _better_ performance.

shared_ptr has issues, and in many respects is significantly inferior to a
real garbage counter, but the post downplays the extent to which idiomatic C++
code avoids use of shared_ptr in most circumstances. You can write Java in any
language...

The claim that scope-based reference counting can keep garbage around for
longer than necessary is strictly true but seems absurd to argue with, as the
time between end-of-use and end-of-scope is usually rather short. The linked
post ([http://flyingfrogblog.blogspot.com/2013/10/memory-
management...](http://flyingfrogblog.blogspot.com/2013/10/memory-management-
myths-promptness.html)) attempts to illustrate this, but uses a completely
illogical/pathological example.

~~~
swah
I agree with you, maybe Jon Skeet (the top user on StackOverflow and a
googler, IIRC) exagerated - he didn't even use Lisp :)

------
tcbawo
In a trading environment, the question of C# vs C++ is probably moot. The low
latency trading languages of the future will probably be Verilog and VHDL.

~~~
officialjunk
FPGA's and ASIC's are the only context I know for verilog and VHDL. Do you
mean hardware solutions?

~~~
tcbawo
Yes. Trading is: first a network game, second a hardware game, third a math
game, fourth a software game.

