Public Group

C# or C

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

Recommended Posts

Some background: I am a 14 year old Texan. I come from a background of web designing, and therefore know HTML, PHP, javascript, little ASP, little bit of other languages. I have been coding PHP since I was ten, and learned HTML at 8. -------------------------------------------------------------------------------- I started learning C++ recently, mainly just because I wanted to see if I could :p, but I didn't get very far at all because it was extremely dull, I knew the basics, just not the syntax for them, so I switched to visual basic. I have created an extremely advanced calculator in it, but I have decided that it isn't the best language to learn because it really creates sloppy coders, and has no where near the power I want. I still have all my C++ stuff, including the Digital Mars compiler. I have also downloaded Visual C++, Visual C#, and of course Visual Basic (all express, I am fourteen and therefore have no \$). So, I searched around and have decided the most popular starting language is C++, however when I go to you for beginner reource fo people who are already coders, then it gives me a crapload of stuff about Direct X. Questions: 1.) Are C# and C the same thing? 2.) How do I make games with directX (is it free)? 3.) If DirectX is not free, C or C++ (or c#?)?

Share on other sites
1) Nope. C is the basic procedural language, C++ is the object oriented language based off of that (and the current standard for game development) and C# is something about "managed code" or somesuch that I'm really not qualified to comment on.
2) You'd access DirectX through another language. It's mainly a set of libraries to build a game on top of, and you can work with it with most modern programming languages. It's completely free to download the SDK. You'll want to find tutorials for this (it's something I've never gotten into myself... one of these days I'll get my head out of my AI and get to it!)
3) There are free compilers for those languages. Someone else will probably be able to point you in the right direction...

Share on other sites
1. No - C and C# are completely different languages. Their syntax can be similar, but fundamentally they are different. C++ grew out of C (initially it was a superset of C, but they have since moved in slightly different directions). C++ added Object Oriented Programming capabilities on top of C. Many years later, with the advent of Java, Microsoft designed an interpreted language based off C++. That is C#. An "interpreted language" is something you probably don't need to know about now.The Digital Mars compiler is quite outdated now, and Microsoft's compiler (7.1 and greater, being VS2003 and later - 2005 is 8.0) is more compliant.

2. Yes, the DirectX SDK (Software Development Kit) is free for any and all developers. You'll find the download at Microsoft's site somewhere. You make games with it by including the correct header files from your project (C++), or importing the correct namespaces (C#, VB), and using the provided classes and functions. MSDN (Microsoft Developer Network) has many, many tutorials on how to do so, for every major language they support (aka, not Java). Their tutorials all use their respective IDE (Integrated Developer Environment) - the Visual Studios (they are also very good IDEs themselvse). There's a link to MSDN in my signature.

3. NA

Hope that helps! C++ is a complex and sometimes arcane language, but you'll have a greater understanding of programming by the time you finish it compared to C# and Java. However, those languages are more refined, and probably easier to get started with. Many people on these forums have different ideas.

Share on other sites
You may also want to look into learning C# and using XNA.

It uses DirectX (correct me if I'm wrong) and has some decent tutorials, including video tutorials.

Share on other sites
Quote:
 Original post by _goatMany years later, with the advent of Java, Microsoft designed an interpreted language based off C++. That is C#. An "interpreted language" is something you probably don't need to know about now.
C# is not, by any stretch of the imagination, "interpreted". Nor does it share much of anything in common with C++.
Quote:
 C++ is a complex and sometimes arcane language, but you'll have a greater understanding of programming by the time you finish it compared to C# and Java.
I think that's a completely bogus claim. C# and C++ will give you different slices of "programming", and both are woefully incomplete.

Share on other sites
Im 14 as well and started to learn C++ but had trouble because making console apps is only fun for 5 minutes, so I tried out C# and it is much easier to learn and as far as I know you can do anything with C# that you can do with C++. Although C# is a little slower.

Share on other sites
Quote:
Original post by Promit
Quote:
 Original post by _goatMany years later, with the advent of Java, Microsoft designed an interpreted language based off C++. That is C#. An "interpreted language" is something you probably don't need to know about now.
C# is not, by any stretch of the imagination, "interpreted". Nor does it share much of anything in common with C++.

I didn't say they were similar, I said C# was based off C++ (and others, of course). Anders Hejlsberg (lead technician at MS) has said so himself.

Quote:
Quote:
 C++ is a complex and sometimes arcane language, but you'll have a greater understanding of programming by the time you finish it compared to C# and Java.
I think that's a completely bogus claim. C# and C++ will give you different slices of "programming", and both are woefully incomplete.

I should have made myself clearer, and I considered it, but I left out a lot of detail for the sake of the OP, and not experts reading my post. C and C++ will teach you everything you need to know about the "fundamentals" of programming. I'm not talking about paradigms here, or areas of programming - I'm not talking about dynamic typing or advanced (some would argue "complete" is a better word) RTTI - I'm talking about how a computer, physically, does things. Memory addresses, offsets, alignment, registers, etc. C# hides some of these things. RTTI and dynamic typing are systems/methodologies put in place "over" these base processes. And they're useful, but if you only know them, and not how they're implemented, you can be left high and dry when it comes to basic computer processes.

That's what I meant.

Share on other sites
Quote:
Original post by _goat
Quote:
Quote:
 C++ is a complex and sometimes arcane language, but you'll have a greater understanding of programming by the time you finish it compared to C# and Java.
I think that's a completely bogus claim. C# and C++ will give you different slices of "programming", and both are woefully incomplete.

I should have made myself clearer, and I considered it, but I left out a lot of detail for the sake of the OP, and not experts reading my post. C and C++ will teach you everything you need to know about the "fundamentals" of programming. I'm not talking about paradigms here, or areas of programming - I'm not talking about dynamic typing or advanced (some would argue "complete" is a better word) RTTI - I'm talking about how a computer, physically, does things. Memory addresses, offsets, alignment, registers, etc. C# hides some of these things. RTTI and dynamic typing are systems/methodologies put in place "over" these base processes. And they're useful, but if you only know them, and not how they're implemented, you can be left high and dry when it comes to basic computer processes.

That's what I meant.

I compleatly agree.

C++ will give you a understanding of how things work (like _goat said) buth it will also make you learn a lot of c++ specific idoms and techniques that are hard to ditch when crossing to C#, so i would sugest learning pure C first as it is simple procedural lanuge that will give you a basic understanding of pointers and memory managment, and then cross to C# to learn OO. All this aplys only if your goal is to lear C# in the end. If you want to learn c++, avoid procedural programing and std C library, as you will confuse this with c++ (witch is OO). I've seen a lot of people who say they can program C++ buth don't even understand basic concepts such as virtual members or inheritance, insted they use procedural programing with c++ syntax.

Share on other sites
Quote:
 Original post by _goatMemory addresses, offsets, alignment, registers, etc.

I would argue that C or C++ themselves do not teach anything about memory addresses or registers either, since they are designed to be independent of the function or even existence of these concepts. In fact, the memory model used by both C and C++ expressly avoids discussing the nature of memory addresses, mostly restricting itself to "pointers are (buffer,offset) pairs", with some ramblings about implementation-defined conversion to and from integers. And although these languages do teach you something about alignment, but I've never found knowledge about alignment useful in any situation where knowledge of a low-level language (assembly, C, C++) was not also required. I would hardly consider these three concepts "fundamentals of programming", as much as they are "fundamentals of machine-level programming", judging by their impressive absence from most non-machine-level languages who do their jobs just fine without it—and most of the programming done today is not machine-level anyway.

As for offsets... what's the conceptual difference between offsets and array indexing?

Either way, except for assembly, most languages are just too high-level to accurately describe how the machine works, and this does include C and C++ (simply because they're portable while machine-level knowledge isn't), and a language possibly isn't the best way of learning how the machine works anyway.

[Edited by - ToohrVyk on July 16, 2007 3:50:56 AM]

Share on other sites
All this is true in the theory, but tell me, do you know a c++ programmer who is not farmiliar with addresses or registers ? IMO learning c/c++ implies the learning of basic machine-level programming, and every c/c++ book should at least cover bare minimum of this.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• Forum Statistics

• Total Topics
634060
• Total Posts
3015300
×