Jump to content
  • Advertisement
Sign in to follow this  
Utko

Yet Another C# vs C++ thread (but please read)

This topic is 3254 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I'm aware that it's akin to suicide to create these kind of threads, but I hope my is more specific, so please help me out. I used to be fond of programming a few years ago, then had to drop it because of university and now suddenly I have this urge to resurrect my old hobby. Obviously things have changed while I wasn't paying attention, specifically .NET is now at version 3.5 (am I right) and C# is 3.0 Anyway, my question is... I want to finally learn how to program in its full sense, not just a specific language. I want to get it right this time, be able to actually visualize and imagine how something is supposed to be done, code-wise. And since I'm here, it's obvious I want to dedicate some time to writing games. Sorry that it's taking so long, but I just want to provide some background info. Anyways, I guess that I'm too old now to consider having programming as my job, though I still cherish this dream, I mean, I can always try to get a degree or something, but that's not really the point. I guess it'll always be my hobby, but you know never know. So I can't really decide now whether to work with C# or C++. Eventually I want to know both, but I can't decide whether to take the C# shortcut and first learn all the algorithms and all the programming stuff (I mean, learning how to write computer programs), so basically how to THINK in terms of programming; or dive into C++ straight away because frankly, and I've done a lot of research, it's still THE language, especially in gamedev. One of the pros of C++, I think, is that there are lots and lots of books about everything: 3D graphics, AI, physics, you name it - all using C++ for its examples. Erm, so basically... Shall I start with the "easier" and "cleaner" C# to learn how to program properly (I still remember most of the basic stuff, so I'm not a complete beginner), how to think like a programmer, how to carry out all these basic ideas; or try C++ straight away? It's not that I'm afraid of pointers and memory leaks, it's just that I think when you know how to program, languages become irrelevant, they're just tools for you and you can easily switch from one to the other and still be a competent programmer. So I just want to know whether C#'s qualities and user-friendliness overweight C++'s... dominance in terms of learning how to write computer programs with gamedev in mind. Hope that makes sense... Thank you and sorry for the "tl;dr" material.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Utko

I want to finally learn how to program in its full sense, not just a specific language.


You have basically two choices:
- The CS approach. Learn the fundamentals (ADTs, correctness, complexity, various algebras, logic, ....)
- The Software Engineering approach. Learn the methodologies, metrics, concepts (unit testing, team and management aspects, design patterns, domain frameworks, etc.). Also a university course.

Neither of the above deals with languages in particular, but each focuses on different approach towards building software. The SE one is considerably more profitable.

The above two choices are about "proper programming". Although the term is IMHO overrated... The only programming that counts is that which gets things done, rather sooner than later. But "proper programming" matters in real world, since it establishes common vocabulary and metrics through which teams can cooperate and monitor progress.

So I'm not really sure you need "proper" programming.

Quote:
Shall I start with the "easier" and "cleaner" C# to learn how to program properly

Yes.

Quote:
they're just tools for you and you can easily switch from one to the other and still be a competent programmer.

Well, almost every language and standard library concept is still covered in any Algorithms and Data Structures 101 course, although I'm not sure they still teach that. Either way, for fundamentals, you cannot go wrong with that.

Share this post


Link to post
Share on other sites
Thanks! I really like C# and obviously have nothing against C++, it's just that since it's a hobby and there's a 99% I'll be doing all of this on my own (no college courses, just online tutorials, books and forums), my time is pretty limited and want to start off as efficiently as possible. Granted, I do not have a specific goal at the moment, besides the fact that I really do want to finally UNDERSTAND what programming is about in its purest sense, because I know all the language stuff, variables, arrays, loops, OOP, but what I don't know is how to put all these elements, whether in C#, C++ or freakin' Basic, together to form a coherent unit, to achieve a goal, especially in gamedev, with physics, AI, graphics, even at their most basic level. I don't want to put a WebBrowser control on a WinForm, add a couple of buttons and call it my own Firefox Killer. I want to actually know how all of this is done, underneath, how a browser actually go about parsing HTML and whatnot. That was just an example. Same with gamedev.

And there's this other issue... Does C# have any decent graphics libraries? And please, no Managed DirectX, I think it's dead now, isn't it? Something like SDL (is that what's it called?). Even for a basic 2D game, I'm not talking DOOM3 style now. Because I have GameDev.net's very own Begging OpenGL Game Programming book and of course it's in C++ but it looks nice. Is there anything like that, both in terms of technologies and books, for C#? Or does it get really ugly with multiple OpenGL wrappers just to make it work on .NET?

Thanks!

Share this post


Link to post
Share on other sites
3 words: Books, tutorials, passion (for practice).

You can start with the tutorials of this site. I've read them almost all already. Some are a little technologically outdated, but the general ones are still usefull. If you really wanna do computer programming you'll have a lot of fun.

Share this post


Link to post
Share on other sites
Even though I am a large C# proponent these days, I must say that you won't get a good grasp of how programs fit together knowing any (one) language. Knowing different languages with different approaches is a very good way to train yourself to abstract language specific implementations to general structural concepts.

Quote:

I don't want to put a WebBrowser control on a WinForm, add a couple of buttons and call it my own Firefox Killer. I want to actually know how all of this is done, underneath, how a browser actually go about parsing HTML and whatnot. That was just an example. Same with gamedev.


Though this is something you'll need to wean yourself of. One needs not know the inner workings of every thing needed to make software. Indeed, being able to work with larger more abstract boxes is a vital skill often overlooked.


But back to the question at hand. This is not anything new. Use C#. Yes, it has graphics libraries for when you learn enough about program design to take that step. Though I'd perhaps suggest not going that route, and instead learning something like Haskell after you're comfortable with console C#; something like a chat application. That should help you get towards program structure and language agnostic conceptualization a lot more than rendering.

Share this post


Link to post
Share on other sites
If you're reading a book that is C++ heavy enough that you know C# and can't understand what it's telling you, throw it away. It's junk and the author was incompetent at writing books.

Share this post


Link to post
Share on other sites
Quote:
Original post by Utko

And there's this other issue... Does C# have any decent graphics libraries? And please, no Managed DirectX, I think it's dead now, isn't it? Something like SDL (is that what's it called?). Even for a basic 2D game, I'm not talking DOOM3 style now. Because I have GameDev.net's very own Begging OpenGL Game Programming book and of course it's in C++ but it looks nice. Is there anything like that, both in terms of technologies and books, for C#? Or does it get really ugly with multiple OpenGL wrappers just to make it work on .NET?

Thanks!


C# has some good gaming options available to you. XNA being one of the more obvious options. There are also the Tao framework. with bindings for all sorts of goodies such as OpenGL and provides direct access to the real functions so you use it the same way. I've used OpenGL, DevIL, and FreeImage libraries in C#. Since most engine/libraries are contained in accessible DLL files you can still use just about any one you wish, and most of the good stuff has already been addressed as with Tao Framework. Bottom line is you can get a hell of a lot done gaming wise in C# without ever getting in to C++. If you are liking C# and aren't looking to be getting employed as a top tier game designer then it is an extremely viable option for you to explore.

Share this post


Link to post
Share on other sites
Quote:
Original post by Goober King
C# has some good gaming options available to you. XNA being one of the more obvious options. There are also the Tao framework. with bindings for all sorts of goodies such as OpenGL

Not to forget the great SlimDX library, a thin managed wrapper around DirectX and some related libraries. BTW, SlimDX is probably one of the best designed interop libraries I've seen so far.

Share this post


Link to post
Share on other sites
Quote:
Original post by VizOne
Quote:
Original post by Goober King
C# has some good gaming options available to you. XNA being one of the more obvious options. There are also the Tao framework. with bindings for all sorts of goodies such as OpenGL

Not to forget the great SlimDX library, a thin managed wrapper around DirectX and some related libraries. BTW, SlimDX is probably one of the best designed interop libraries I've seen so far.


True, but I've found the documentation very unhelpful... Maybe I'm using the wrong help file. Or maybe I'm too noob for that yet, because all I could find for SlimDX was a reference, not really a tutorial.

But thanks, I think I'll go with C# then.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!