Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 5th, 2008, 7:41 PM   #11
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 579
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Re: im new to the language

Quote:
Originally Posted by Jimbo View Post
However, you may be able to notice speed differences in programs which do long stretches of computations, as both applications will be churning through a workload, in which case you have the interpreting mess mentioned above.
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.
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old Jun 5th, 2008, 11:54 PM   #12
BstrucT
Hobbyist Programmer
 
BstrucT's Avatar
 
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 175
Rep Power: 1 BstrucT is on a distinguished road
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
__________________
The more the human race tries to change everything, when not needed, the less will they be able to change themselves when they need to.
BstrucT is offline   Reply With Quote
Old Jun 6th, 2008, 12:14 AM   #13
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
Re: im new to the language

Quote:
Originally Posted by BstrucT View Post
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.
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>
Jimbo is offline   Reply With Quote
Old Jun 6th, 2008, 1:29 AM   #14
BstrucT
Hobbyist Programmer
 
BstrucT's Avatar
 
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 175
Rep Power: 1 BstrucT is on a distinguished road
Re: im new to the language

Thanks for explaining Jimbo, it makes perfect sense to me now. :-)
__________________
The more the human race tries to change everything, when not needed, the less will they be able to change themselves when they need to.
BstrucT is offline   Reply With Quote
Old Jun 6th, 2008, 10:11 AM   #15
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,009
Rep Power: 5 lectricpharaoh will become famous soon enough
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
lectricpharaoh is offline   Reply With Quote
Old Jun 9th, 2008, 2:06 AM   #16
BstrucT
Hobbyist Programmer
 
BstrucT's Avatar
 
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 175
Rep Power: 1 BstrucT is on a distinguished road
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.
__________________
The more the human race tries to change everything, when not needed, the less will they be able to change themselves when they need to.
BstrucT is offline   Reply With Quote
Old Jun 10th, 2008, 9:51 AM   #17
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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 5:06 PM
The C programming Language (2nd Edition) nnxion Book Reviews 10 Jul 6th, 2007 3:29 PM
Assembly Language DaWei Coder's Corner Lounge 0 Apr 26th, 2007 10:15 PM
Language creation/extending gryfang Project Ideas 43 Jul 20th, 2006 1:42 PM
Language display in program Prm753 C++ 3 May 30th, 2006 5:45 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC