Adventure Game Studio

Community => General Discussion => Topic started by: Icey on Tue 09/08/2011 11:06:04

Title: Is there a big diference between C+ & C#?
Post by: Icey on Tue 09/08/2011 11:06:04
I was able to get Visual Studio 2010. I wanted to make a small test game for my 360. What I notice was is that you have to code in C#. Problem is that is something I have never done before. I only coded in C+. Can someone let me know what is the difference? or is there a way I can make were I could use C+ coding instead of C#?
Title: Re: Is there a big diference between C+ & C#?
Post by: Babar on Tue 09/08/2011 11:11:38
Before the barrage of flaming that is sure to ensue (and honestly, Icey, your post seems tailored exactly to be flamed :P), it's C++, not C+. And yeah, they are very different languages.

I'd suggest figuring out C#. It's a lot easier to use and get into than C++ for many people. If you've coded some in C++, you shouldn't have too much difficulty with C#. And yeah, you need C# for coding for you 360.
Title: Re: Is there a big diference between C+ & C#?
Post by: Khris on Tue 09/08/2011 11:13:20
C# is much more similar to Java.

Hello world in C++:

#include <iostream>

int main()
{
   std::cout << "Hello, world!\n";
}


C#:
using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("Hello world!");
    }
}


According to Wikipedia's XNA article:
QuoteGames that run on the framework can technically be written in any .NET-compliant language, but only C# in XNA Game Studio Express IDE and all versions of Visual Studio 2008 and 2010 (as of XNA 4.0)[3] are officially supported.
Title: Re: Is there a big diference between C+ & C#?
Post by: Calin Leafshade on Tue 09/08/2011 11:19:07
C# is syntactically very similar to ags script and in my opinion it is a better language.

C++ is faster in the majority of cases but unless you really need that speed in a modern setting (high grade physic simulation or something) I can literally think of no good reason to use it with the exception of cross-platform compatibility.

C# takes most of the programming concepts from c++ and improves upon them.

While C# is often compared to java in style they are very different in execution and C# programs are *much* faster than java.
Title: Re: Is there a big diference between C+ & C#?
Post by: monkey0506 on Tue 09/08/2011 11:39:52
Who wants to bet $50 that "able to get Visual Studio 2010" means "downloaded via torrent" (or some other illegal means) and not "downloaded VS2010 Express which is actually free"?

It's also worth asking that while developing games with XNA might be all well and good, are you actually prepared to pay for a license to have them published over XBLA? Coz that is not free, and you can't just download a license from TPB. :=

C# is completely object-oriented which is very, very nice structurally (IMO), and the memory is also managed, which means no memory leaks in your programs. Compared to C++ there are a lot of differences in the implementation of things, but it's intuitive enough that it shouldn't take a reasonable person long at all to figure it out.
Title: Re: Is there a big diference between C+ & C#?
Post by: arj0n on Tue 09/08/2011 11:42:24
Quote from: monkey_05_06 on Tue 09/08/2011 11:39:52
Who wants to bet $50 that "able to get Visual Studio 2010" means "downloaded via torrent" (or some other illegal means) and not "downloaded VS2010 Express which is actually free"?

It's also worth asking that while developing games with XNA might be all well and good, are you actually prepared to pay for a license to have them published over XBLA? Coz that is not free, and you can't just download a license from TPB. :=

C# is completely object-oriented which is very, very nice structurally (IMO), and the memory is also managed, which means no memory leaks in your programs. Compared to C++ there are a lot of differences in the implementation of things, but it's intuitive enough that it shouldn't take a reasonable person long at all to figure it out.
I bet he "got it by a friend (of a friend of a ...)".
Title: Re: Is there a big diference between C+ & C#?
Post by: monkey0506 on Tue 09/08/2011 12:00:55
Somewhere down the line a torrent was probably involved though...and either way that still falls under the category of "other illegal means". :P
Title: Re: Is there a big diference between C+ & C#?
Post by: arj0n on Tue 09/08/2011 12:02:44
It was a disguised affirmation of your post Monkey  ;)
Title: Re: Is there a big diference between C+ & C#?
Post by: on Tue 09/08/2011 12:38:22
From the "Nerd Notebook":

Nerd1: "C++ is C with classes.  C# is C++ without the need to keep track of all that dynamic memory allocation."
Nerd2: "Duuude, it's not as simple as THAT!"
(cue fight)

C# is (as far as I'm concerned) quite easy to like if you're no die-hard C++ fan. It takes memory handling almost completely out of your hands, removes the somewhat beginner-unfriendly pointer syntax, and I think on most computers the speed issues mentioned won't pose a large problem. Lemmy converted me to C#, and I've not yet looked back...

XNA takes it another step further by simplifying asset management and giving you a solid framework. Not a perfect one, and you won't get superply shiny stuff automatically, but a solid base.

[edit]
Oh, yes. Stealing software is BAAAAD!
Title: Re: Is there a big diference between C+ & C#?
Post by: Wonkyth on Tue 09/08/2011 13:09:03
Speaking of which, I really need to make my teacher get me a Microsoft IT Academy thingy...

On Topic: I moved directly from AGScript into C#, and have had so much fun with it I've not touched AGS in months.   :-X
Title: Re: Is there a big diference between C+ & C#?
Post by: Paper Carnival on Tue 09/08/2011 14:01:11
C# is truly the greatest thing that ever happened to me.

I cannot hate Microsoft anymore after this.

It's not even just the dynamic memory allocation, there's a lot of things that come with it. It allows for amazing code design and abstraction among other things. And, if you are up to it, you can even have some manual control over memory allocation. I never actually tried it, so I don't know if you can overload the new and delete operators as well (as in C++).

Oh, and if you are familiar with the mono project, it IS cross-platform.

However, if you are serious about learning programming, I believe learning C++ is also essential. It helps you understand better how things work in the background and also lets you appreciate the magic of C# even more.
Title: Re: Is there a big diference between C+ & C#?
Post by: selmiak on Tue 09/08/2011 14:42:50
don't you need to download some extra packages to even run a program that was written in C#?
Title: Re: Is there a big diference between C+ & C#?
Post by: Calin Leafshade on Tue 09/08/2011 14:45:59
Yes, just like you do with Java.
Title: Re: Is there a big diference between C+ & C#?
Post by: Wonkyth on Tue 09/08/2011 14:52:19
Runtime Environments are hardly something to be worried about.
Title: Re: Is there a big diference between C+ & C#?
Post by: cat on Tue 09/08/2011 14:53:23
Doesn't Windows 7 already ship with .NET framework included?
Title: Re: Is there a big diference between C+ & C#?
Post by: Wonkyth on Tue 09/08/2011 14:56:00
As far as I know. Although it still can't quite be taken for granted. You'd be surprised just how many people have computers that they've been using for close on a decade without even connecting to the internet, let alone updating.
Title: Re: Is there a big diference between C+ & C#?
Post by: Wyz on Tue 09/08/2011 14:57:00
The main difference is that that C# is shit and C++ is not.
Title: Re: Is there a big diference between C+ & C#?
Post by: Wonkyth on Tue 09/08/2011 14:59:09
Here we have a C# hater. No, I'm not just calling him that, it's true. Innit, Wyz?
Title: Re: Is there a big diference between C+ & C#?
Post by: Calin Leafshade on Tue 09/08/2011 15:11:22
.net 2.0 was shipped in XP SP3 i believe

and all versions since have shipped with .net 2.0 or greater.

Title: Re: Is there a big diference between C+ & C#?
Post by: Icey on Tue 09/08/2011 15:42:40
Thanks for all the feed back. I think I might download the C# plug-in and play around with that.

And Monkey you would lose that bet because I did download the free one however it expired on me. So I did take my chance and look up a Keygen. I checked to see if it was bad before I download it.

Also I did buy a member ship before I even noticed I the the creator on my laptop. Microsoft has every thing sorted out weird on there site. This means I now have a years worth of time to make something for the 360 >.<
Title: Re: Is there a big diference between C+ & C#?
Post by: Paper Carnival on Tue 09/08/2011 16:20:11
Quote from: Wyz+ on Tue 09/08/2011 14:57:00
The main difference is that that C# is shit and C++ is not.

Why is it shit exactly? Have you ever seriously tried it, or are you prejudicial against it like I used to be?

On a related tone, having .h files, too many pointers, 3 different operators for scoping (".", "->" or "(*x)." and "::") and generally uglier syntax does look like shit scattered all over my otherwise sexy code.
Title: Re: Is there a big diference between C+ & C#?
Post by: Wyz on Tue 09/08/2011 16:35:41
Hover over my previous post for a bit. ;)
Title: Re: Is there a big diference between C+ & C#?
Post by: Paper Carnival on Tue 09/08/2011 17:01:50
I suppose my trolling detection sense was obscured by my passion :P
Title: Re: Is there a big diference between C+ & C#?
Post by: on Tue 09/08/2011 17:06:30
The best thing about C# is XNA.

No I mea-
Title: Re: Is there a big diference between C+ & C#?
Post by: Calin Leafshade on Tue 09/08/2011 17:24:44
XNA is also excellent. (I am making a game with it :D)



Title: Re: Is there a big diference between C+ & C#?
Post by: Eigen on Tue 09/08/2011 17:38:31
I've touched C#, not in any inappropriate place, I assure you, but I got to say I don't like it much. I guess it comes down to personal preference as to why I like C and especially C++ more. To me, in addition to obvious perks already stated here (multiplatform support, etc.), it feels more robust and closer to the hardware. Yes, you could write stuff in Assembly .. but rather not. C, when compiled, is the closest to what you might do in Assembly. You can even use Assembly in C language itself. All good stuff in my mind.

Another C-like language I've recently became to like very much (thanks to my job) is Objective-C. Its syntax is based on Smalltalk, so nothing like C, but it's based on it, so you can write C in that as well. Basically you write stuff like [Player getObject:APPLE] or [Player give:APPLE to:AnotherPlayer]. Once you get the hang of it, rapid programming ensues .. it's just so easy to write. There are other really good things about it as well .. like dynamic-typing and the ability to change what method to call on an object at run-time.

Bottom line. Use the language that best suits the needs of your project and that you're most efficient in.
Title: Re: Is there a big diference between C+ & C#?
Post by: Icey on Tue 09/08/2011 18:58:14
Hey calin do you think you could give me some ponters with XNA? I don't really know how to start out with it  :-\
Title: Re: Is there a big diference between C+ & C#?
Post by: Calin Leafshade on Tue 09/08/2011 19:20:40
I assume this will help you for what you want to do:

http://xnagpa.net/newrpgtutorials.html
Title: Re: Is there a big diference between C+ & C#?
Post by: monkey0506 on Tue 09/08/2011 20:31:28
I'd just like to point out that registering VS Express is free, and you don't need a keygen to do it legally.

The Object Browser is very much your friend by the way. As is Google.
Title: Re: Is there a big diference between C+ & C#?
Post by: Icey on Tue 09/08/2011 23:04:04
I got VS ultimate

Google is my bestest friend however I thought I ask around here. And also I did check google. But I think its a hell of a lot to ask here. I get the answers I needed here vs me search from page to page to see the difference.
Title: Re: Is there a big diference between C+ & C#?
Post by: monkey0506 on Tue 09/08/2011 23:21:07
Quote from: Studio3 on Tue 09/08/2011 15:42:40And Monkey you would lose that bet because I did download the free one however it expired on me. So I did take my chance and look up a Keygen.

Quote from: Studio3 on Tue 09/08/2011 23:04:04I got VS ultimate

Huh..somebody doesn't understand what "lose that bet" means. Go figure.*

Quote from: Studio3 on Tue 09/08/2011 23:04:04Google is my bestest friend however I thought I ask around here. And also I did check google.

Ah, you've completely missed my point. I mentioned the Object Browser immediately before mentioning Google because I was directly talking about your efforts to understand how to use the XNA framework. You know, Google can help with that too (http://lmgtfy.com/?q=xna+tutorial).

Quote from: Studio3 on Tue 09/08/2011 23:04:04But I think its a hell of a lot to ask here.

Hah. So..I'm not trying to dissect your post word-for-word here, but I'm trying to understand what this was supposed to mean exactly. Asking about the differences between "C+" (sic) and C#, is a rather broad topic for discussion, and so is "how to use xna plxkthnz". Put together I suppose that would be "a hell of a lot".

Quote from: Studio3 on Tue 09/08/2011 23:04:04I get the answers I needed here vs me search from page to page to see the difference.

Good heavens, having to actually look (http://www.xnadevelopment.com/tutorials.shtml) through (http://www.riemers.net/) the (http://create.msdn.com/education/tutorial/2dgame/getting_started) results (http://msdn.microsoft.com/en-us/library/bb200104.aspx) that (http://rbwhitaker.wikidot.com/xna-tutorials) Google (http://grandgravey.com/2009/04/15-great-xna-tutorial-sites.html) gives (http://www.youtube.com/watch?v=rw-m6f44fK8) you (http://www.xnatutorial.com/) is hard (http://en.wiktionary.org/wiki/easy). ::)

*There's a difference between a "free trial" and a "free version" of a program. Visual Studio Express is completely free (legally). The trials of other versions of Visual Studio are also free, but once they expire you no longer have a legal right to use that version (unless you legally purchase that version). I specifically indicated that you used some illegal means to "obtain" (or in this case, unlock) your version of VS, and indeed, you downloaded an illegal keygen instead of using the free Express version of Visual Studio.
Title: Re: Is there a big diference between C+ & C#?
Post by: R4L on Wed 10/08/2011 03:35:52
Honestly Icey, I think before you go and do all of this that maybe you should get AGS down and actually make something that shows that you can take it to the next level.

But I'm not going to tell you what to do.  :P
Title: Re: Is there a big diference between C+ & C#?
Post by: Icey on Wed 10/08/2011 04:03:37
I have tings in AGS I got to finish. And I have made other things and AGS before you no /:)

And Monkey the whole point is that
1. I did not torrent
2. And I think it's easier to ask question here as people know me here. Also I had no clue exactly what to look for vs AGS. Sure I can search up a tutorial on youtube but it doesn't mean it's going to work all the time. I never even used C# so that is why I needed to no was there a big DIFFERENCE. Cause I dont want to make more/harder work for me. The whole RPG thing is enough and I am finally getting a good grasp on that.

Good, now that that's out of the way I can start reading up on the many,many sites for XNA including the RPG one.
Title: Re: Is there a big diference between C+ & C#?
Post by: monkey0506 on Wed 10/08/2011 05:17:58
I should really drop this, but why stop now just when I'm on a roll? :=

The "whole point" is not about whether or not you "used a torrent" the whole point is about whether or not you obtained (or gained access, unlocked, etc., etc.) your copy of Visual Studio via illegal means. Hence the part where I said "or other illegal means".

Really, I don't care how you got it, that you have it, or anything of the sort. I'm more of a pirate that you'll ever be. So that's not what I'm trying to get across.

What I'm trying to get across to you is that whether you used a torrent, keygen, or murdered your neighbor to steal his license, you didn't purchase your own license to the copy of VS2010 that you are using. It is therefore illegal. I don't care. I'd probably do the same thing (except I didn't, and I'm using VS2008 Express, legally). I just want you to be aware of what you're doing, because your arguments thus far are highly indicative that you feel that if the FBI came a-knockin' that you'd have nothing to hide.

It's cool that you didn't know if there was a big difference between what you're used to and what you're trying to get yourself into. I don't even care that you asked. Good job, you found an answer. Still, it wouldn't have been that hard to figure it out with a slight bit of Googling. Either way, you got it sorted out now, and I'm sure it's only a matter of time before we're all buying PMQ DLC on XBLA just so we can get the achievements..I mean, it's gonna be like the best game ever, but achievements are all that matters. That's how you can rub your friends' noses in it.
Title: Re: Is there a big diference between C+ & C#?
Post by: Icey on Wed 10/08/2011 07:14:08
So would it be better for me to use the express version? Also is there a 2010 version cause I think I cant work with xna 4.0 on anything lower than 2010.
Title: Re: Is there a big diference between C+ & C#?
Post by: monkey0506 on Wed 10/08/2011 07:37:47
It would be not illegal. "Better" is a matter of opinion, and like I said, I don't really care which version you're using or how you got it. I was just pointing out that the copy you have isn't legal despite your insistence that you got it for free (which..isn't an argument?).

You can keep using the version you've got if you want. Or don't. I don't care either way. But yeah, there is a VS2010 Express edition which is legally free from Microsoft under license.
Title: Re: Is there a big diference between C+ & C#?
Post by: InCreator on Wed 10/08/2011 07:38:52
I liked first "hello world" example better, with C++

static void... um, what? How come every program has to start with a shitty name for RPG dungeon?
Title: Re: Is there a big diference between C+ & C#?
Post by: Wonkyth on Wed 10/08/2011 11:33:57
I lol'd at that.  :D
Title: Re: Is there a big diference between C+ & C#?
Post by: Khris on Wed 10/08/2011 11:38:52
I don't get it :) Main?
Title: Re: Is there a big diference between C+ & C#?
Post by: Wonkyth on Wed 10/08/2011 11:43:52
Quote from: InCreator on Wed 10/08/2011 07:38:52
How come every program has to start with a shitty name for RPG dungeon?