HASSANHABIB

§ 10 — C#: From Scratch

Course Recap

2 min read · chapter 12 of 12

Our final chapter here will be a recap of the C# Starting From Scratch course. The image below outlines the main topics we have covered - Variables, Flow Control, Iteration, and classes and objects of which is also known as Object Oriented Programming.

using Demo.App;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;

namespace Hassan.Social.YouTube.Channel
{
    class Program
    {
        static void Main(string[] args)
        {
            #region Variables
            // …
            #endregion

            #region Flow Control
            // …
            #endregion

            #region Iteration
            // …
            #endregion

            #region OOP
            // …
            #endregion

            Console.Read();
        }

        #region OOP Class
        // …
        #endregion
    }
}

These will be the basics and the foundation for all the following C# courses. I am sharing with you the concepts that are very basic. These are the things that just get you off the ground. I assume no previous knowledge whatsoever with programming or C# or the IDE.

Starting off, we talked about variables, how we save numbers and how we save words, strings, booleans, how to save things and arrays, how to reserve that place in memory and then reuse these values into doing other things with our program.

static void Main(string[] args)
{
    #region Variables
    // …
    #endregion

    #region Flow Control
    // flow control
    if (booleans)
    {
        // do something
    }
    else
    {
        // do something else
    }

    switch (strings)
    {
        case "blah":
            // do something
            break;
        case "other":
            // do something
            break;
        default:
            break;
    }
static void Main(string[] args)
{
    #region Variables
    int numbers = 10;
    string strings = "Hello!";
    bool booleans = true;
    int[] arraysOfNumbers = new int[] { 1, 2, 3, 4 };
    string[] arraysOfStrings = new string[] { "hi", "hola", "hala" };
    #endregion

    #region Flow Control
    // …
    #endregion

    #region Iteration
    // …
    #endregion

We also talked about flow control - ‘if’ statements and switch cases are tools that you can use to have your program perform an action based on a specific input. As well as what to do with the data and how to act upon it.

    #region Flow Control
    // …
    #endregion

    #region Iteration
    while (booleans)
    {
        // do something
    }

    do
    {
        // do something
    } while (booleans);

    for (int i = 0; i < arraysOfNumbers.Length; i++)
    {
        // do something
    }

    foreach (string number in arraysOfStrings)
    {
        // do something
    }

    #endregion

    #region OOP
    // …
    #endregion

    Console.Read();
}

The third portion of this was the iteration.

If you have a list of things or you want to do something for a certain number of times.

You have ‘while’, ‘do-while’, ‘for’, and ‘foreach’ options.

These are the very basic concepts that you could use to iterate through a bunch of numbers, or iterate through an array and perform an action.

We also talked about an intro into object oriented programming.

            #region Flow Control
            // …
            #endregion

            #region Iteration
            // …
            #endregion

            #region OOP
            Student josh = new Student();
            josh.Name = "Josh McCall";
            josh.Studies("Algorithms");
            #endregion

            Console.Read();
        }

        #region OOP Class
        class Student
        {
            public String Name { get; set; }
            public void Studies(String subject)
            {

            }
        }
        #endregion
    }
}

We discussed what the classes are and how you visualize something in real life and turn that into either properties or methods, things that the visualized object could do, or things that can be done to that object.

Also things like properties, things that describe that object from an information perspective ilke a student for instance - what their name, age, date of birth, what class they’re in, and you use that data and manipulate it for your own program to serve a specific need.

Go through these things - these are the fundamentals of starting to learn C#. The next course for this one is going to be “Scratching The Surface With C#”, where I’m going to dive deeper into these subjects and programming.

There will be a lot to learn from a control flow perspective, from an iteration, from variables, I called it flow control.

Play around with the fundamentals you have learned in this book and I’ll see you in the next one - “Scratching The Surface With C#”!