Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: 1 [2]   Go Down

Author Topic: C# or GM?  (Read 6276 times)

0 Members and 1 Guest are viewing this topic.
Re: C# or GM?
« Reply #20 on: April 26, 2008, 11:33:40 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
'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.
Logged
Re: C# or GM?
« Reply #21 on: April 26, 2008, 11:56:59 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 256
'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.)
Logged
  • My Myspace?
Re: C# or GM?
« Reply #22 on: April 27, 2008, 04:26:50 am »
  • Modrill made the avatar. I command you to like it.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1159
Wait- Managed and unmanaged code? What does that mean and how does it work? (Sorry for asking such newb questions, I just never heard about that... I'm expecting it to be something more advanced otherwise I'll feel like I really have been slacking off at school...)
Logged




My Brawl FC is 1289-8196-4511. Don't expect me to be on all the time though.
  • Super Smash Karts
Re: C# or GM?
« Reply #23 on: April 27, 2008, 04:28:55 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Managed code is, more or less, simply code that doesn't require you, the programmer, to implement garbage collection (meaning, you don't have to ensure that you free all pointers in memory, make sure you close every file, etc)
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: C# or GM?
« Reply #24 on: April 27, 2008, 06:36:02 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
Managed code is, more or less, simply code that doesn't require you, the programmer, to implement garbage collection (meaning, you don't have to ensure that you free all pointers in memory, make sure you close every file, etc)
Files? Then why do they have close file buffer methods in languages. I understand pointers though.
Logged
the a o d c
Re: C# or GM?
« Reply #25 on: April 27, 2008, 07:06:31 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
A lot of programs open files in streams, which, essentially, can boil down to similarities to pointers, and can jack things up if not managed correctly.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: C# or GM?
« Reply #26 on: April 27, 2008, 10:39:11 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
A lot of programs open files in streams, which, essentially, can boil down to similarities to pointers, and can jack things up if not managed correctly.
But I'm asking why there'd be methods to remove files but not pointers. Why are they not handled by the language itself like pointers?
Logged
the a o d c
Re: C# or GM?
« Reply #27 on: April 27, 2008, 12:50:19 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
'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.

Quote
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.
« Last Edit: April 27, 2008, 12:56:35 pm by Infini »
Logged
Re: C# or GM?
« Reply #28 on: April 27, 2008, 04:27:43 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 256
'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.

Quote
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
  • My Myspace?
Re: C# or GM?
« Reply #29 on: April 27, 2008, 07:30:30 pm »
  • Modrill made the avatar. I command you to like it.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1159
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.
Logged




My Brawl FC is 1289-8196-4511. Don't expect me to be on all the time though.
  • Super Smash Karts
Re: C# or GM?
« Reply #30 on: April 27, 2008, 08:29:01 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 256
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.
Logged
  • My Myspace?
Re: C# or GM?
« Reply #31 on: April 28, 2008, 04:07:28 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Well, they have some way of leaving the loop. My engine I'm working on works on a task system, so runs so long as they are active tasks around for it to run. This means the 'ultimate' while starts something like while( !m_taskList.empty() )
Logged
Re: C# or GM?
« Reply #32 on: April 28, 2008, 04:51:04 pm »
  • Modrill made the avatar. I command you to like it.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1159
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.

Yeah, I know that much (well, actually, just for when the game needs to the NPCs to move around without the player's input, I bet. Things like menus, I don't think should have to use an infinite loop). :P The thing is, since I don't have as much as experience with real programming languages, I don't know how to make it like in games... So my infinite loop would be something akin to a guy choking on a goldfish that can't go in or out of the guy's mouth (too dry and too much friction?). I WILL LEARN however! XD
Logged




My Brawl FC is 1289-8196-4511. Don't expect me to be on all the time though.
  • Super Smash Karts
Re: C# or GM?
« Reply #33 on: April 29, 2008, 05:27:57 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 256
Well, they have some way of leaving the loop. My engine I'm working on works on a task system, so runs so long as they are active tasks around for it to run. This means the 'ultimate' while starts something like while( !m_taskList.empty() )

Depends on the platform. All GBA dev I've done has had no way of leaving the loop. There's no point to, no operating system to get back to :)
Logged
  • My Myspace?
Re: C# or GM?
« Reply #34 on: April 30, 2008, 12:23:18 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.
or while (true). Java doesn't take 1 or 0 as a boolean =(.
Logged
the a o d c
Re: C# or GM?
« Reply #35 on: April 30, 2008, 12:32:19 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 256
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.
or while (true). Java doesn't take 1 or 0 as a boolean =(.

And 'true' isn't a keyword in C ;)
Logged
  • My Myspace?
Re: C# or GM?
« Reply #36 on: April 30, 2008, 01:10:48 am »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.
or while (true). Java doesn't take 1 or 0 as a boolean =(.

And 'true' isn't a keyword in C ;)

ohhh yes it is ;)
Logged



i love big weenies and i cannot lie
Re: C# or GM?
« Reply #37 on: April 30, 2008, 03:18:03 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 256
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.
or while (true). Java doesn't take 1 or 0 as a boolean =(.

And 'true' isn't a keyword in C ;)

ohhh yes it is ;)

Uh, what C standard are you using? No, it's not:

http://publications.gbdirect.co.uk/c_book/chapter2/keywords_and_identifiers.html
Logged
  • My Myspace?
Re: C# or GM?
« Reply #38 on: April 30, 2008, 06:12:29 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.
or while (true). Java doesn't take 1 or 0 as a boolean =(.

And 'true' isn't a keyword in C ;)

ohhh yes it is ;)

Uh, what C standard are you using? No, it's not:

http://publications.gbdirect.co.uk/c_book/chapter2/keywords_and_identifiers.html

Thank god for the preprocessor ^.^
Logged
Re: C# or GM?
« Reply #39 on: April 30, 2008, 05:46:24 pm »
  • Modrill made the avatar. I command you to like it.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1159
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!

Hmmm... I remember my Java programming professor telling us about stuff like that once. I don't remember too much, but I think it was he was teaching us about arrays, like how a variable is a spot in memory for one number while an array is like a jar that you can put stuff into... Man, I hated that array-expanding thing we had to do. XD But I hated loops even more. The number one lesson I learned: If you're going to loop, make EXTRA, EXTRA sure it WILL end.

You know any game ever is based on an infinite loop, right? It looks different depending on the platform, but if you saw 'while (1)', you wouldn't be surprised. Haha.
or while (true). Java doesn't take 1 or 0 as a boolean =(.

Java doesn't take true and false as boolean either. O_o It does take "If this = 1 stop whatever". I mean... I found this out the hard way, unless it was an issue that got fixed in the past year and a half.
Logged




My Brawl FC is 1289-8196-4511. Don't expect me to be on all the time though.
  • Super Smash Karts
Pages: 1 [2]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.102 seconds with 78 queries.

anything