I did my very first code and I feel quite accomplished. Any tips for keep on going?

25    14 Feb 2016 00:48 by u/xStoka

Hello, I've been reading "Beginning C++ Game Programming." And to be honest, I feel happy for being able to write a code. Any advice to keep on going? What is the possibilities I might face on this journey?

// Game Over
// C++ using a directive approach 
#include <iostream>
using namespace std; 
int main()
{
    cout<<"Game Over! Reddit"<< endl ;
    return 0;
}

14 comments

6

Try to learn good commenting habits now rather than later. Its easy to write too much and end up writing comments for everything but as long as you keep it neat and simply remember to ask yourself "do I need to explain this?" you should be fine, if you need to write an essay write an essay but just keep it sensible and on topic. You might not need a comment for a variable with a simple name like distance but if you were to take the variable pass it though a function then store the output of that function as something like "float distB; " then it might be wise to say //is product of function whatever// just to save yourself having to scroll up and down through your own code to find out whats going, you will end up spending a lot of time trying to figure out why your code isn't working so clear succinct commenting helps.

Beginner code should be clear and logical to anyone even someone with zero coding experience as long as the comments are on topic and laconic. Commenting is as much for yourself as it is for someone else reading your code, future you might spend more time than you should trying to figure out what was going on in your own code so learning these kinds of habits becomes important fairly quickly.

1

Keep coding. Find random things to code. Try a few languages before you settle on one. Find what each language is good for and terrible for. Learn the different coding standards that are popular and learn what makes code readable and makes code look good. Try some different IDEs. Try some different operating systems (can have a surprising affect on code development).

1

Don't stop.

0

Best advice I can give is to find other people's code listings and type them in. Don't copy and paste and run it (although this can be good to try to rule out typing errors). Type it in. You'll be more inclined to understand what your typing in, or at the very least analyzing it to see what makes it tick. This is how most of us learned back in the '70's and 80's (and probably before that as well). When you type in someone else's code, you get a better understanding of how it works. Then modify that code. See what it does when you change things. Incorporate what you've learned into your own projects. At some point, you'll write some original code, publish it, and other's will learn from you. We all learn from each other. The important thing is to have fun with the code. Make it do crazy stuff. That machine sitting in front of you was made to be bent to your will. Programming a computer gives you god-like powers. Or at the very least a great sense of accomplishment that you can show off. :)

0

My sole advice on keep going is keep going. Here are two websites that might help you practice: https://projecteuler.net/ and http://www.spoj.com/. Start from project Euler and solve all the questions. If you are stuck, you can always find solutions on Internet but first try everything yourself.

0

Find problems you are interested in solving and solve them. Python is considered an easy language to begin with and codingbat.com/python has some good introductory tutorials. There are a lot of directions you can go and find what interests you because that is what you will do more of, and the more you do something the better you will get at it.

0

Do some old games! It's so much fun just to try and recreate some classics like Tic-Tac-Toe, Lunar Lander or Kalaha, and more educational than most textbooks. You'll also pick up some good math skills and variable understanding when you design an opponent, you play against.

Also, buy some good textbooks that are physical. They are often better than the internet, because you'll be focused more when you read them, than when you are surfing(otherwise, you'll watch a movie, listen to an album, receive private messages, torrenting, cracking and PM'ing etc., all distracting you).

0

If you enjoy maths at school, you might try working on the Collatz Conjecture. This should be within your ability level right now, or very soon. Of course the conjecture is well studied, but the nice thing about it is that there are almost certainly areas where an amateur might find something new. In particular, the controlling parameters are 2, 3 and 1 (divide by 2, or multiply by 3 and add 1). Once you've worked out how to deliver some basic answers, try changing the controlling parameters and see what happens, or add more simple steps to the basic process and see what happens then. It won't take long till you're in unknown territory, and have a chance of finding something that no-one else has ever seen.

-3

You are at my grandmothers level, and she sucks at programming.

2

Well, at least, we cannot deny that you wouldn't be here if it weren't for your grandmother. I would say it is the same as ASM; if ASM didn't exist, then you wouldn't have all the software you have now.

1
org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Game Over! Reddit',0Dh,0Ah,'$'
0

I made a mistake

org 100h
mov dx,msg
mov ah,19
int 21h
mov ah,4Ch
int 21h
msg db 'Game Over! Reddit',0Dh,0Ah,'$'