![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Expert Programmer
|
Re: im new to the language
An example is if you need to read a lot of information from files in C#, then the program will run extremely slow. but if it's just running without needing info from external sources, it run's pretty smooth.
__________________
|
|
|
|
|
|
#12 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 198
Rep Power: 1
![]() |
Re: im new to the language
Thanks guys, that was a good eye opener.
So I guess the same program could probably be written in either of these languages [C++, C#], without significant loss of performance, where the language is subjective to the environment it will be programmed for. >BstrucT
__________________
Be kinder than necessary because everyone you meet is fighting some kind of battle. |
|
|
|
|
|
#13 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 769
Rep Power: 3
![]() |
Re: im new to the language
Again, depends on the program. You'll find few 3D game engines in managed languages because of the performance difference (especially for something specialized like that). But a lot of programs can be done either way, with little difference for the end user.
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#14 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 198
Rep Power: 1
![]() |
Re: im new to the language
Thanks for explaining Jimbo, it makes perfect sense to me now. :-)
__________________
Be kinder than necessary because everyone you meet is fighting some kind of battle. |
|
|
|
|
|
#15 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,120
Rep Power: 5
![]() |
Re: im new to the language
To expand on what Jimbo said, generally this translation from byte code to machine code generally happens when you first run the program (or when a particular method is first called). The runtime system will cache the translated code so it doesn't need to redo its work. If a method is only called one time, or a few times, it won't contribute enough to the running time of a non-trivial program to be worth mentioning, and if it's called a lot, the overhead will be amortized over many calls. Either way, the performance hit is generally a lot less than you'd expect.
Another benefit is that when you write native code, and you want to tune it for maximum performance, you need to use optimizations specific to the processor. When writing managed code, the runtime engine can be designed so as to conditionally optimize, without the developer needing to distribute multiple versions of their program, or settle for a less-than-optimal build. In other words, sometimes it's actually advantageous to defer the native code generation. Where managed code really gets hammered, though, is when it has to cross the managed/unmanaged boundary. If you've got a lot of this in your code, it's a good idea to minimize it. For example, rather than reading a file in small pieces, read as much as you can in each go by using larger buffers. This means less calls to the underlying OS's API, and thus less overhead from thunking down to native code. This is a primary reason that certain demanding applications tend not to be written in managed code, such as fancy 3D games (though managed support for this kind of thing is improving daily). Back to the OP's question: you can use it for pretty much anything, with the possible exception of really low-level stuff. Even then, it's usually not impossible, just cumbersome. For regular application development, C# is a great language, and offers portability in a similar manner to Java (though perhaps not as extensive). Still, I vastly prefer C# over Java, for numerous reasons. I'd list them, but I'm tired and that's a big can of worms.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#16 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 198
Rep Power: 1
![]() |
Re: im new to the language
Thanks for the additional information lectricpharaoh, nice to know how big a part cache can play in it.
Never realized how important it can be, thanks for the heads up man, and the tips.
__________________
Be kinder than necessary because everyone you meet is fighting some kind of battle. |
|
|
|
|
|
#17 |
|
Programming Guru
![]() ![]() ![]() |
Re: im new to the language
teishu speaks the truth... how many of us are really developing applications where fractions of a second matter? Hardware has progressed from the decades ago when speed of software mattered. Obviously, if you wanted it ultra fast... you wouldn't be coding in C, C++, C# or Java... you'd be doing it in Assembly.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If you had it to do all over again, which language? | peace_of_mind | Coder's Corner Lounge | 24 | Jan 13th, 2008 6:06 PM |
| The C programming Language (2nd Edition) | nnxion | Book Reviews | 10 | Jul 6th, 2007 4:29 PM |
| Assembly Language | DaWei | Coder's Corner Lounge | 0 | Apr 26th, 2007 11:15 PM |
| Language creation/extending | gryfang | Project Ideas | 43 | Jul 20th, 2006 2:42 PM |
| Language display in program | Prm753 | C++ | 3 | May 30th, 2006 6:45 PM |