Simple, Quality, Awesome Software

Comment ALL the Things!

Below is the complete code for the Comment ALL the Things! Try It Out! problem, adding comments of different types to the original Hello World program.

// Using directives tell the compiler where to find piles of existing code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

/* A namespace is the largest way to organize code, gathering them
 * into large containers of related code.
 */
namespace HelloWorld
{
    /* A class is a way of packaging up related data and methods that use
     * that data all together into one reusable piece of code.
     */
    class Program
    {
        // A method like this Main method is the smallest way to package a chunk
        // of code together. A method is usually supposed to accomplish only a
        // single, specific goal. Note that these "single line" comments can be
        // used to create multi-line comments, and in fact, this is the way most
        // C# programmers do it.
        static void Main(string[] args)
        {
            // Prints out the text "Hello World!" to the screen.
            Console.WriteLine("Hello World!");

            // Waits until the user presses any key before finishing the program.
            Console.ReadKey();
        }
    }
} // Curly braces like this usually mark the beginning and ending of blocks of  
  // code. You can see that curly braces are used here to start and end methods,
  // classes, and namespaces.