Unreal friendly naming

I decided to do a Shadowrun riff for this, my code and story thus far!

Uploading: Screen Shot 2019-06-01 at 9.36.59 PM.png…

My TripleX so far.

My Triple X so far

Giving variables meaningful names helps you and other coders understand the purpose of the code and helps in the readability of the code. Self documenting code helps to organize your thoughts as you have to think of how to explain the purpose of those lines of code in a brief explanation without cluttering your code in comments.

I’ve added some extra lines for the readibility

1 Like

i renamed variable a, b, c with codeA, codeB, codeC. i think it will make me or someone who read my script understand what my variables use to be

1 Like

I do stick to unreals naming standarts, and I think it is a good idea to let a bool begin with a “b”. But I honestly prefere Unitys camelCase for variables and PascalCase for methods.

This is my TripleX program so far:

To me, good naming is essential to making heads or tails of my work. Its helps me stay neat and organized, and allows anyone else viewing my work to understand at what they are looking. Its the same thing with self documentation within the code; It aids in understanding the purposes and “train-of-thought” that is involved within the code.

It’d be way easier to another person to understand our code, and when the project gets bigger and bigger, you might want to remember some things about what you’ve coded.

Also, here’s my program right now. Plot is embarassing though hahaha.

Good naming matter in order to avoid orselves some confusion while reading our code, and evenmore to other working that code, this can be partially avoided by choosing good names for our variables, as this will cause our code to self-document(it will explain itself to the reader without the need of any comment).


The main advantage of naming variables is the fact that the code looks much cleaner than before, making it easy to be read by someone who is examining it.
Writing comments has its purpose as well, since when we write comments we explain what we are doing.

Good naming conventions is good for readability, and self documenting helps you or code maintainer to understand what the code does.

Give a meaningful name is important because it easier to debug and for other people to understand

Good naming makes the code more easier to understand, even if someone is looking at code first time. It gives information what each variable contains and what it’s used for.

Documenting code help use more easily to continue where we left after while and understand what our code does. It helps other people to understand the code more easily.

But first, here’s a screenshot of the output of my code currently:

Good naming is important so that when you go back to your code after a while you know what your code actually did. It is most important for the other coders that will look at your code because other coders need as much context as possible to understand what your code does.

#include <iostream>

int main()
{
    //Print welcome messages
    std::cout << "You are waiting in line to board your airplane.";
    std::cout <<std::endl;
    std::cout << "As you arrive at the front of the line, the airline officer checking boarding passes informs you that you must complete a puzzle in order to board as part of new TSA regulations...";
    
    //declare 3 int variables
    const int a = 4;
    const int b = 2;
    const int c = 3;
    
    
    //now we assign the sum and product
    const int sum = a + b + c;
    const int product = a * b * c;
    

    std::cout <<std::endl;
    std::cout <<"There are 3 numbers in the code" <<std::endl <<std::endl;
    std::cout <<"The sum is: ";
    std::cout <<sum <<std::endl;
    std::cout <<"The product is: "<<product <<std::endl;


    return 0;
}

Privacy & Terms