Sign in to follow this  
Smart Invincible

C, C++ Or C Sharp

Recommended Posts

hay guys; website is cool. This is my first day and i really enjoyed my first day in this website. and very well class good people i saw in this website. and all are very much champions. Well i am not a game developer but i want to be a game developer. Nowadays i am trying to integrate myself into Software Development. But this is really interested because i know how to model an objects and i also won prizes in website competition. my teacher told me that one day you will become a great and successful businessman. So I Completed 12 Class and i am joining MCS. but the thing is that i wanna learn game programming and i now that C, C++ and C Sharp has a very great values in programming. So i really wanna learn from beginning, And you guys have to help so can you guys tell me the websites or tutorial sites and please tell where can i download these softwares. And Tell me the name of the sites in which i can learn from very begining. Please Don't say that google "C" because google shows me millions of site and i want best of best sites. Thank you

Share this post


Link to post
Share on other sites
Please use the search box at the top right to search for "C++ or C#". This discussion has been covered fully by many members of this community (of all levels of experience and wisdom) at least a dozen times in recent months.

General summary:

There is no need to learn C as a first language. C++ is heavy and complicated. C# gets recommended from time to time as a first language. I'd vote for C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by TheUnbeliever
Please use the search box at the top right to search for "C++ or C#". This discussion has been covered fully by many members of this community (of all levels of experience and wisdom) at least a dozen times in recent months.

General summary:

There is no need to learn C as a first language. C++ is heavy and complicated. C# gets recommended from time to time as a first language. I'd vote for C#.


Thanks for telling me i found alots of tutorial. My Cousin Gift me a "C Language" Book and i am also familiar with C interface but C works in Black Screen. And i found myself very depressed. Can you tell me is there any versions in C, i mean GUI Mode so i can better learn easily and to find bugs is very hard. i also worked in Visual Basic Which has a GUI mode plus when errors comes it shows with highlight that line and also with explanation and with error number and Visual Basic Smart Intelligence Mirror Shows me syntax, methods, as you know. So what about C Sharp, C++ are they in GUI And can we make samethings what me make in C Language

Share this post


Link to post
Share on other sites
Hi, my recommendation is buy a good book of C++. One good is Beginning C++ Game programming, second edition from J. S. Harbour, another one great book is Game Programming All in One, third edition from the same author.

I encourage you to learn C++ first, then you can move to C#. Both are Object Oriented Languages.

If you want an IDE try Bloodshed Dev-Cpp, is free and you will be able to build and compile both C and C++ programs.

For C# try SharpDevelop, and excellent IDE. Both of this are Open Source and FREE.

Microsoft launch recently a free line of their compilers called the Express edition. There you can find Visual C# Express edition and Visual C++ Express edition. They are very good and very powerfull tools.

And as said before, you can run all your C programs with Dev-Cpp or Visual C++ Express. Although C is not Object Oriented.

Share this post


Link to post
Share on other sites
Quote:
Original post by ejele012
I encourage you to learn C++ first, then you can move to C#. Both are Object Oriented Languages.
I would recommend that if a beginner wishes to learn a C-family language they should try the opposite approach, beginning with C# and learning C++ later if desired/required. My reasoning is as follows:
  • A beginner is trying to learn both the programming process and the details of thier chosen language at the same time. As both of these can be quite difficult tasks it would be wise to minimise the complexity of the language where possible to allow the beginner to focus on the actual task of programming. C# protects the user from a lot of unneccesary details they would have to deal with in C++.

  • C# allows the user to work with the excellent .NET framework which provides a lot of functionality they would otherwise have to either code themselves or use external libraries for in C++. C# therefore potentially allows the user to be more productive as they become more experienced.

  • C# (while still far from ideal) is generally accepted as a much more cleanly designed language than C++.

  • It's generally accepted that your first programming language is the most difficult to learn and that learning additional languages at a later stage will often be significantly easier. It therefore makes sense to tackle the difficult task of learning a first language using a relatively simple language.
Due to the reasons listed I would actually recommend a beginner not start with a language from the C family at all and to instead try Python or something like Phrogram.

I'm interested in your rationale for recommending the learning of C++ before C#.

Quote:
If you want an IDE try Bloodshed Dev-Cpp, is free and you will be able to build and compile both C and C++ programs.
Dev-C++ lacks features and isn't up-to-date with modern editors. The free Visual C++ Express is by comparison an excellent and fully-featured product, but if for some reason you really don't want to use it code::blocks would be a better alternative than Dev-C++.

Quote:
Although C is not Object Oriented.
Are you implying that that's a bad thing? I wouldn't recommend anyone use C (unless they're working on a specific task for which it's the best option), but not being Object Oriented isn't neccesarily a bad thing.

Share this post


Link to post
Share on other sites
I would suggest, VERY STRONGLY, learning C++ as a first language (there really is not point in distinguishing C and C++ for the purposes of learning programming, as C has been pretty much replaced by C++ in virtually all areas -- and C++ basically is a glorified, upgraded version of C). It is, despite what many people claim, one of the quickest languages to learn and one of the easiest to use (until you get to advanced features and stuff). It also just happens to be by far the most common language in use in most fields of software development, from games to operating systems. C# and Java are slow running, inefficient languages with unnecessary complexities which slow the learning process and coding process as well.


[[ disclaimer: yeah, I know... I'm rather biased... sorry, this is just what experience has shown me]]

Share this post


Link to post
Share on other sites
First of all thanks for all the buddies who gave advices and suggestions.

Quote:

Hi, my recommendation is buy a good book of C++. One good is Beginning C++ Game programming, second edition from J. S. Harbour, another one great book is Game Programming All in One, third edition from the same author.


Thank you @ ejele012, i will find these books in the market.

I installed Visual Studio and also Microsoft Visual C++.
and it has GUI mode. so i think it would be easy for me to learn but guys as ejele012 told me to bye books. so my question is that books will help me in this product i mean Microsoft Visual C++, and is there any difference in syntax and commands in C++ and Micorsoft Visual C++. Please name the books related to Microsoft Visual C++. and one last question
What is DirectX as far as what i have researched i found that Directx gives 3D environment and also 3D games uses Directx if yes then Maya or 3D Studio Max that were also created in C. uses Directx commands to show 3D GUI Mode.


Finally Thanks yo Moderator and Kazgorath and Scet for their advices
Thank you

Share this post


Link to post
Share on other sites
Quote:
Original post by medevilenemy
[[ disclaimer: yeah, I know... I'm rather biased... sorry, this is just what experience has shown me]]
A simple look at the many topics from users having extreme difficulty with C++ should show you that your experience is actually unusual though. Yes, C++ is certainly not an unlearnable language, and there are people out there who find it relatively easy and are very comfortable working with it, but are you really comfortable 'VERY STRONGLY' recommending it as a first language to others when there are so many examples of others obviously not sharing your pain-free experience of learning the language?

Quote:
C# and Java are slow running, inefficient languages with unnecessary complexities which slow the learning process and coding process as well.
That's just plain flame-bait, you should know well and good that they don't run that slowly and that no beginner is actually going to be good enough at C++ to write a program that significantly (if at all) outperforms the versions they would be able to write in either C or Java. As for unnecessary complexities that slow the coding process, I'd have to say your experience is again unusual there; most people who advocate those languages do so largely because of the increased productivity that's possible.

Share this post


Link to post
Share on other sites
Quote:
Original post by medevilenemy
I would suggest, VERY STRONGLY, learning C++ as a first language (there really is not point in distinguishing C and C++ for the purposes of learning programming, as C has been pretty much replaced by C++ in virtually all areas -- and C++ basically is a glorified, upgraded version of C). It is, despite what many people claim, one of the quickest languages to learn and one of the easiest to use (until you get to advanced features and stuff).
Wow, I smell someone who has never bothered to even take one of my quizes, and who really doesn't have a strong understanding of the language he is touting.
Quote:
It also just happens to be by far the most common language in use in most fields of software development, from games to operating systems.
Which is no excuse for learning it first, in fact it's exactly why you SHOULDN'T learn it first, since that trend is not true. It may be used quite commonly in game development, however that is usually in conjunction with other languages (such as python or lua). Furthermore, the complexity of the language is such that most "professional" programmers barely have a clue about the expected standard behavior of the code they produce.
Quote:
C# and Java are slow running, inefficient languages with unnecessary complexities which slow the learning process and coding process as well.
Wow, congratulations. You apparently haven't been paying attention to the last several years worth of language development. Java and C# run very efficiently, very closely matching and sometimes exceeding the speed of C++ applications. There are a few areas in which they are weak, however even in those areas advancements are being made that are allowing them to quickly approach the speed of execution of C++. Considering the great amount of effort that has gone INTO the languages in making sure that they represent mostly defined behavior, without having gregarious areas of undefined behavior, like C++, the extra cost of execution speed is well worth the time saved in debugging, development, and deployment.

Share this post


Link to post
Share on other sites
Quote:
Original post by Washu
Quote:
Original post by medevilenemy
I would suggest, VERY STRONGLY, learning C++ as a first language (there really is not point in distinguishing C and C++ for the purposes of learning programming, as C has been pretty much replaced by C++ in virtually all areas -- and C++ basically is a glorified, upgraded version of C). It is, despite what many people claim, one of the quickest languages to learn and one of the easiest to use (until you get to advanced features and stuff).
Wow, I smell someone who has never bothered to even take one[/b] of my quizes, and who really doesn't have a strong understanding of the language he is touting.
Quote:
It also just happens to be by far the most common language in use in most fields of software development, from games to operating systems.
Which is no excuse for learning it first, in fact it's exactly why you SHOULDN'T learn it first, since that trend is not true. It may be used quite commonly in game development, however that is usually in conjunction with other languages (such as python or lua). Furthermore, the complexity of the language is such that most "professional" programmers barely have a clue about the expected standard behavior of the code they produce.
Quote:
C# and Java are slow running, inefficient languages with unnecessary complexities which slow the learning process and coding process as well.
Wow, congratulations. You apparently haven't been paying attention to the last several years worth of language development. Java and C# run very efficiently, very closely matching and sometimes exceeding the speed of C++ applications. There are a few areas in which they are weak, however even in those areas advancements are being made that are allowing them to quickly approach the speed of execution of C++. Considering the great amount of effort that has gone INTO the languages in making sure that they represent mostly defined behavior, without having gregarious areas of undefined behavior, like C++, the extra cost of execution speed is well worth the time saved in debugging, development, and deployment.


QFT.

C++ isn't popular in the gamedev industry because it's "good". It's popular because C compilers are trivially easy to implement on new platforms, and every few years, we get such a new platform in the form of a new console or handheld. As Washu points out, both C, and its bastard child, C++ have a hell of a lot of traps and pitfalls which regularly bite the unwary. It's certainly no accident that the rise of C++ in game development has also seen a similar drop in overall code quality in this industry.

If raw sales are your preferred metric for measuring quantity of code out there, I'd say J2ME is probably at least as popular as C++ in the games industry, if only because of its popularity in the mobile games sector.

The C family is a throwback to the 1970s and should be killed slowly and painfully. It is, thankfully, beginning to lose its popularity and I don't think it'll be such a major language in 5-10 years' time.

Both Java and C#, while based on C++ and C syntax, are fundamentally different languages. (Their bytecode-based foundations also makes the actual syntax less important anyway.) I therefore don't include either in my hand-waving rant above. I do feel Java has splintered into too many sects and factions causing a lot of confusion, although J2ME may be worth investigating as a possible starting point if you absolutely insist on using a popular gamedev platform.

That said, there are already commercial, professionally developed games out there built using higher-level tools like Unity and even BlitzMAX, so don't write these off. (I currently use the latter myself, but am learning Unity. I need to grok 3D graphics modeling first though.)

The important point is to learn programming first. Fixating on a particular language isn't healthy -- any decent programmer will learn dozens of programming languages over his career, often with more than one language used in the same project.

Finally: don't let the jargon fool you into thinking that "scripting" is anything other than programming by another name. The only real difference between a "scripting" language and the other languages is that scripting languages are usually interpreted in real-time, rather than compiled into machine code (or byte-code) before being run, so they're often a bit easier to debug. (The only exception is Perl, which was designed by masochists, for masochists and appears to be the only Brainf**k-like programming language to have actually gained some traction in the real world. It certainly beats the mighty C++ when it comes to cruel and unusual punctuation.)

Share this post


Link to post
Share on other sites
Quote:
Original post by Washu
Quote:
It also just happens to be by far the most common language in use in most fields of software development, from games to operating systems.
Which is no excuse for learning it first, in fact it's exactly why you SHOULDN'T learn it first, since that trend is not true. It may be used quite commonly in game development, however that is usually in conjunction with other languages (such as python or lua). Furthermore, the complexity of the language is such that most "professional" programmers barely have a clue about the expected standard behavior of the code they produce.


Quoted for truth. I really wish one of these posts would go by without having to reraise this point yet again.

Share this post


Link to post
Share on other sites
I definitely agree that c itself should finally be put out of it misery, but C++ is nowhere near the end of its usefulness. My guess is that it will probably continue to be a major language for another 20 or 30 years, in one form or another. It is just way too adaptable to die out quickly. Anyway, there is supposed to be a new C++ standard coming in a couple years (although I bet it will probably take a bit longer than expected), which should revitalize it somewhat.

Just my $0.02


Oh, and I'm sorry about my previous post. It was very poorly written, and I should have been more careful (thats what I get for writing a post in the middle of a noon physics lecture). It really didn't seem like flame-bait at the time... but then again I was hungry and incredibly bored.

Share this post


Link to post
Share on other sites
Quote:
Original post by medevilenemy
It is just way too adaptable widespread to die out quickly.


Image Hosted by ImageShack.us Fixed. C++ is not a terribly versatile or good language -- horrible metaprogramming support, bloated compile times, and a standard so complex no two compilers treat C++ the same -- which, given that every other sentance of the standard seems to be saying something or other is undefined behavior, is rather problematic.

Even conceeding the point that C++ still has a place in the world for the moment, that doesn't make it a good language to start with, regardless, especially in lieu of the above. For learning programming, you want a language that isn't distracting. One that's consistent, agile, and safe. C++ is in fact the very poster child of the very opposite of each of these.

[Edited by - MaulingMonkey on May 4, 2007 7:21:07 PM]

Share this post


Link to post
Share on other sites
Your first Game Over program.

Open your Microsoft Visual C++ (could be express or pro).

Go to File -> New -> Project.

In project types choose Win 32 and in Yemplates Choose Win32 Console Application. Type GameOver in Name and unmark create directory for solution.

In the application wizard -> application settings mark console application and empty project in additional options. Let tho option of precompiled headers check. Click finish.

then you have to add a file. Right click over source files, choose Add -> New File. There choose C++ file and type in name "Main.cpp" (Visual C doesn't handle very well the .c files).

Type this code in:

// Game Over program.

#include <iostream>

int main()
{
std::cout << "Game Over" << std::endl;
return 0;
}

press CRTL + F5.

There you go, your first C++ program.

Share this post


Link to post
Share on other sites
By the way.

C, like many other languages is not Object Oriented, this is not a bad thing. Almost every C program can be build and compiled under any C++ compiler. But, if you are a newbie I encorauge you to learn OOP, It'll make your life easier.

Java, C# and others languages are Object Oriented too.

Dev-Cpp is and IDE, it use the Gcc compiler, which is use under many OS like Win, Unix, Linux and even Mac. Microsoft Visual C++ work only under Windows and is the best option to program under Windows and DirectX (is made by the same people ;-)

DirectX is a game library crated by Microsoft, very powerful and almost every big game is made with C++ and DirectX. Start with C++, learn the basis and then move onto DirectX.

My advise, just try it, start reading, looking in the net and asking. Install all of this and try each one, Dev-Cpp, Codeblocks and Visual C++ Express. They are all Free! They all have pros and cons, I have installed in my machine Dev-Cpp with Allegro and Visual C++ Express with DirectX. Is just a matter of taste.

Start programming and good luck.

Share this post


Link to post
Share on other sites
Quote:
Original post by Washu
Wow, congratulations. You apparently haven't been paying attention to the last several years worth of language development. Java and C# run very efficiently, very closely matching and sometimes exceeding the speed of C++ applications. There are a few areas in which they are weak, however even in those areas advancements are being made that are allowing them to quickly approach the speed of execution of C++. Considering the great amount of effort that has gone INTO the languages in making sure that they represent mostly defined behavior, without having gregarious areas of undefined behavior, like C++, the extra cost of execution speed is well worth the time saved in debugging, development, and deployment.


well i don't know about C#, alot of products i have used seem to be very slow and buggy that use Java(Zend Studio being the big one). I am not sure if it is java or if it is the programmer but i just don't liek things developed with java. I also don't think java comparable with C++ as in they are meant for different things just like C++ and PHP are not comparable.

Share this post


Link to post
Share on other sites
A starting programmer should never do C++ to learn programming (unless the person likes pain of course). It's hell, and C is more hell. C# would do just fine for beginners, and maybe C# will overthrow C++ as the "overall standard general-purpose language" in existence. Then again, there'll always be people who'll use a certain language, and there'll be support, and 'sides that C++ is continually evolving if I'm not mistaken.

Personally -- as someone who starts and stops learning programming on and off usually due to hardly seeing some big-ass progress and worthy productive results -- I am stuck in-between, with learning C++ and random libraries, and C# (with any library I can find... must check out XNA). That means I'm not getting stuff done.

Even quickly getting a compiler to work with the installed library can sometimes be pain, and drain your productivity and/or learning progress from the moment you (freshly) (re)start. It almost forces me to just drop the whole thing 'cause I've been more patient than Buddha :P

If I could find good books and/or other sources to PRODUCTIVELY and EFFECTIVELY learn C# and game programming, I'd do that, but so far -- or maybe I haven't looked right -- I didn't find any. So I'm just lingering a bit making rubbish using C++ one little step at a time. Now, if I could get that goddamn compiler to work with SDL, I'm sure I'd be doing more useful stuff.

Share this post


Link to post
Share on other sites
Quote:
Original post by Bijo
Even quickly getting a compiler to work with the installed library can sometimes be pain, and drain your productivity and/or learning progress from the moment you (freshly) (re)start. It almost forces me to just drop the whole thing 'cause I've been more patient than Buddha :P
BS. Every library works the exact same. You specify your paths in your IDE or compiler path setup, and input the library name sin the IDE or command line. Then the linker will find the correct .lib (or .a) files to link with. It's dead simple, and it works the same every time.

Share this post


Link to post
Share on other sites
Quote:
Original post by ejele012
Dev-Cpp, Codeblocks and Visual C++ Express. They are all Free! They all have pros and cons
In your mind, what are the pros of Dev-C++? I can come up with an extensive list of cons, but the only thing I can come up with remotely in its favour is a relatively small file-size.

You also didn't answer my above question: What's your rationale behind suggesting a beginner learn C++ prior to C#?

Share this post


Link to post
Share on other sites
Well, this is getting out of topic now.

The last decision for Smart Invincible about what language to learn is only yours. Look at this article:

http://www.gamedev.net/reference/design/features/whatlang/

I´m not selling and IDE, I just like Dev-Cpp, although I use Visual C++ Express and Visual C# Express. Try, use and stick with what you like the most.

C# is based on the .NET technology, which is developed by Microsoft (over Linux you have the .MONO). This technology is relatively new and it takes advantage of powerfull pc. Is slower than C/C++ and it needs a faster cpu and more RAM than C/C++, so, talking about portability C# is very restricted.

For this reason a C# program won´t run in machines running Win 98 or any other OS than Win 2000, XP or Vista. A C/C++ program is going to run over every machine and OS (well, almost ;-)

If we talk about game programming, you´ll find more support over C/C++, you have many libraries for this language, from DirectX, OpenGL to Allegro and SDL just to name some.

Over C# you had Managed DirectX, Microsoft announce that this libraries wouldn´t have more support and they will move to XNA Framework, this technology is very new and the support is very sparse. And a program made with XNA needs a very powerfull PC, belive me, if you don´t have a graphics card with pixel shader 1.1 support forget about it.

Look at the minumun requirements:

"Supported Operating Systems: Windows Vista; Windows XP Service Pack 2
Supported on Microsoft Windows XP SP2 (all editions) and Windows Vista.

A graphics card that supports DirectX 9.0c and Shader Model 1.1 is required. (Shader Model 2.0 is recommended and required for some Starter Kits.)"

Why you should learn C++?

Because is one of the top languages, as I said, almost every great game was made with this language, almost every big company use it to develop, a program made in C++ could run under Unix, Linux, Mac and Windows. You could get bad habits learning C first, although is out of date. C# is a great language, very powerfull. If you learn C++, you could move to C# very easily.

Keep reading, looking and asking.

Happy coding.

Share this post


Link to post
Share on other sites
Quote:
Original post by ejele012
C# is based on the .NET technology, which is developed by Microsoft (over Linux you have the .MONO).


Minor nitpick: it's "Mono", and not ".MONO", and it's available on OS X as well.

Quote:
This technology is relatively new and it takes advantage of powerfull pc. Is slower than C/C++ and it needs a faster cpu and more RAM than C/C++, so, talking about portability C# is very restricted.


Minor nitpick: C/C++ is not a language.

I disagree on the very part. Any computer or PocketPC built in the last five years could run C# programs, C programs and C++ programs with equal ease, except for the most performance-hungry (such as MPI-parallelized numeric analysis programs written in C).

Quote:
For this reason a C# program won´t run in machines running Win 98 or any other OS than Win 2000, XP or Vista. A C/C++ program is going to run over every machine and OS (well, almost ;-)


This is completely false.

First reason why it's false: give me a program (which you may compile from either C or C++ source, your choice) and have it run on Linux (any flavor), Windows (any flavor) and OS X (any flavor). Then, explain to me how you managed to get around the ELF header differences between these platforms without recompiling your program. What you meant is, A C or C++ program can be compiled for virtually any machine and OS, which is a slightly different detail.

Second reason why it's false: a C# program, once compiled, can run on any platform with .NET or Mono running. This means that any Windows (including 98, if anyone still uses this), any recent PocketPC, any OS X and any Linux can potentially run your program. And the latest XBox as well. Without recompiling. Not only that, but it will be optimized for every single platform, too. This is a much better version of portability than recompiling from code.

Quote:

If we talk about game programming, you´ll find more support over C/C++, you have many libraries for this language, from DirectX, OpenGL to Allegro and SDL just to name some.


DirectX, OpenGL, SDL and Allegro are also available on C#. In fact, DirectX support and IDE integration for C# are better than that of C++. Also, have you tried using DirectX from C? It's painful, to say the least.

There are, however, libraries for C and C++ users that do not have C# bindings. Yet.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this