THREAD: How To Program
  1. 03-01-2013, 07:57 PM
    Pichu's Avatar
    Pichu
    RIP PICHU.
    Pichu's Avatar
    Pichu
    RIP PICHU.
    6,550
    Posts
    34,645
    Reputation
    Jan 2011
    NextGenUpdate
    Understanding this has been changed via the link, this is not my site: You must login or register to view this content.

    It appears it's been added by a Mod to whom they feel it is relevant enough. I have nothing to do with that site, but I will leave it there.

    You must login or register to view this content.
    You must login or register to view this content.
    You must login or register to view this content.
    You must login or register to view this content.

    Some extra sources, I'll add more to the list. Some of these will be paid courses, some will be free sources, some will be reference sites. If the list grows longer, I'll categorize them.
    Last edited by Pichu ; 10-10-2015 at 08:17 AM.

  2. The Following 25 Users Say Thank You to Pichu For This Useful Post:

    , , , , , , , , , , , , , , , , , , , , ,

  3. 03-08-2013, 12:37 AM
    Pichu's Avatar
    Pichu
    RIP PICHU.
    Pichu's Avatar
    Pichu
    RIP PICHU.
    6,550
    Posts
    34,645
    Reputation
    Jan 2011
    NextGenUpdate
    Website fixed and operating again. Smile
    Last edited by Pichu ; 03-08-2013 at 05:54 AM.

  4. 03-08-2013, 04:09 PM
    Sloth's Avatar
    Sloth
    Banned
    Sloth's Avatar
    Sloth
    Banned
    1,494
    Posts
    42,948
    Reputation
    Feb 2010
    NextGenUpdate
    Originally Posted by Pichu View Post
    Website fixed and operating again. Smile

    It's an honor to have you in NGU's coding scene.

    I have donated $3 and also if your going to provide code show it as a picture not text because the best way to learn is to type it out yourself, otherwise you'll just get a bunch of people C + P without understanding how it works.

    I love your work man hopefully I can work with you on a big project someday I'm learning C++ and Java and obviously C# from you.
  5. The Following User Thanked Sloth For This Useful Post:


  6. 03-08-2013, 06:20 PM
    Pichu's Avatar
    Pichu
    RIP PICHU.
    Pichu's Avatar
    Pichu
    RIP PICHU.
    6,550
    Posts
    34,645
    Reputation
    Jan 2011
    NextGenUpdate
    Originally Posted by KronosCloud View Post
    It's an honor to have you in NGU's coding scene.

    I have donated $3 and also if your going to provide code show it as a picture not text because the best way to learn is to type it out yourself, otherwise you'll just get a bunch of people C + P without understanding how it works.

    I love your work man hopefully I can work with you on a big project someday I'm learning C++ and Java and obviously C# from you.


    Thank you, well at this point it's just implementing the main idea behind C# programming. In a few more tutorials I will start the actual code tutorials.

    The reason why I won't do pictures is that people can just type without realizing what it is that they are typing and, well just type.

    Pictures will also cause me problems down the road because I'd have to position each and every one and just using a little CSS like I am now, it makes it look more professional and better.

    In the end, it's not me that can ultimately teach you; it's you who can teach yourself. Anyone can be handed a book and read it, only those who go through it step by step and learn the process are the ones will will succeed.

    I'm thinking Java will be the next area where I make tutorials.
  7. The Following User Thanked Pichu For This Useful Post:


  8. 03-09-2013, 12:38 AM
    Specter's Avatar
    Specter
    Pro Memer
    Specter's Avatar
    Specter
    Pro Memer
    921
    Posts
    44,457
    Reputation
    Aug 2012
    NextGenUpdate
    Nice Pichu, I'm starting to learn some C# and I will find this very useful. As you said to me before, its more beneficial to know C# than VB.
  9. 03-09-2013, 04:59 AM
    Pichu's Avatar
    Pichu
    RIP PICHU.
    Pichu's Avatar
    Pichu
    RIP PICHU.
    6,550
    Posts
    34,645
    Reputation
    Jan 2011
    NextGenUpdate
    Originally Posted by JcJedi View Post
    Nice Pichu, I'm starting to learn some C# and I will find this very useful. As you said to me before, its more beneficial to know C# than VB.


    It's even better to know both. The two are essentially the same, some industries prefer one over the other because of how it looks.

    This is basically the difference: You must login or register to view this content.

    C# just makes it a lot easier to get into learning languages like Java simply because it is so similar.

    C# is OOP and OOD, Object Oriented Programming and Object Oriented Design, Java is only OOP.

    ---------- Post added at 08:59 PM ---------- Previous post was at 07:33 PM ----------

    I am debating on whether or not finishing up Chapter 2 tonight.

    Chapter 2 will finish off with Constructors and Methods, Operators and Classes.

    Chapter 2 will be the last chapter I release on NGU. Afterwards, you must use my site to get the rest of the tutorials. Just a heads up people. Chapter 3 involves getting into the real bit of programming.

    Also, thank you to those who decided to send me a few bucks my way, the money really helps me out with costs in real life as it takes 30 minutes to an hour to just write a tutorial or two.
  10. 03-10-2013, 10:12 PM
    |C++|'s Avatar
    |C++|
    < ^ > < ^ >
    |C++|'s Avatar
    |C++|
    < ^ > < ^ >
    1,252
    Posts
    1,850
    Reputation
    Feb 2011
    NextGenUpdate
    Originally Posted by Pichu View Post
    These tutorials are still being worked on, as I make them I will post them here. You can view these tutorials on my site & Help Support Me:
    You must login or register to view this content.

    All that is in this guide is written by me. Please, if you wish to use it somewhere else, PM me first and I will determine whether or not I consent to it being used elsewhere.

    To Save Room, I will be posting the video versions here. The text versions will be on my site.

    [multipage=Chapter 1]
    1. A brief history of C#
    2. What is a program?
    3. How does a computer work?
    4. What is the Software Development Methodologies
    5. Errors in program
    a. Compiler Errors
    b. Run-Time Errors
    c. Logic Errors

    [multipage=A Brief History of C-Sharp]



    [multipage=What is a program]



    [multipage=How does a computer work]

    You might be wondering, what makes a computer work? A computer is composed of several different components that interact with one another in order to operate. A modern computer consists of the following components:

    1. One or more processors
    2. Memory
    3. Secondary memory, (Hard Drives)
    4. Input devices, (Keyboards, Mouse)
    5. Output devices, (Monitors, Speakers)

    A computer has a processor, also known as the central processing unit (CPU), and memory, (RAM or Main Memory). The processor is responsible for executing instructions in a program; it stores programs temporarily while they are running on the processor. Aside from RAM, computers need a place to store information, to do this they write information onto the hard drive, (hard disk).

    Say you were to create a text file, when you open up the text document, the RAM on the computer sets aside memory and will actively process the application. Any information that is contained within this application, in its current state, can be lost if the computer were to shut down. Information that is currently held in RAM memory is volatile. If you were to save the information onto your desktop for example, the information at that point in time is now nonvolatile because it is stored. Information that is nonvolatile will not be deleted if you were to shut down or restart your computer.

    Have you ever wondered what your computer would say if it could speak? Well, if computers could speak, they would speak in 1’s and 0’s. Computers have their own language, Machine Language. Machine Language is composed of 0’s and 1’s, each of these values are called bits. A sequence of these bits will form an instruction that tells the computer what it needs to do. If we were to combine eight of these bits, we would form a byte.

    A program may contain millions, possibly billions of bits. Imagine being a programmer and having to type each digit individually, well this is why high-level programming languages were developed. High-Level programming Languages allow source code to be compiled using a compiler which converts the source into binary so the computer can understand the set of instructions within the program and carry them out.

    [multipage=Software Development Methodology]

    A Software Development Methodology, also known as the System Development Methodology, in software engineering is a framework that is used in order to structure, plan, and control the process of developing and information system. This is the process to define what is needed and the processes programmers much go through in order to develop software from the beginning of a project to the an end, full release.

    A common method in programming is the following:
    1. Define a problem
    2. Design an algorithm in order to solve that problem
    3. Develop the program code from the algorithm
    4. Test and ensure the code’s correctness
    5. Maintain the code

    Testing the program several times in different environments is a great way to ensure the correctness of your code. If the output appears to not be what is intended, there may be a flaw in the source code. Once you have finished testing, the software should be ready for release. Be warned, the product you have developed may still contain errors that you may not have been able to detect.

    [multipage=Errors in Programs]

    When you begin to write your own programs, you will come across three main types of errors, (bugs): compiler errors, run-time errors, and logic errors.

    [multipage=Compiler Errors]

    A compiler of a program will generate an output that the machine can understand. Most modern compilers will check the source and attempt to find any errors within it. If errors are found, the compiler will halt and will print out corresponding error messages. The error messages that the compile produces is called compiler errors, (compile-time errors or compilation errors).

    Say in C#, we were to try and compile to line:

    Console.WriteLine(“Hello)

    You would notice that when you attempted to compile, an error had occurred. The compiler would notice that you are missing a closing quotation mark for the string and a semi colon which tells the computer that we would like to end the statement.
    After correcting the line, we would end up with:

    Console.WriteLine(“Hello");


    You will now notice that if you were to compile the source, that error that previously appeared is gone.
    The cause for such errors generally related to misspelled keywords, incorrect class names, and method names. Improper punctuation within a source is another key mistake that programmers make. Most compilers will produce an error to let the programmer know where the error is located. As the programmer, it is your job to correct these errors and to recompile the program until no errors exist and the program compiles properly.

    [multipage=Run-Time Errors]

    A Run-Time error is an error that occurs while a program is executing. The computer itself can detect when an error has occurred in a program, these types of run-time errors are prematurely terminated and will often times force a diagnostic message to appear on the screen.

    As a programmer, if you want to display an image of a person smiling in an Image Box when the application loaded. You believe your source code is right and decide to debug the application. When it loads, you notice that the image you want to display cannot be found and error is produced. You notice that in the source, you accidently designated the wrong directory to that image and because of that, the application didn’t run properly. This would be a run-time error.

    [multipage=Logic Errors]

    Logic errors occur when an algorithm used in the program is incorrect. The program may execute normally however, the expected output will not be what is expected. Most logic errors can be detected by computing the result manually and comparing it with the output of a program multiple times over.

    To identify errors in a program, developers often use debugging tools, debuggers. A debugger will ‘step’ through a program one statement at a time and allow the developer to examine the results of each step. Debugging can be manually by placing breakpoints in code or creating an output that will allow you to see and trace how the program is executing.

    [multipage=Chapter 2]
    1. Primitive Data Types
    2. Declaring and Initializing Primitive Variables
    3. Identifiers
    4. Literals
    5. Strings
    6. Comments
    7. Constants
    8. Assignment Statements
    9. Conversion and Casting
    10. Using Constructors and Methods
    11. Operators
    12. Classes
    13. Objects

    [multipage=Primitive Data Types]
    Primitive Data Types is a form of data that is provided by a programming language. Two forms of Primitive Data Types exist, basic and built-in types. A Basic Type of data is a data type that serves a basic building block and is provided by a programming language. A Built-in Type of data is a data type that provides built-in support and is provided by a programming language.

    Within C#, you will come across different variables that store values. These values exist as: byte, sbyte, shrot, ushort, int, uint, long, ulong, float, double, object, char, string, decimal, bool, DateTime, DateSpan.

    1. An Integer is a number that can be written without a decimal point or a fraction. Integers can be: 1, 55, -38, 4444 and any other number as long as it is a whole number. Integers can be represented using other primitive data types such as: int, byte, sbyte, short, ushort, long, and ulong.

    2. A Floating-Point number is any number that contain a decimal point. Unlike integers, Float-Point numbers require the decimal suffix and must appear as the following, 0.0. A Float-Point can be represented using other primitive data types such as float, double or decimal. If you choose to use float, you must include the character ‘f” afterwards for it to be valid, 0.0f.

    3. A Character is a single letter of the alphabet, digits, or symbol. The char data type is used to hold only one value.

    4. Boolean Type values, bool, are either true or false.

    [multipage=Declaring and Initializing]
    Primitive Variables are declared by specifying its data type and following it with a name. To declare an integer variable, you must first define its types and provide a name.

    int number;


    In order to use a variable, you must assign an initial value; the assigning of an initial value is called initialization.

    number = 5;


    Variables can also be declared and initialized on the same line.

    int number = 5;


    A variable can also be declared as a floating-point variable of type float. We will
    declare and initialize the variable name num2 and initialize it with the value 10.3:

    float num2 = 10.3f;


    A variable with the type float requires an ‘f’ at the end of a number, a double does not.

    double num3 = 55.2;


    A long requires a suffix of the letter ‘L’ after the number.

    long num4 = 90000000L;


    Character data must be enclosed in single quotes. To store the value c in variable mouse we would do the following:

    char mouse = 'c';


    Character data cannot hold more than one character due to pre-defined memory allotment for the Primitive Type char.

    char mouse = 'cm';


    bool, (Boolean) can either be true or false.

    bool flag = true;

    [multipage=Identifiers]
    An identifier is the name given to a variable, class, method, or namespace. Identifiers can contain most characters. There are limitations and guidelines that must be followed with Identifiers:

    1. Identifiers cannot contain spaces
    2. Identifiers should start with a letter
    a. Although the characters _ and $ are acceptable, it is considered bad programming practice to start with them.
    b. 4ever is not allowed, $4ever is as is Fourever
    3. To replace the spaces, use the underscore
    a. Hello_This_Is_A_String
    4. Identifiers are case sensitive
    a. Hello is not the same as hello
    5. You cannot use keywords, (reserved words) as an identifier.
    a. The use of string, int, long, etc will result in an error

    When creating an identifier name, keep it short and meaningful. There is no use for extremely long names that are hard to remember. If you do wish to use multiple words for the name in an Identifier, capitalize each word:
    1. TutorialsMadeSimple is more legible than tutorialsmadesimple



    [multipage=Literals]
    A literal is a fixed value used within a program such as a number or character.
    Examples of literals can be the following:

    Int TutorialsMadeSimple = 455;
    Float MakeMeLaugh = 3.4f;
    Bool AmISmart = false;
    Char modulus = ‘%’

    The literals are the values on the right-hand side of the assignment. The different literal values are, 455, 3.4f, false, and %

    [multipage=Strings]
    You may have heard or seen the word “string” but what does it mean? A string is an instance of the class String, (System.String) and it represents a string literal. A string can hold multiple characters such as “Hi, My name is ______”. Strings are useful because they allow the programmer to assign a single variable to hold large amount of characters.

    In order to create a string variable, you must declare it:


    String a;
    string b;

    *Note, in general use there is no difference between String and string; ‘string’ is simply an alias to the class String. It is, however, generally recommended that you use string when referring to an object while you would use String when referring specifically to a class.

    It is generally recommended that you initialize a string when you create it. In order to initialize a string, you must use the assignment operator, “=”.


    string a = “”;

    String literals cannot span multiple lines. To work around this, you can use the concatenation sign, +, when a string literal does not fit on a single line.

    [multipage=Comments]
    What does it mean to comment throughout your code? Programmers will often refer to leaving notes in your code by using comments. As a programmer, you will end up writing software that is thousands of lines long. With so much going on within a program, it would be hard to know what everything does, especially when the last time you had looked at it was several months prior.

    Commenting allows the programmer to leave notes so that whoever looks at the source at a future date will understand the meaning behind what is going on.

    Comments are ignored by the compiler; this means that you, for the most part, don’t have to worry about what characters you while commenting.

    To comment, you will need to enter in two forward slash characters:

    //

    This tells the compiler to ignore everything after these two lines.

    If you are wanting to comment out code or need multiple lines, you can use comment blocks.

    /*
    Everything between here is commented out
    This doesn’t apply to the program
    */

    A more suitable title would be something along the lines of C# tuturial.
  11. 03-10-2013, 10:13 PM
    Pichu's Avatar
    Pichu
    RIP PICHU.
    Pichu's Avatar
    Pichu
    RIP PICHU.
    6,550
    Posts
    34,645
    Reputation
    Jan 2011
    NextGenUpdate
    Originally Posted by C View Post
    A more suitable title would be something along the lines of C# tuturial.


    Tutorials are being developed. They are almost into the part where I teach the actual programming portion of C#.
  12. 03-10-2013, 10:13 PM
    |C++|'s Avatar
    |C++|
    < ^ > < ^ >
    |C++|'s Avatar
    |C++|
    < ^ > < ^ >
    1,252
    Posts
    1,850
    Reputation
    Feb 2011
    NextGenUpdate
    Originally Posted by Pichu View Post
    These tutorials are still being worked on, as I make them I will post them here. You can view these tutorials on my site & Help Support Me:
    You must login or register to view this content.

    All that is in this guide is written by me. Please, if you wish to use it somewhere else, PM me first and I will determine whether or not I consent to it being used elsewhere.

    To Save Room, I will be posting the video versions here. The text versions will be on my site.

    [multipage=Chapter 1]
    1. A brief history of C#
    2. What is a program?
    3. How does a computer work?
    4. What is the Software Development Methodologies
    5. Errors in program
    a. Compiler Errors
    b. Run-Time Errors
    c. Logic Errors

    [multipage=A Brief History of C-Sharp]



    [multipage=What is a program]



    [multipage=How does a computer work]

    You might be wondering, what makes a computer work? A computer is composed of several different components that interact with one another in order to operate. A modern computer consists of the following components:

    1. One or more processors
    2. Memory
    3. Secondary memory, (Hard Drives)
    4. Input devices, (Keyboards, Mouse)
    5. Output devices, (Monitors, Speakers)

    A computer has a processor, also known as the central processing unit (CPU), and memory, (RAM or Main Memory). The processor is responsible for executing instructions in a program; it stores programs temporarily while they are running on the processor. Aside from RAM, computers need a place to store information, to do this they write information onto the hard drive, (hard disk).

    Say you were to create a text file, when you open up the text document, the RAM on the computer sets aside memory and will actively process the application. Any information that is contained within this application, in its current state, can be lost if the computer were to shut down. Information that is currently held in RAM memory is volatile. If you were to save the information onto your desktop for example, the information at that point in time is now nonvolatile because it is stored. Information that is nonvolatile will not be deleted if you were to shut down or restart your computer.

    Have you ever wondered what your computer would say if it could speak? Well, if computers could speak, they would speak in 1’s and 0’s. Computers have their own language, Machine Language. Machine Language is composed of 0’s and 1’s, each of these values are called bits. A sequence of these bits will form an instruction that tells the computer what it needs to do. If we were to combine eight of these bits, we would form a byte.

    A program may contain millions, possibly billions of bits. Imagine being a programmer and having to type each digit individually, well this is why high-level programming languages were developed. High-Level programming Languages allow source code to be compiled using a compiler which converts the source into binary so the computer can understand the set of instructions within the program and carry them out.

    [multipage=Software Development Methodology]

    A Software Development Methodology, also known as the System Development Methodology, in software engineering is a framework that is used in order to structure, plan, and control the process of developing and information system. This is the process to define what is needed and the processes programmers much go through in order to develop software from the beginning of a project to the an end, full release.

    A common method in programming is the following:
    1. Define a problem
    2. Design an algorithm in order to solve that problem
    3. Develop the program code from the algorithm
    4. Test and ensure the code’s correctness
    5. Maintain the code

    Testing the program several times in different environments is a great way to ensure the correctness of your code. If the output appears to not be what is intended, there may be a flaw in the source code. Once you have finished testing, the software should be ready for release. Be warned, the product you have developed may still contain errors that you may not have been able to detect.

    [multipage=Errors in Programs]

    When you begin to write your own programs, you will come across three main types of errors, (bugs): compiler errors, run-time errors, and logic errors.

    [multipage=Compiler Errors]

    A compiler of a program will generate an output that the machine can understand. Most modern compilers will check the source and attempt to find any errors within it. If errors are found, the compiler will halt and will print out corresponding error messages. The error messages that the compile produces is called compiler errors, (compile-time errors or compilation errors).

    Say in C#, we were to try and compile to line:

    Console.WriteLine(“Hello)

    You would notice that when you attempted to compile, an error had occurred. The compiler would notice that you are missing a closing quotation mark for the string and a semi colon which tells the computer that we would like to end the statement.
    After correcting the line, we would end up with:

    Console.WriteLine(“Hello");


    You will now notice that if you were to compile the source, that error that previously appeared is gone.
    The cause for such errors generally related to misspelled keywords, incorrect class names, and method names. Improper punctuation within a source is another key mistake that programmers make. Most compilers will produce an error to let the programmer know where the error is located. As the programmer, it is your job to correct these errors and to recompile the program until no errors exist and the program compiles properly.

    [multipage=Run-Time Errors]

    A Run-Time error is an error that occurs while a program is executing. The computer itself can detect when an error has occurred in a program, these types of run-time errors are prematurely terminated and will often times force a diagnostic message to appear on the screen.

    As a programmer, if you want to display an image of a person smiling in an Image Box when the application loaded. You believe your source code is right and decide to debug the application. When it loads, you notice that the image you want to display cannot be found and error is produced. You notice that in the source, you accidently designated the wrong directory to that image and because of that, the application didn’t run properly. This would be a run-time error.

    [multipage=Logic Errors]

    Logic errors occur when an algorithm used in the program is incorrect. The program may execute normally however, the expected output will not be what is expected. Most logic errors can be detected by computing the result manually and comparing it with the output of a program multiple times over.

    To identify errors in a program, developers often use debugging tools, debuggers. A debugger will ‘step’ through a program one statement at a time and allow the developer to examine the results of each step. Debugging can be manually by placing breakpoints in code or creating an output that will allow you to see and trace how the program is executing.

    [multipage=Chapter 2]
    1. Primitive Data Types
    2. Declaring and Initializing Primitive Variables
    3. Identifiers
    4. Literals
    5. Strings
    6. Comments
    7. Constants
    8. Assignment Statements
    9. Conversion and Casting
    10. Using Constructors and Methods
    11. Operators
    12. Classes
    13. Objects

    [multipage=Primitive Data Types]
    Primitive Data Types is a form of data that is provided by a programming language. Two forms of Primitive Data Types exist, basic and built-in types. A Basic Type of data is a data type that serves a basic building block and is provided by a programming language. A Built-in Type of data is a data type that provides built-in support and is provided by a programming language.

    Within C#, you will come across different variables that store values. These values exist as: byte, sbyte, shrot, ushort, int, uint, long, ulong, float, double, object, char, string, decimal, bool, DateTime, DateSpan.

    1. An Integer is a number that can be written without a decimal point or a fraction. Integers can be: 1, 55, -38, 4444 and any other number as long as it is a whole number. Integers can be represented using other primitive data types such as: int, byte, sbyte, short, ushort, long, and ulong.

    2. A Floating-Point number is any number that contain a decimal point. Unlike integers, Float-Point numbers require the decimal suffix and must appear as the following, 0.0. A Float-Point can be represented using other primitive data types such as float, double or decimal. If you choose to use float, you must include the character ‘f” afterwards for it to be valid, 0.0f.

    3. A Character is a single letter of the alphabet, digits, or symbol. The char data type is used to hold only one value.

    4. Boolean Type values, bool, are either true or false.

    [multipage=Declaring and Initializing]
    Primitive Variables are declared by specifying its data type and following it with a name. To declare an integer variable, you must first define its types and provide a name.

    int number;


    In order to use a variable, you must assign an initial value; the assigning of an initial value is called initialization.

    number = 5;


    Variables can also be declared and initialized on the same line.

    int number = 5;


    A variable can also be declared as a floating-point variable of type float. We will
    declare and initialize the variable name num2 and initialize it with the value 10.3:

    float num2 = 10.3f;


    A variable with the type float requires an ‘f’ at the end of a number, a double does not.

    double num3 = 55.2;


    A long requires a suffix of the letter ‘L’ after the number.

    long num4 = 90000000L;


    Character data must be enclosed in single quotes. To store the value c in variable mouse we would do the following:

    char mouse = 'c';


    Character data cannot hold more than one character due to pre-defined memory allotment for the Primitive Type char.

    char mouse = 'cm';


    bool, (Boolean) can either be true or false.

    bool flag = true;

    [multipage=Identifiers]
    An identifier is the name given to a variable, class, method, or namespace. Identifiers can contain most characters. There are limitations and guidelines that must be followed with Identifiers:

    1. Identifiers cannot contain spaces
    2. Identifiers should start with a letter
    a. Although the characters _ and $ are acceptable, it is considered bad programming practice to start with them.
    b. 4ever is not allowed, $4ever is as is Fourever
    3. To replace the spaces, use the underscore
    a. Hello_This_Is_A_String
    4. Identifiers are case sensitive
    a. Hello is not the same as hello
    5. You cannot use keywords, (reserved words) as an identifier.
    a. The use of string, int, long, etc will result in an error

    When creating an identifier name, keep it short and meaningful. There is no use for extremely long names that are hard to remember. If you do wish to use multiple words for the name in an Identifier, capitalize each word:
    1. TutorialsMadeSimple is more legible than tutorialsmadesimple



    [multipage=Literals]
    A literal is a fixed value used within a program such as a number or character.
    Examples of literals can be the following:

    Int TutorialsMadeSimple = 455;
    Float MakeMeLaugh = 3.4f;
    Bool AmISmart = false;
    Char modulus = ‘%’

    The literals are the values on the right-hand side of the assignment. The different literal values are, 455, 3.4f, false, and %

    [multipage=Strings]
    You may have heard or seen the word “string” but what does it mean? A string is an instance of the class String, (System.String) and it represents a string literal. A string can hold multiple characters such as “Hi, My name is ______”. Strings are useful because they allow the programmer to assign a single variable to hold large amount of characters.

    In order to create a string variable, you must declare it:


    String a;
    string b;

    *Note, in general use there is no difference between String and string; ‘string’ is simply an alias to the class String. It is, however, generally recommended that you use string when referring to an object while you would use String when referring specifically to a class.

    It is generally recommended that you initialize a string when you create it. In order to initialize a string, you must use the assignment operator, “=”.


    string a = “”;

    String literals cannot span multiple lines. To work around this, you can use the concatenation sign, +, when a string literal does not fit on a single line.

    [multipage=Comments]
    What does it mean to comment throughout your code? Programmers will often refer to leaving notes in your code by using comments. As a programmer, you will end up writing software that is thousands of lines long. With so much going on within a program, it would be hard to know what everything does, especially when the last time you had looked at it was several months prior.

    Commenting allows the programmer to leave notes so that whoever looks at the source at a future date will understand the meaning behind what is going on.

    Comments are ignored by the compiler; this means that you, for the most part, don’t have to worry about what characters you while commenting.

    To comment, you will need to enter in two forward slash characters:

    //

    This tells the compiler to ignore everything after these two lines.

    If you are wanting to comment out code or need multiple lines, you can use comment blocks.

    /*
    Everything between here is commented out
    This doesn’t apply to the program
    */

    A more appropriate name would be something along the lines of C#
  13. 03-10-2013, 10:15 PM
    Pichu's Avatar
    Pichu
    RIP PICHU.
    Pichu's Avatar
    Pichu
    RIP PICHU.
    6,550
    Posts
    34,645
    Reputation
    Jan 2011
    NextGenUpdate
    Originally Posted by C View Post
    A more appropriate name would be something along the lines of C#

    I just duplicated your post... Not Happy or Sad