"Coding Is Too Hard"

by Kevin Oh

Within the past two years, about a dozen people told me they’re extremely interested in learning how to code. Today, none of them are programmers, developers, or even hobby coders. Most of them, as far as I know, have never even opened a text editor.

The conversation always goes the same way. They want to learn, they have ideas, but it’s all too hard. One of my more determined friends — an art major — admired the idea of focusing on a single project all day, but he would routinely shudder at the sight of actual code.

In his words: “That crazy $%@! just makes me…just…ugh dude.” He clutched his side in mock pain and limped away.

I want to explore the reason they gave for not learning — that it’s too hard.

To be clear: I’m not going to try and say that coding is a walk in the park. It’s not something you pick up on a weekend. Coding is most certainly not easy. But getting started is easier than you may think. And that’s what important.

True Story Time!

We’ll call him John. John is a bright kid with a good heart, but by his own admission, he was never the left-brained type. He likes basketball, League Of Legends, and watching movies.

Two years ago, I was a staff member at a community event — details omitted for anonymity. John was there, and he seemed distracted. He was fidgeting anxiously — twiddling his thumbs and tapping his feet. Later, I saw him storm off. He slammed the door behind him. I followed.

He eventually confessed that his college applications were due in a week, but he hadn’t picked a major. He was so anxious that he couldn’t focus on anything else.

Initially, I did what all older people would do: I asked him what he was interested in. This led to a predictably useless end point: “I like a lot of things, but I don’t like any of them enough.”

In his book, Blue Like Jazz, Donald Miller says, “Sometimes you have to watch somebody love something before you can love it yourself.” So I started talking about what I do.

“I’m a web developer. I build sites by typing words on a screen.”

He didn’t immediately understand how words on a screen (that is, how code) could result in a functioning program, so I used atoms as a metaphor. When specific atoms are arranged in a certain way, you get all kinds of things with different behaviors and properties. Water, rifles, tacos — everything was built with atoms. The metaphor wasn’t perfect, but he seemed to understand the gist.

I stepped through some more examples with him. An hour later, we were talking about puzzles, loops, and simple algorithms.

When non-coders see code, they see the intimidating syntax-highlighted wall of text itself, not the ideas that drive the text. And in so doing, they miss out on everything: the elegance of the concepts, the fun of building something from scratch, the ingenuity of it all. These are qualities that most every thoughtful person has an appreciation for.

Here’s my goal with this post.

To make non-programmers (and any interested early-career devs with impostor syndrome or doubts) realize that they already understand, intuitively, many of the basics of programming. I’m going to give you extremely basic introductions to four essential concepts in programming: syntax, variables, control flow/conditionals, and algorithms. My guess is: you won’t struggle at all to understand them.

1. Syntax

This definitely not is a in English valid sentence!

How It Relates To Code: You probably stumbled through the above sentence a little bit. That’s because the syntax of that sentence is messed up. The order of words matter, both in English and in coding languages.

Just like we expect certain patterns of speech, so do computers — the only difference lies in the languages used.

2. Variables

You’re moving to LA to pursue an acting career. Good on you. You’ve got stuff to pack, and different things have to go in different boxes. You use labels to help keep your junk organized.

How It Relates To Code: In code, we have something called a “variable.” And a variable is like the label on a box. Since you can use a box to store anything (clothes, headphones, cats, etc), labels help you know what’s inside the box without having to open it up.

Computers do the same thing — they use a system of “boxes and labels” to store, process and retrieve data.

3. Control Flow & Conditionals

Question: Are you at least 18 years old?

How It Relates To Code: Computer programs have to account for a lot of different possibilities. They test for conditions, just like we do every day. They just do it a lot faster.

By checking for conditions like this, a well-coded program can handle many different cases. This is referred to as control flow: controlling the flow of the program, usually based on conditions.

4. Algorithms

You’ve probably heard this word from some movie as part of a techno-babble speech. It basically just means a set of decision-making steps that help you get something done. And you have a bunch of algorithms already “built” into you!

Your Morning Preparation Algorithm, probably:

  1. Wake up.
  2. Is it a school/work day? If so, continue to Step 3. If not, go back to sleep.
  3. Go to the bathroom.
  4. Wash your face.
  5. Do you drink coffee? If so, proceed to Step 6. If not, skip to Step 7.
  6. Do you have coffee? If so, make coffee. If not - tough luck - proceed to Step 7.
  7. Are you on a diet? If so, get an apple. If not, bust out three poptarts.
  8. Eat whatever you created in Step 7.
  9. Go to work or school.

This is an algorithm in plain English. It’s a single set of steps, but it’ll yield different results on different days and for different people. It may also utilize variables.

For example, steps 7 and 8 could be rewritten like this to use variables:

  1. Are you on a diet? If so, BREAKFAST is apple. If not, BREAKFAST is poptarts.

How It Relates To Code: Programmers write programs containing algorithms, variables, and control flow to get stuff done. To solve some problem.

As you can see, all of these concepts sort of stack on each other. I think that’s sweet.

Some Closing Thoughts

For anyone who has been thinking about code as some arcane, cryptic art, it’s not. It’s certainly not easy, and it will uncomfortably bend your mind, but for some of you, it will absolutely be worth the effort. Coding encourages you to approach problems in new ways, to view situations more objectively, to juggle and consider many factors, and to constantly seek optimal solutions. And many of the fundamental concepts are things you already understand!

So, I hope that’s enough to whet your appetite. I’ve only barely scratched the surface, but this is only a blog post after all. Hopefully it’s a decent start that piqued your curiosity a little more. If you have any questions at all, feel free to email me directly at aflashyrhetoric@gmail.com. Otherwise, good luck.

By Kevin Oh on February 12, 2016.

View All Posts