C# vs C++ I need to know!

Started by
44 comments, last by Kylotan 18 years, 10 months ago
I don't know how old you are, or any other circumstances about your situation, but you say that you are getting discouraged, and so I can share my own experiences, hoping that they will help you.

I started programming when I was about 12. My first language was qbasic. After a couple of months of that, I decided to jump right into C++. It really wasn't an informed decision, and I really didn't understand that it would be hard. The only resource I had to learn from was one of those "Learn C++ in 21 days" books. I quickly got discouraged, believing that I was too stupid to be a programmer, and quit programming for years. What I did not understand was that programming is hard. It takes years to become good at. It takes patience, hard work, and perseverence. If you are interested in being a programmer, don't make the mistake of quitting just because it's hard. Quit because you don't enjoy it, or you aren't interested in programming, but not because it's hard. I found out years after I quit that I *do* want to be a programmer after all. I cringe every time I think about how talented I would be if I had just persevered. Don't make that mistake.
Advertisement
Quote:Original post by Ikana
I don't know how old you are, or any other circumstances about your situation, but you say that you are getting discouraged, and so I can share my own experiences, hoping that they will help you.

I started programming when I was about 12. My first language was qbasic. After a couple of months of that, I decided to jump right into C++. It really wasn't an informed decision, and I really didn't understand that it would be hard. The only resource I had to learn from was one of those "Learn C++ in 21 days" books. I quickly got discouraged, believing that I was too stupid to be a programmer, and quit programming for years. What I did not understand was that programming is hard. It takes years to become good at. It takes patience, hard work, and perseverence. If you are interested in being a programmer, don't make the mistake of quitting just because it's hard. Quit because you don't enjoy it, or you aren't interested in programming, but not because it's hard. I found out years after I quit that I *do* want to be a programmer after all. I cringe every time I think about how talented I would be if I had just persevered. Don't make that mistake.


Sorry, you seemed to just look at the word discouraged and programming. I mean that I am getting discourage in learning C++ instead of C#. Mainly because I am only 15, just going into 10th, and C++ may not be the standard for game programming by the time I get out of highschool. I was wondering if I should just learn C# now or C++.

------Signature------Inspiring young coder/programmer!
Quote:Original post by whitin
Sorry, you seemed to just look at the word discouraged and programming. I mean that I am getting discourage in learning C++ instead of C#. Mainly because I am only 15, just going into 10th, and C++ may not be the standard for game programming by the time I get out of highschool. I was wondering if I should just learn C# now or C++.


Please don't look at what will be the standard when you are finished with your education, when you have programmed C++ or C# for a year or two you'll see that it aren't very hard to learn the other.

Right know you are just starting out and just learning the programming language seems like such a hard task that you don't want to do it again, but just wait until you have to learn OpenGL or DirectX, then you'll think that to learn C++ really wasn't that hard, and when you're designing a game engine you might think that OpenGL and DirectX weren't hard to learn. I'll bet that if you stick to one of the languages now, in one year you'll be able to learn the other pretty easily.

I'm not sure what to recommend, in my opinion C# are a "cleaner" language, and would be pretty good for a beginner. But also almost all resources on game programming use C or C++ source code. Also it'll probably be easier to go from a low-level language(like C++) to a high-level language(like C#) than the other way around.

So if you want to get into game programming, I'ld say C++, because there is already so much code written in C/C++.

And about that being 15 and caring about it's the standard when you get out of high school. Well I'm also 15, and I was very nervous making this decision myself to, I finally choose C#(after 1 year of experience with C++) because it's in MY opinion what the future game industry will mainly use, but I quickly switched back to C++ because I couldn't do all the fun things, they were already done in C#'s library. Anyway, today I use both, mostly C++ because I think it's more fun to program low-level(but not at an assembly level) than at the C# level.
I would suggest starting out with modern c++. This would mean using the string class, boost smart pointers and stl containers. As in this article: http://www.gamedev.net/reference/articles/article2009.asp. Using smart pointers and the vector class makes c++ as easy as java or c# and you can still optimize if necessary.
Hmm, put it like this.

I know C++. Learning C# took me an additional 30 minutes.

It doesn't matter. Currently C++ is the industry standard, and that won't change any time soon. And if it does? So what? It's easy enough to jump from C++ to C#.

And on the other hand, C# is a better language for beginners. It lets you concentrate on actual programming, without having to worry about relatively unimportant issues like memory management or pointer hell.

You can go both ways. They're both valid, and in the end, it won't make much difference. Starting with C# might make the learning curve less steep to begin with, but you'll have to spend a few hours afterwards learning C++.

C++ is harder to get started with, but once you know it, jumping to C# is no problem at all.
Alright, let me give you the perspective of someone who is also 15 (going into 11th). About a year ago (infact, almost exactly a year ago) I picked up a book on BlitzBasic. Game Programming For Teens or something like that. I pounded through it with no challange or issues or anything. In the back of the book was an ad for GameDev, so I came here. Like every kid, we all dream of making it to the industry, but I knew that I had the skills in learning and articulation to actually make it. So after browsing on the forums and such, I came to the conclusion that I wanted to go all the way. I wanted to learn C++, and that I would take small steps, learn to make great games, and by the time I had my Bachelors (6 years away) I would have an incredible skill set, a great portfolio, and all the resources I need to make my break.

So I started learning C++. I started... hmmm... oh, right. C++ Primer Plus. Boy that was a mistake. Dryest read ever, more like a dictionary. Better for learning the language and how it all function then learning raw programming. So from what I learned in the book I decided to take an online class at Gameversity (this was about 11 months ago). Eventually I fell behind in the class, struggled with the topics, thought it was too hard, and forgot about C++ and game programming all together. I persued other things, like film and theater.

Well, about... I don't know, 3 months ago? I came on back to C++. I went to www.cplusplus.com and worked through the language tutorial. I already had C++ knowledge in the back of my head, and it was a good tutorial. I breezed right on through, comprehended everything, and was very sucessful making sample programs. I made text-based tic-tac-toe simple and easy. Then I started in 2D with an API called Allegro. Made Pong, Space Invaders, and BrickOut. Now I've worked my way through SideScroller prototypes, I'm on a team, and I should finish my first commerial game project before my 16th birthday in October.

The point is, I stuck with it, bore through the hard points, and now I'm living my dream! I wouldn't want it any other way. Here's my biggest tip. Never get discouraged. It may seem at times that you make bad, unstable code, but you have plenty of time to learn! We're young, and we've got the advantage of time on our hands.

Be strong, live strong, code strong. C++ all the way.

-IV

DevJournal available at www.gamedev.net/community/journals

-IVHumble Student

Learn C++ to learn programming concepts, then switch to whatever language you want.

(I'm one of the biggest C# / .NET zealots you'll ever fine too)
If youre the kind of person that likes to see results before the theory,
then learn C# first. If you like to learn theory before results, learn C++.

Right now i know both languages, and every now and then i program in C#,
but usually in C++. And when i switch languages my syntax doesnt get messed
up at all (For example i dont accidently use pointers in C# (without unsafe
keyword)). My point is that these languages are pretty close in syntax
and if you learn one it wont be hard to move on to the other, as many said.

It will be pretty useful to learn both, since then whatever the standard
may be, you'll be ready.
I'd learn C first, and once you have a firm understanding of that than jump to C++, only learn C# if you want to be stuck to windows platforms.
Quote:Original post by Grain
I'd learn C first, and once you have a firm understanding of that than jump to C++, only learn C# if you want to be stuck to windows platforms.


Bad idea.
if you ever read this, i'm letting you know that learning C is a big mistake.
it teaches you bad structural habits when you should be learning object orientation in C++([cool]) or in C#. it's syntax is also harder to understand, making C++ easier to learn. things like output and memory managment are easier in C++. believe me, i know this.
as for C#, all i know is that it is easier to learn than the other two, but is slower and doesn't give you as much power and control.
I would stick with C++. that'll make C# no sweat.
Stay away from C [evil].

This topic is closed to new replies.

Advertisement