Advertisement

Absolute beginner to C. Need help

Started by May 16, 2017 03:33 AM
5 comments, last by Budowalski 7 years, 6 months ago

Hey everyone. I'm a absolute and complete beginner when it comes to coding in any sort of C language. So, here are my questions for you guys:

1.) What programming language should I use for game development? I know there are several variations of C, like C++ and C#, but I have no idea what the differences are and the advantages of each kind.

2.) Where should I actually write my code? I use Notepad++ for HTML and CSS and that sort of thing, but I don't know if this is what I should use.

3.) What is a compiler and how does it work?

4.) Is there any program that you guys find useful for programming that I should have?

If you guys answer these questions, I would also love to have your advice for any small projects I might want to try. Also, information about other programming languages would be greatly appreciated.

Thanks,

-Sgt Andrew

1) C# and C++ are not variations of C, they're completely different languages with completely different mindsets. Sure, there are similarities but they quickly disappear once you go past anything trivial. Both C++ and C# are used for game development, but if you're just beginning don't care about C++ at all and start with C# and Unity.

2) You can, of course, write everything in Notepad++ or any other text editor, but there are specialized programs for programming called IDEs (Integrated Development Environment). IDEs offer a lot of tools that make your job a lot easier. A very popular IDE for both C# and C++ is Visual Studio.

3) The code you write in a file is not the actual code run by the computer. Computers understand only sequences of 0 and 1, so in order for a computer to run your program, it must transform the code you write into 0s and 1s.This process is called compilation and the program that performs it a compiler. There's more to it, obviously, but this is the general idea.

I'd suggest reading up on version control, what it is and why it's useful.

If, when you read good code or design practices etc, you find an article that tells you "X is bad, do Y instead" and you don't understand why or you intuitively find X to be better, don't blindly do Y without understanding why. It's better to do X and see for yourself why X is bad and why Y is better.

Don't start big; start small, with reasonable aims. Big is going to come, eventually.

PS. You can also read the FAQ.

Advertisement

Welcome,

You seem to have missed the "Beginners" forum, which has a Topic about questions like yours. You can find it at

https://www.gamedev.net/reference/faq.php/_/for-beginners-r1

1.) What programming language should I use for game development? I know there are several variations of C, like C++ and C#, but I have no idea what the differences are and the advantages of each kind.
There is also a language called "C" :)

C and C++ languages are closely related. C is an old language for programming, it's quite simple, but very powerful. Big disadvantage is you have to write a lot of code to get anywhere. Second disadvantage (for a beginner) is that the language assumes you knows what you're doing. It doesn't guide you, and it doesn't stop you from shooting yourself in the foot. As such, not really recommended to start with, imho. C++ is C on steroids. Much less simple, much more powerful, much more easy to get yourself in trouble, and a very steep learning curve. Also not beginner friendly.

C# has nothing to do with C and C++. The name was a marketing trick by Microsoft. It's a totally different language. It's much closer to Java and Python. All three languages (C#, Java, and Python) are good for beginners. Python is a little simpler, but runs a little slower.

2.) Where should I actually write my code? I use Notepad++ for HTML and CSS and that sort of thing, but I don't know if this is what I should use.
Text-editor works, but you may want to consider switching to an IDE. Basically, it's a text-editor, but it knows the language too, so it gives you auto-completion, you can jump around to definitions and search for uses. I guess it's something you can try, and see if it works for you.

3.) What is a compiler and how does it work?
A compiler translates the text that you write, and converts it to numbers that the computer understands, so it can execute what you wrote.

The short explanation of how it works is "by magic", and that's mostly the level that you need in general. The longer explanation is that there is no magic involved, it is a sequence of taking your text, scanning and tokenizing it, parsing and type-checking comes next, and then you have a few code-generation and optimization steps, and you get a big bunch of numbers, which are generally known as "exe file".

I write these compiler things (small versions of it), and we can discuss it one day, but it helps a lot if you can do some programming first, so you have some idea of the context. Until that time, see it as a magic box that transforms your text into an "exe" file.

4.) Is there any program that you guys find useful for programming that I should have?
An editor that you like, and all sort of tools around it. For each task there are several options for all the major platforms. Different people have different preferences, and different tools are strong at different parts, so likely, you'll collect many tools :)

If you guys answer these questions, I would also love to have your advice for any small projects I might want to try. Also, information about other programming languages would be greatly appreciated.
The FAQ should answer this mostly, a commonly linked article is

https://www.gamedev.net/resources/_/technical/game-programming/your-first-step-to-game-development-starts-here-r2976

which has a list of game programs as well.

Lots of exploration to do! Enjoy!

Moving to For Beginners.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Hello Andrew,

I would recommend you do the following

1. Report to MVA and do the beginners C# Tutorial

2. In MVA complete the Building Blocks Game Development Course (This will give you a high level overview of Unity and C# in Unity)

3. Return to Unity3d and complete the Tutorials in the Interface and Essentials section

4. Complete the Rollerball Game Tutorial

This will by no means make you a capable game developer, but it should give you a good start. This will help you get familiar with the tools and skills that are required to become a capable game developer.

The Quarry Works Creed

We who shape mere stone must always envision cathedrals

The answer is it depends. On what type of game you are writing, on how complex it will be etc.

If you don't currently know ANY computer language, I suggest you start with C. Then learn C++, since it really is C++ (the ++ is the increment operator in both C and C++ and many other languages too). C/C++ will give you a good foundation in programming, since they are the most supported, most widely known, and probably the oldest languages in common use. Neither of them are going anywhere, unlike other flavor of the decade languages. (ahem FOXPRO).

Advertisement

Start with C# and Unity. It's free and scales well with your skill. It's easy for beginners but can be used also for pro games. C++ is very hard in comparison but around 10x faster than C#. You will not need that performance edge for a long time. It matters only in largest games. In Unity you can also write plugins in C++ if you badly need speed. In Unity you should use Microsoft Visual Studio Community for writing code. It's also free. Compilers translate human-readable code to machine-readable.

This topic is closed to new replies.

Advertisement