Why I am learning how to code

I’ve decided to learn how to code. I’ve been teaching myself Python over the past couple of months. The progress has been much slower than I expected, primarily because I don’t have enough time during the week to dedicate to coding. In fact, I only have a few hours (at most) on the weekend. Unfortunately, life happens and I get distracted sometimes.

Why am I learning how to code? Simple. I want to be able to build stuff without having to depend on someone else. I don’t expect to have a second career as a programmer. I don’t expect to code full time at all. I just want to be able to prototype ideas and mainly just hack stuff together. Plus, it would be awesome to be able to help out my engineering team when I finally get my own company off the ground someday. I need to be able to communicate with the engineers. Therefore, I am learning how to speak their language.

I remember learning Mandarin in college. It was an arduous yet fun process. It was fun to be able to communicate with the local taxi driver and shopkeepers in Mandarin, albeit imperfectly. I could always understand more than I could actually speak it. The same is the case with Python. I can understand more complex code than I can write, for now anyway.

Here’s something very simple I wrote over the weekend. It’s really elementary, but I plan to build on this and create an interactive “game” over the next month or two. I am curious what I am going to come up with!

print “Let’s figure out what you would be if you were a number.”
print “To do so, I’m going to ask you a series of questions.\n”

gender = input(“If you are a male, please enter 1. If you are a female, please enter 2. If you are unsure, please enter 3:”)

if gender == 3:
print “I’m terribly sorry, but I cannot give you a number.”

elif gender == 1:
height = input(“Enter your height in inches:”)
weight = input(“Enter your weight in pounds:”)
lastname = raw_input(“Enter your last name:”)
malevalue = int(height) + int(weight) + len(lastname)
print “Your numerical value is”, malevalue

elif gender == 2:
height = input(“Enter your height in inches:”)
weight = input(“Enter your weight in pounds:”)
lastname = raw_input(“Enter your lastname:”)
femalevalue = int(height) + int(weight)/2.2 + len(lastname)
print “Your numerical value is”, femalevalue

else:
print “That is not a valid option. This calculation works only for those who can follow directions!”

– from xkcd.com

About these ads

4 responses to “Why I am learning how to code

  1. One day we might all need to learn to code. Will this be the “New Math” of the next generation?

  2. I think coding should be part of a foreign language requirement in primary and secondary schools.

  3. You are a brave man, Jonathan. Welcome to my world, however I do it full time! I think it makes sense that you want to learn how to “speak” the language of your fellow engineers.

  4. Pingback: Why I’m giving up learning how to code (well, sorta’). | Jonathanlee.me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s