Learn The Basics So You Won't Have To Lie About It Like I Did

I still remember when I was in fifth grade and the lie that I told to my teacher. I’d just moved to a new school. It was supposed to be for the really smart kids. And it was. You see, my previous school math teacher took special notice of me when I brought a slide rule to school. Slide rules were used by scientists and mathematicians before we had calculators. It was slide rules that the NASA rocket scientists used to get to the moon and back. And I had one on my desk. A desk in the class for the slow students.

At first, my teacher probably thought the slide rule was amusing. She asked me about it one day and I started explaining to her how to use it. I was explaining how to multiple, divide, and how to calculate logarithms.

I had taught myself how to use the slide rule during the summer before fifth grade. It just made sense to me like nothing ever had. Here was something that I could hold in my hands and turned multiplication into distances that I could see and work with. Anyway, my teacher listened to my explanation and asked me to calculate some things for her. She recommended that I be moved to a different school right away. And about two weeks later, I was attending school in a different town.

All the other students were super smart in my new school. While I was still reeling from what had happened.

Not long after arriving at the new school, my new teacher gave us a timed multiplication test. I raced through the problems as fast as I could and skipped the ones I didn’t know. I answered maybe 75 out of a hundred questions when I ran out of time.

The results showed something very interesting. Something I lied about when asked why I had skipped certain questions. Why did I feel like I had to lie?

Did I not know how to multiply by nine? No. I knew my nines. And I knew my eights. And my sevens. I knew all the tricky numbers. But there was something that was new to me. Something I had never thought about before that day.

And that meant I didn’t fully understand it. Here was something on the multiplication test that didn’t make sense to me again. I was ashamed after taking the test and being asked about it. But that was nothing compared to the panic I felt during the test when I came across something so new that my mind went blank.

You see, I didn’t know how to multiply by zero. The most simplest questions on the test. Just as simple as multiplying by one. And I had no idea what it meant. Instead of admitting that I didn’t understand, I told my teacher that I was saving those questions for the end. Just like how I would save my favorite bite of food for the last bite.

Now, there’s lots of things that you’ll be learning about programming. This class will explain some of the basics of how to use your tools.

Think of this class as taking that first step. Learning how to use your software development tools is like learning how to use a slide rule and breaking out of your current situation. And along the way, I’ll guide you so that you’ll know your zeros.

This is a two part class. The full topics you’ll learn about include:

In part one, you’ll learn how to use the editor in your IDE. This is the tool you’ll use most often to write your code.

  • Create workspaces
  • Create projects
  • Work with file types and folders
  • Use syntax highlighting
  • Select text
  • Indent text
  • Searching
  • Saving changes

Learn how to comment your code.

  • Good comments explain what’s not obvious.
  • Learn to avoid simple comments that the code does a better job of saying.

Learn the basics of including files by exploring more include files.

Learn where your program begins and ends with the main method.

  • What does it mean for main to return an int?
  • Where to use parenthesis and curly braces.
  • Extend your “Hello world!” program by displaying more than just text.
    • How to use the std namespace either explicitly or by default.
      • Using the scope resolution operator.
      • Using cout and endl through using statements.
    • The effect of endl and how you can use it to control where your output splits into new lines.
    • When to use semicolons. This is one of the simplest and most common mistakes.

Using whitespace in your code so it’s easier to read and how to avoid misleading indentation.

Part two begins here and you’ll learn how to build your program with more control and options. You’ll also learn how to understand and fix things when your code has errors that prevent it from building.

  • How to use a compiler. This is what will turn your written code into a running application.
    • This will mostly be hidden from you by your IDE. But you can always use your compiler directly if you want.
    • Better compilation with more options.
      • g++ -Werror -Wall -Wextra -std=c++17 -o hello hello.cpp
        • Turn warnings into errors.
        • Use all error and warning checking. Which is not really everything.
        • Use more error and warning checking.
        • Use the C++ 17 standard.
        • Create an executable named hello instead of a.out
          • Windows will create hello.exe
        • Compile hello.cpp
        • See an example of an unused variable being caught by -Wall but not -Wextra. And how this can be different on a different compiler.
  • Errors vs. warnings. How to tell them apart and what do they mean?

Learn how to find and run your finished program to see the results. It’s an awesome feeling when you run your first program. You’ll start thinking of other things you want your computer to do and realize that you have the power now to make your ideas real.

Support Take Up Code on Patreon for additional benefits.