•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 455,964 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,630 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2065 | Replies: 4
![]() |
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: 604
Reputation:
Rep Power: 6
Solved Threads: 6
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
•
•
Join Date: Jun 2004
Location: Marin, CA, USA
Posts: 434
Reputation:
Rep Power: 5
Solved Threads: 10
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!
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Dell Latitude D500 Laptop slower than a snail (Techies' Lounge)
- DSL slower than dialup... dialup slower than DSL slower than dialup! (Windows NT / 2000 / XP / 2003)
- 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 / 2003)
- 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



Linear Mode