Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualIcebone1000

Posted 02 August 2012 - 07:59 AM

C++ is very fast when used by a computer-science expert, who's aware of pointer-aliasing, cache-line-aliasing, pre-caching, data layout trade-offs, balancing algorithmic complexity with hardware realities, etc...

When used by a beginner, C++ is not only slow, but also very dangerous -- with programs seeming to work properly, but actually leaking resources and corrupting their own memory, causing bugs that a beginner has no chance of finding.

C# is much friendlier to beginners, and it's "performance penalties" aren't really that bad when you're not capable of writing expertly performant C++ code anyway.


Your talent as a computer scientist has a much bigger impact on performance than whether you're using native vs JIT/managed binaries.

Also, N.B. the tools that C++ gives you to generate blindingly fast code also do exist in modern revisions of C# (e.g. fixed memory, explicit data layouts, raw pointers, unsafe native code), it's just that they're generally not used by default because they lead to the same issues that make C++ a dangerous language.


Kind off topic..But this interest me a bit..
When you say beginner, looks like you talking about a beginner programmer, but to me, and correct me if Im wrong, you can master C#/java/whatever, but the only way to became a "no beginner" in C++, is programming in C++... do you agree with this sentence?

I mean, c# and java will teach you OOP much faster than C++ in my opinion, but the only way to learn the stuff that makes C++ powerfull(the ones you mention as being computer-science expert skills), is coding on C++.. Since other languages abstract out all of that stuff..

When I started programming in C# in the beginning of this year I realized how ridiculous hard C++ is, ive been programming only in C++ since I started to learn programming, the difference in productivity is scary.

#1Icebone1000

Posted 02 August 2012 - 07:57 AM

C++ is very fast when used by a computer-science expert, who's aware of pointer-aliasing, cache-line-aliasing, pre-caching, data layout trade-offs, balancing algorithmic complexity with hardware realities, etc...

When used by a beginner, C++ is not only slow, but also very dangerous -- with programs seeming to work properly, but actually leaking resources and corrupting their own memory, causing bugs that a beginner has no chance of finding.

C# is much friendlier to beginners, and it's "performance penalties" aren't really that bad when you're not capable of writing expertly performant C++ code anyway.


Your talent as a computer scientist has a much bigger impact on performance than whether you're using native vs JIT/managed binaries.

Also, N.B. the tools that C++ gives you to generate blindingly fast code also do exist in modern revisions of C# (e.g. fixed memory, explicit data layouts, raw pointers, unsafe native code), it's just that they're generally not used by default because they lead to the same issues that make C++ a dangerous language.


Kind off topic..But this interest me a bit..
When you say beginner, looks like you talking about a beginner programmer, but to me, and correct me if Im wrong, you can master c#/java/whatever, but the only way to became a "no beginner" in c++, is programming in c++... do you agree with this sentence?

I mean, c# and java will teach you OOP much faster than c++ in my opinion, but the only way to learn the stuff that makes c++ powerfull(the ones you mention as being computer-science expert skills), is coding on c++.. Since other languages abstract out all of that stuff..

When I started programming in C# in the beginning of this year I realized how ridiculous hard C++ is, ive been programming only in c++ since I started to learn programming, the difference in productivity is scary.

PARTNERS