In 4th grade, my friend Sam built a website about Dragonball Z, an anime cartoon.
It was a great feat for a ten year old, especially in 1998, when there was no Squarespace or Wix. He was writing the code from scratch in a text editor. He taught me the basics of how to structure an HTML webpage.
But it was my first view into the world of building stuff by typing <words like this>
Fast forward 15 years to 2013, and I’m reading about a startup called One Month Rails. They promised to teach me the then-hot web programming framework called Ruby on Rails in just 30 days.
Interested in tech and with a growing feeling that teaching would not be my lifelong career, I signed up.
The course taught me to a build a basic “clone” or copy of Pinterest, a site used for posting and viewing pictures. I spent hours learning how to make it possible for users to click a button that said “Sign Up,” so they could create a username and password. And even more time figuring out how those users could upload pictures to their account, then view them on a series of pages they could click through.
It was a frustrating, empowering, and mind-expanding experience. A curtain had been lifted, showing how things work under the hood of the Internet.
You don't have to spend hours building a replica of Pinterest. You can get about 80% of the benefit by learning what these terms mean and how they are used.
The real benefit is that learning some basic coding can help you think more literally, solve problems in a more systematic way, and have more common sense, even if that sounds kinda crazy.
Choose projects over drills and tutorials
Many free resources will guide you through basic exercises that won’t feel useful at all. You may learn some concepts, and start to identify patterns or syntax of code, but you won’t feel like you’re doing any work that relates at all to the apps and websites you use on a daily basis. This is a big problem with many “learn to code” curriculum, in my opinion.
The more motivating, practical, and effective approach is to jump into learning projects as soon as possible. A few sources that do this well are One Month, Wes Bos’s courses, and Free Code Academy.
Many free resources will guide you through basic exercises that won’t feel useful at all….The more motivating, practical, and effective approach is to jump into learning projects as soon as possible.
When you learn even one basic project, like coding a personal website, everything you’re learning has a purpose and context. You are not just learning the syntax of HTML, but you are learning how the order of the lines of code correspond to the pieces of a website, for example.
Another simple way to learn some of the basics is to use the Inspect Element of Google Chrome’s browser to look at one of your favorite websites. Using this tool, you can view the source code of the website. When you hover over the code, it will highlight the portion of the website that this code corresponds with. Doing this can give you an understanding of the structure and style of a website, especially if you Google the terms that are unfamiliar to you.
3 terms to start with
Variables
What does it mean?
Just as you learned in Algebra, a variable is a piece of information that can be changed.
For example, imagine you use software to run an online clothing store. For each item you sell, there is an attribute called Price, which is a variable. The value of Price can be $10 for a pair of socks or $100 for a cashmere sweater. Let’s say each item also has a Name, and a Product_Photo. These attributes are also variables because the name and picture of each item you sell will be unique.
The Name, Product_photo, and Prices of all of the items you sell are listed in a database, i.e. a big spreadsheet accessible to your website.
Think about why this is valuable for a programmer. Whenever they want to display information on your website, such as the name, price, or photo of one of your products, they only have to list these variables instead of writing out the exact Name and Price of the products. This way, when this information changes in the database, the information also changes everywhere that the variable is used.
How it helps non-programmers?
One practical example is that you’ll better understand how marketing messages are personalized to you. When you make a purchase online, a company then has your information such as “First Name” “City” or “Recent Purchase.” These can all be used as variables to tailor an email, text message or web page to your identity and preferences.
If/else statements
What is it?
If/else statements are a way to guide a computer through making a decision based on data it has available. The code says IF a condition is true, THEN take an action. If the condition is not true, do something ELSE.
For example, when you are typing on the keyboard, the computer might be using logic like this:
IF you have pressed the caps lock key
print upper case letters
ELSE
print lower case letters
But what about the “shift” key? When there may be multiple reasons a condition is true, you can use ELSEIF. That would look something like this:
IF you have pressed the caps lock key
print upper case letters
ELSE IF you are holding down the shift key
print upper case letters
ELSE
print lower case letters
How it helps non-programmers?
I’ve found that understanding if / else statements can help you think through bureaucratic situations. In the tax code, for example, there are many tax breaks that require if / else type thinking. IF you are a veteran, consider this tax break. IF you are a homeowner, consider this tax break. etc etc etc. ELSE take the standard deduction.
Debugging
What is it?
Debugging is the term for fixing a problem in your code. There are different approaches and tools used for debugging. But the goal is to identify the cause of a problem you are having, fix it, and prevent it from happening again in the future.
Even when completing basic coding projects, things break. When your code is not working, it can be a frustrating experience, especially when you think you wrote everything correctly.
There are a few processes I learned that helped me identify and fix errors or “bugs” in my code, and these improved my thinking in other areas of my life as well.
First, you need to proofread the code. If you leave out a semicolon, or you use a colon instead of a semicolon, your whole program can break.
Second, if you Google the problem you are having, you’ll realize it’s not unique. I was amazed to learn about Stack Overflow, where every problem I had was experienced by many others and solved by a generous few who posted their solutions.
How it helps as a non-programmer?
While frustrating, the process of identifying and correcting errors in code makes you more meticulous and resourceful. I am someone who enjoys thinking in high-level ideas and abstractions, and sometimes fail to be detail-oriented when needed. Unlike in writing or communication, when you can be directionally accurate and still get your message across with a few errors included, in programming the code either works or doesn’t. This need for correctness helped me review my writing and other work more carefully.
While I already knew that the Internet was a treasure trove of solutions for any problem I may have, Googling coding errors led me to realize just how common most of my problems are, and how generous some people are with sharing their advice and solutions. This carries over into areas like researching DIY or home repair projects.
Expand your options and communicate better
If I need to launch a website, I can customize the content and style beyond what out of the box solutions offer. I can place an email sign up form on that website. And if I had an idea for an app, I have a reasonable understanding of the work required to build a minimum viable product, which would make it easier to get help from a developer to build it.
In short, learning the basics of programming gives you more options, especially when it comes to working in the tech world. You use software in the form of websites and apps all day long. Having an understanding of how it all works adds a new dimension to your daily experience.