| | |
Is c # slower than c/c++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Is c # slower than c ++? Actually I am a little familiar with c and java ... now I am in a mood to learn c #. Is it better than c and java?
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 8
hi everyone,
From what i gather from other websites about C# is that it slower than
c/c++ because it uses a runtime and sdk to intrepret its codings just like java.
C# is actually a cross between vb and c++ but it is not as mature as java which has been around for a long time. C# is also not platform dependent at the moment and c# was actually created to counter the popularity of java.
But the slowness is hardly noticable if you running single threads but if you are running multiple threads then the slowness is actually quite noticable.
If you are using win 2000 and above you can try downloading sharpdevelop
or mono develop. Both are under the gpl.
For myself i actually like to do bare bones programming
Yours Sincerely
Richard West
From what i gather from other websites about C# is that it slower than
c/c++ because it uses a runtime and sdk to intrepret its codings just like java.
C# is actually a cross between vb and c++ but it is not as mature as java which has been around for a long time. C# is also not platform dependent at the moment and c# was actually created to counter the popularity of java.
But the slowness is hardly noticable if you running single threads but if you are running multiple threads then the slowness is actually quite noticable.
If you are using win 2000 and above you can try downloading sharpdevelop
or mono develop. Both are under the gpl.
For myself i actually like to do bare bones programming
Yours Sincerely
Richard West
Playing devil's advocate for a moment....
You asked first if C# was FASTER, but then you asked "Is it better than c and java?"
So, I suppose the age old question is, better for WHAT? C# is designed to more easily deal with COM objects than C++, and so if you are doing a project with a bunch of COM objects you could argue that C# is better than C++.
Speed of execution, as you know, only matters in certain very small instances. Like, you are doing some tight loop calculation over and over. For example, rendering ray tracing. But even then, you could write small parts of your program in some fast language and the rest (the bulk) in a language that is 'better' in some other direction. For most apps, by the time the app is released, machines will have doubled in speed anyway, so every effort-hour you spend on making that old 500MHZ Pentium run faster is totally wasted when the 4GHZ pentiums are available!
For me, what makes a language 'better' or 'worse' are issues like:
1) What kind of app am I building? A test app? Something for customers?
2) How hard is it to learn and read; can I read someone else's code pretty easily?
3) How quickly can I build the app? I.e. assembler is great but would take a LONG time.
4) How likely is it to catch my errors for me? i.e. compiler-time warnings/errors vs runtime warnings/errors vs not catching them at all. Generally, run-time binding leads to run-time errors that compile-time binding catches at compile time. So if you are building something for customers, I generally lean towards compile-time binding. That's not always realistic, but every error of mine that the compiler catches is better than the customer seeing error dialogs about my errors!
5) What is everyone else using? For personal use, that doesn't matter (heck, I still like Snobol IV!), but if you are in Rome, do as the Romans. If your company has a lot of Java engineers, you better have a darn good reason to switch to C# or C++!
So, I appreciate the 'speed at any cost' argument, but that's what assemblers are for! Even when programming in C++, you may find that rare but occasional need to drop into assembler (I love the inline assembler!), just as when programming in Java there are somethings you call out and let some other piece of code do.
My advice: Learn C# and know it so you can make an informed decision on whether to use it for any particular application or not. Just as a carpenter knows about all kinds of tools but uses 10% of them daily, so too should you know many more languages than you use.
Then you and I can speak fondly of Snobol IV and lament its lack of general use.
Good luck! Dare to Dream!
You asked first if C# was FASTER, but then you asked "Is it better than c and java?"
So, I suppose the age old question is, better for WHAT? C# is designed to more easily deal with COM objects than C++, and so if you are doing a project with a bunch of COM objects you could argue that C# is better than C++.
Speed of execution, as you know, only matters in certain very small instances. Like, you are doing some tight loop calculation over and over. For example, rendering ray tracing. But even then, you could write small parts of your program in some fast language and the rest (the bulk) in a language that is 'better' in some other direction. For most apps, by the time the app is released, machines will have doubled in speed anyway, so every effort-hour you spend on making that old 500MHZ Pentium run faster is totally wasted when the 4GHZ pentiums are available!
For me, what makes a language 'better' or 'worse' are issues like:
1) What kind of app am I building? A test app? Something for customers?
2) How hard is it to learn and read; can I read someone else's code pretty easily?
3) How quickly can I build the app? I.e. assembler is great but would take a LONG time.
4) How likely is it to catch my errors for me? i.e. compiler-time warnings/errors vs runtime warnings/errors vs not catching them at all. Generally, run-time binding leads to run-time errors that compile-time binding catches at compile time. So if you are building something for customers, I generally lean towards compile-time binding. That's not always realistic, but every error of mine that the compiler catches is better than the customer seeing error dialogs about my errors!
5) What is everyone else using? For personal use, that doesn't matter (heck, I still like Snobol IV!), but if you are in Rome, do as the Romans. If your company has a lot of Java engineers, you better have a darn good reason to switch to C# or C++!
So, I appreciate the 'speed at any cost' argument, but that's what assemblers are for! Even when programming in C++, you may find that rare but occasional need to drop into assembler (I love the inline assembler!), just as when programming in Java there are somethings you call out and let some other piece of code do.
My advice: Learn C# and know it so you can make an informed decision on whether to use it for any particular application or not. Just as a carpenter knows about all kinds of tools but uses 10% of them daily, so too should you know many more languages than you use.
Then you and I can speak fondly of Snobol IV and lament its lack of general use.
Good luck! Dare to Dream!
![]() |
Similar Threads
- Dell Latitude D500 Laptop slower than a snail (IT Professionals' Lounge)
- DSL slower than dialup... dialup slower than DSL slower than dialup! (Windows NT / 2000 / XP)
- Router is slower than adapter (Network Security)
- cable got slower over a couple of days (Networking Hardware Configuration)
- much slower pc after format (Windows NT / 2000 / XP)
- Hard Disk Performance Is Slower Than You Expect (Windows tips 'n' tweaks)
- win98se - explorer getting slower & slower (Web Browsers)
Other Threads in the C++ Forum
- Previous Thread: sorting stl::map
- Next Thread: c++ nesting loops
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






