1.4. Tips and Motivation for Learning To Code

1.4.1. Best Practices

Whew! You made it to the end of the chapter. Good job. Here are some final bits of advice:

  1. DO try every exercise and practice problem.

  2. Practice helps you master the basic quirks for a given programming language.

  3. DO experiment. Once you solve one given task, feel free to tweak it. Great fun can be had if you ask, “What if I try …?” For example, if a problem asks you to sort a list alphabetically, can you order it from z to a instead?

  4. ASK FOR HELP when you get stuck. We’ve all been there, and there is no shame in looking for tips. Use your teacher, classmates, and Google as the brilliant resources they are.

  5. The only “dumb questions” are the ones that are not asked.

  6. The rubber duck method works. Sometimes just describing a coding problem out loud (to your screen, a parent, the wall, or a rubber duck) sparks an idea about how to solve it.

  7. DO NOT copy/paste answers. There are plenty of websites that post complete code. A simple copy/paste into the assignment box will give you a correct answer, but you completely skipped your chance to learn something.

And don’t ever forget to:

DO THE HOMEWORK!

1.4.2. An Appeal to Wisdom

I hear, and I forget. I see, and I remember. I do, and I understand. - Chinese Proverb

Experience is definitely the best teacher. You could read pages and pages about for loops, which will give you the vocabulary. However, until you build your first working loop, your understanding will be incomplete.

Tip

You learn to code by CODING.

1.4.3. Personal Drive (Grit)

Does the following statement sound like you? If so, perfect.

“If I stumble, I WILL pick myself up, brush off the dust, and try again.”

During this course, you will be asked to code. Each exercise and project is designed to give you experience. You WILL make mistakes, and that is OK. Often, our mistakes teach us more than getting the correct answer on our first try.

Every genius programmer you see on Facebook or YouTube started out in front of a screen saying, “Oops,” “ARGH!” or “#*&%%@#!” No one just “gets” coding without some trial-and-error.

Tip

Use your mistakes as learning opportunities.

1.4.4. Effort = Outcome

Let’s take a look at a sample coding task: “Prompt the user to enter a number, then print ‘Even’ if it is divisible by 2, otherwise print ‘Odd’.”

Now let’s take a look at an imaginary student’s attempt at solving this problem:

1.
2.
3.
4.
5.

Hmmm. A blank space. What might be the reason?

  1. The student did not understand how to solve the problem.

  2. The student knew how to solve the problem and decided to skip it.

  3. The student tried to solve the problem, could not get their program to work, so deleted the code.

  4. The student ran out of time trying to complete the work before class.

From a teacher’s perspective, ANY of these reasons could be valid, and they have no way of knowing which is true. This prevents them from knowing how to best help the student. Where would they begin?

For the student, a blank response provides no benefit! The practice was either ignored or incomplete. Doing the work will pay off. SO:

  1. Even if you have no clue how to solve the problem, MAKE AN ATTEMPT, then ask questions.

  2. If you know how to solve the problem, COMPLETE THE TASK ANYWAY. Practice makes better. Also, you could use your code to help a classmate.

  3. If you tried to solve the problem, but your code did not work, DO NOT DELETE IT. Ask a question. Showing your work to your teacher or classmates will show them your thought process.

  4. If you ran out of time, GO BACK AND FILL IN THE BLANKS LATER. Practice makes better. If you neglect one set of skills, later tasks that depend on those skills will become harder.

Tip

Learning takes work, and you need the practice.

1.4.5. Sports Motivation

Attention sports fans! Embrace your favorite quote(s):

Sport

Quote

Baseball

“There may be people who have more talent than you, but there’s no excuse for anyone to work harder than you do.” - Derek Jeter

Gymnastics

“I’d rather regret the risks that didn’t work out than the chances I didn’t take at all.” - Simone Biles

Football

“I was always willing to work. I was not the fastest or biggest player, but I was determined to be the best football player I could be on the football field, and I think I was able to accomplish that through hard work.” - Jerry Rice

Soccer

“The backbone of success is…hard work, determination, good planning, and perseverance.” - Mia Hamm

Tennis

“If I don’t get it right, I don’t stop until I do.” - Serena Williams

Rocky

OK, “Rocky” is not a sport, but how can you listen to this and NOT be inspired? (Gonna Fly now)

Other

Imagine your favorite motivational phrase here. - Favorite Role Model

Tip

Your heros worked really hard, so should you.

1.4.6. Social Media

Want motivation in 140 characters or less? Check out these posts:

  1. #hardworkworks

  2. Rocky (Gonna Fly Now) because it’s just that good.

Tip

Sometimes you can find the inspo you need in your social media feeds!

1.4.7. Marathon Analogy

Pretend you are not a runner (complete with the “0.0” sticker on your car), but you decide to compete in a marathon. You can’t just drive to the starting line, put on your running shoes and go.

You have to train:

  1. Begin by getting good at running 1 mile.

  2. Then get good at running 3 miles.

  3. Then get good at running 6, then 8, then 10 miles. By now you could try a half-marathon, and proudly slap a “13.1” sticker on your car.

  4. Continue training and increasing your distance. You WILL earn that “26.2” sticker, which will look GREAT when placed in line with 0.0 and 13.1.

  5. Your stickers demonstrate your commitment and might even inspire other non-runners. They will see how you started “just like them” and notice how your effort spurred personal growth.

Learning to code follows the same idea:

  1. Begin with “Hello world!”

  2. Then learn variables, strings and lists.

  3. Then learn if/else statements and loops, followed by functions and modules.

  4. Then code your first “half-marathon”.

  5. Continue practicing to increase your skills. You WILL earn that marathon.py sticker as you build more projects.

  6. Welcome, fellow coder. Don’t forget to inspire others.

Tip

Do your work, and you will consistently get better.