|
« Reply #28 on: April 27, 2008, 04:27:43 pm »
|
|
'nother question, now about java: Is it good for anything other than web-stuff? I know that(GASP)Runescape(bah, stupid, but its the only good example i know of)is all just a huge java thing, so is that all its good for, or can it be made to run without a browser?
Java can be as powerful as C++. I remember that one of the Unreal games a few years ago was reprogrammed(I don't know if they re-released it this way) into Java. I only saw a snipet in PC Mag (I think) where they got 30fps running at the 1200 ish resolution. It all depends on how much effort you put into it and how good your brain is at theorizing code and such to put to practice.
Java may be as 'powerful' in terms of what you can do with the language, but never as powerful as in how it's run. Java is run though a virtual machine, and by its very nature going to be slower than C++, which is actually compiled and run as machine code.
True, but there are compilers that can make it far more efficient. For example you can HotSpot compile your programs, which works similar to how the .NET runtime works, compiling the programs byte code to machine code on its first run.
Yes, this makes it faster, but only so fast. By principal, it's still not going to run as fast as C or C++.
In terms of startup time, no it will never be as fast. But in terms of runtime, if its JIT compiled there is no logical reason why it should be slower as its no longer running on a VM, but directly on the hardware (ignoring the OS's abstraction layer) in machine code.
It's the difference between managed and unmanaged. Managed code is gonna be running extra code on top of yours. (Managed C++ is gonna have the same issues as C#, etc.)
Yes that true, but the preformance hit with managed code is minimal, and compared to the productivity you gain I think its something that can usually be more or less ignored. I've used manage code for quite a while, and in some occassions I've actually been able to write things that run faster than in unmanaged C++. Simple put different languages have different pros & cons, it really depends on what you intend to use it for, it unfair to simply label a language as good or bad based on speed.
Files? Then why do they have close file buffer methods in languages. I understand pointers though.
Ok, the main difference you will notice in managed languages in the garbage collector running in the background, the main benefit of this is not having to manually allocate and deallocate memory, prevent memory leaks. The reason streams in managed languages usually have close methods is simply so you can be explicitly sure when the file is closed, with the garbage collector it may or may not be disposed of when you want. For example you don't want to write data into a file and then send it to another application to modify, while the file is still locked to your program because the GC hasen't closed it yet.
This is fun, been a while since there was any coding topic here worth debating.
Aye. Personally, I use C# for doing any kind of tool or editor that I want to create quickly. I absolutely love 'Rapid Application Development'. But C# just doesn't compare to C++, or C in terms of gritty low level access. I've never used pointers in C#, and never will. I don't need to declare my code 'unsafe'. Interesting thought though, someone going from a garbage collected language to one that's not, seems to be very difficult for most. Often, I've seen "What do you mean I have to call delete/free?" In the way I was taught to code, I was always shown how to properly manage my memory. (I still love some of the badass recursive funcs that I've used to clean up crazy data structures.) So I tend to giggle when I see someone create a new char array, and forget to delete it 6 lines later when they're done with it!
Logged
|
|