Epiphanies I Had While Teaching Myself to Code

learn to code

It’s been about a year since I decided to teach myself to code. At the time, I had a bachelor’s degree in English, a job in retail, and zero knowledge about programming. I’d had minute brushes with coding in the past but hadn’t even thought about math or coding since high school.

The impetus for learning to code came from my growing addiction to Hacker News. I, too, wanted to build cool things and understand how web apps and programs worked. I wanted to have an app in the App Store, dammit. I wanted to start a business.

But, for someone who couldn’t tell JavaScript from Common Lisp, I had no idea where to start.

Thus, I began my journey into the world of code. Often flailing, unsure, and guessing. I’ve come a long way since my failed attempts at learning to code lead to hiring a developer to get my apps in the App Store. I’ve had numerous coding epiphanies along the way and there were many things I wish I had known starting out. If you, too, are teaching yourself to code, or want to begin learning to program, hopefully some of the things I’ve learned can help you out, too.

Computer science/coding isn’t about the language

I remember hearing that a computer science degree doesn’t teach you how to program, it teaches you how to think. Every developer is self-taught; computer science just gives one the tools to easily learn programming languages. I don’t have a Computer Science degree, so I can’t fully attest to the validity of these claims, but from what I’ve experienced so far, there’s no better way to explain this field.

When I first decided to learn to code, choosing a language was a great dilemma for me. In my mind, my plan was: 1) Choose a language, 2) Get a book on this language, 3) Finish book, 4) KNOW HOW TO CODE.

This is not how to learn to code if you don’t have any prior programming experience1. As a result, I found myself getting to chapter 2 or 3 in a book before becoming completely lost, deciding to pick up a different language, and starting all over again. I dabbled in PHP, Javascript, Ruby, Python, and Objective-C by following this flawed method. And, though I do advocate trying numerous different languages, this four-step plan put me in the wrong (read: un-optimized) mindset when first picking up each of these languages.

Not only was I frustrated that I couldn’t get past chapter 2 or 3, but each of these books started the exact same way. I was learning about variables, for loops, while loops, switches, and arrays over and over again when I really wanted to learn something new, something to get me past the bump in the road I had hit.

Eventually I had a realization: learning to code isn’t about learning a language. Learning a for loop is like learning a Phillips head screwdriver. A hardware store may have a wall covered with different types of Phillips head screwdrivers, but the real goal is to learn how, when, and why to use this specific tool.

Try a bunch of different languages

The first language I tried was Javascript with Codecademy. This proved to be a fantastic tool and resource, and was a fantastic way to start my journey. But soon I became frustrated. I had no idea how math, numbers, loops, and switches related to what I saw on websites. I didn’t know how assigning 3 to a variable and adding another variable could ever result in, say, a button on a website changing color.

With the help of an online coding mentor (who independently reached out to me because I blogged about starting to learn to code) I brushed up on HTML and CSS2 and learned about jQuery and the DOM. This is when I learned the definition of framework and was able to code a very basic calculator app.

It was then that I realized that I didn’t want to do front-end development and decided to switch to Ruby on Rails, which I constantly heard was a great language for beginners (although I didn’t quite know what that meant). I started working through the Rails Tutorial by Michael Hartl.

I spent a particularly long time on the Rails-flavored Ruby chapter, which I found particularly interesting because of my Javascript background. Learning Ruby was a fantastic way to pinpoint the important parts of Javascript. It helped me separate concepts from language quirks. During this time I also dabbled a little bit with Google’s Python class and had the same experience.

Playing with multiple languages didn’t confuse me like I thought it would. Instead, it helped me understand core concepts. When I finally decided that Objective-C was the first language I wanted to truly learn (a decision I made nearly 10 months after first completing a Codecademy lesson) I had a firm grasp on the concepts of variables and loops. I was able to appreciate static versus dynamic typing and understand why Objective-C was static3. Without dabbling in all those other languages, these concepts would have been much harder.

Do the exercises

Writing code isn’t a requirement when you’re learning from books, tutorials, and videos. Codecademy is different because it forces you to write code—that’s what makes it great.  It’s easy to read a chapter or watch a video, think you understand a concept, and then move on. But understanding the concept and performing the exercises are two different things.

With the Rails tutorial, physically typing and executing the code was part of the natural process of working through each chapter. I would go through each section and perform all the motions even if I didn’t understand what I was doing. The next day, I’d re-read the entire chapter extremely slowly. If I didn’t understand one sentence, I’d re-read it, scroll through examples, and research concepts until I did understand. Sometimes I’d go through the same chapter numerous times in this way: re-reading until I was able to read and understand each paragraph at a normal pace.

With books, it’s even easier to skip doing the actual work since it’s easy to skip over the exercises at the end of a section and just move on to the next chapter. Don’t skip the exercises.

Actually writing and running the code might seem like a small step, but it’s really at the crux of learning a language. Troubleshooting will teach you things you didn’t even realize you didn’t know and will often have you flipping back through the chapter to double-check small details or go over a topic you thought you understood.

Even if you read an exercise and think you know exactly how to do it, type it out anyway.

You already know the concepts

Understanding code concepts and algorithms4 is actually something you’ve been doing your entire life. At first, learning a programming language may seem akin learning magic, but  it’s nothing more than learning how to think and speak to a machine. In the same way that verbal language communicates your thoughts to others, programming language is a way to input your thoughts into a computer.

Before I even wanted to learn to code I was writing programs. I lived in the Prospect Lefferts Gardens neighborhood in Brooklyn for about four years. There were numerous ways to get to work from my apartment. I figured out two different ways to get to work, on two different trains. The first train was close to my apartment but I had to change trains halfway through the commute and the other train was a longer walk from my apartment but the ride was shorter and didn’t involve a train change.

In the morning, I’d run a “program” in my head, inputting variables such as weather, time, and my mood, and returning my decision about which train to take. It was simple if else logic that determined whether to I took on the 2 or the Q train.

Soon, I became obsessed with optimizing my commute based on different variables. I studied the subway map, tried other trains, checked time tables. By the time I moved out of that apartment, I could have written an essay about how to get from Prospect Lefferts Gardens to NoHo in Manhattan. Any time someone asked me “What train do you take?” I had to stop myself from rambling on and on about my options.

The tactics used to calculate the best route are the same concepts used in programming. In conversation, I might say, “I change trains at the Brooklyn Bridge station,” whereas in coding I’d write if (station == "Brooklyn Bridge") { change trains }. It’s the same concept, just expressed using the tool of an if statement rather than the tool of the English language.

In coding, my daily commute instructions would be broken into minute pieces, even more so than if I was giving verbal directions. For example, maybe I’d never consciously think to “mind the gap” when getting on and off the train. Some programming languages will automatically mind the gap, others will need to be explicitly told. Learning to code is about understanding that minding the gap is an intricate part of your commute and then figuring out how to properly communicate this information using the tools provided in the language you’re using.

You’re learning even if you feel like you’re not

I often felt like I was moving in slow motion when learning to code. I even felt like I was taking steps backwards whenever I switched to a different language since I thought I’d be back at square one. That’s not the case. Just keep going, keep reading, and keep pushing forward amid the fog.

Whenever I felt like I was stuck, I’d re-read my old blog posts where I discussed code or I’d return to previously read tutorials and books. I’d remember my mindset when I first mucked my way though, and that’s when I’d realize how far I’d actually come. Coding knowledge builds in layers, and sometimes the layers are so thin it doesn’t feel like there’s anything added. But soon enough, the slivers add up to significant mass.

Teaching myself to code has led me to the believe that anyone can learn to code. It’s not about the language, or math, or syntax. These are just tools. It’s about thinking, and the thinking will come in time. Just keep going and you’ll get there.

If you want to follow me as I continue to learn to code, check out my Code Journal posts or follow me on twitter.

[sc:newsletter]
  1. I suppose, technically, this is one possible path one can take. But it’s, arguably, not the most optimal path nor the best way to think about learning to program if you’re exploring this field for the first time.
  2. So much had changed since 2002!
  3. Except for the id variable.
  4. Algorithms are, simply put, a process or set of rules to be followed.

Taxing the Rich For Fun and Profit

Warren Buffett presents an interesting thought experiment in his latest piece in the New York Times:

Suppose that an investor you admire and trust comes to you with an investment idea. “This is a good one,” he says enthusiastically. “I’m in it, and I think you should be, too.”

Would your reply possibly be this? “Well, it all depends on what my tax rate will be on the gain you’re saying we’re going to make. If the taxes are too high, I would rather leave the money in my savings account, earning a quarter of 1 percent.” Only in Grover Norquist’s imagination does such a response exist.

I wrote in the past about how the rich make their money and it’s no surprise that the answer is ‘capital gains,’ or, to over simplify, they make their money from returns on investments. These returns are taxed as a much lower rate (currently around 18%) than income tax. Looking at the 400 richest people in America, they made almost half their adjusted gross income from capital gains.

As Buffett posits, even if the tax rates for the “rich” increase, it won’t stop these people from going about business as usual. They’re still going to make investments because, even with an increased tax rate, they’ll be making more money than if their cash was sitting in a bank.

Now, whether or not these people create jobs is a different story1. But I think Warren Buffett is right, and raising the tax rate for capital gains will do nothing but help our economy.

  1. Some investors invest in small businesses, which have the potential to grow and create jobs. But others, like Bain Capital, instead make money from buying struggling companies and attempting a revival. Sometimes this involves layoffs and lost jobs, sometimes the company grows and does create a few more jobs. But it’s more of a crap shoot, and it isn’t fair to say that these ventures always create jobs (and even less fair to even think that creating jobs is even part of the goal, rather than a bi-product).

10 Tools, Tips, and Tricks to Hack Your Workflow

I spend a lot of time on the Internet, reading articles, following startups, and collecting tools. Most things I find don’t stick, for generally one of three reasons: it sucks, it’s cool but not something I need, it’s cool but I don’t need it right now. But, on rare occasion, an app, website, or workflow will actually make its way into my tool chest. Over time, I’ve built a collection of tools, tips, and tricks that make my life a little bit better.

Since I learn about all these tools online, I often assume that everyone already knows/is using them. But I often find my friends responding in the negative when I ask, “Oh, have you heard about [insert service here].” After hearing this numerous times, I decided to assemble a list of cool stuff I’ve found and use. Some are operating system independent  others are iOS/OS X specific (since that’s what I use), but hopefully you’ll find something that can enter your workflow and save you some time and energy.

Credit Karma

All my life I’ve been warned the same thing: there’s no such thing as a free credit score. The closest thing you can get is your free annual credit report1, but those don’t actually list your credit score number (unless you pay $7.95) and you can only check those, at most, every 4 months2.

Then I was told about Credit Karma, which shows you your credit score for free. Free as in free beer. No credit card required. Rather than offering a “free” credit score then charging a monthly credit monitoring fee, like some sing-song sites, Credit Karma makes money by partnering with different credit card companies earning affiliate cash. Everyone wins.

I’ve long been frustrated by the lack of access to information as personal as my own credit score. It’s always seemed to me insane that companies like Experian, Equifax, and TransUnion are allowed to hide behind such shrouds of secrecy and bureaucracy. I would always request my free credit reports, but even that process is muddled and made me feel distanced from my own information.

Basically, I’m really happy I found Credit Karma. It makes me feel in the loop again.

Check out Credit Karma.

Dark Sky

Dark Sky is more of a fun tool than anything else. Basically, it’s an extremely targeted weather app, targeting only on rain within the next 24 hours. While this may seem limiting, this intense focus has created a really interesting, useful, and unique product.

I have the app set to send me a push notification whenever it’s about to rain. The application is amazingly accurate, and usually within about 5 to 10 minutes of the alert it’ll actually start raining. It’s also really handy to look at the rain report for the upcoming hour, checking for breaks in the rain.

Even when the information provided by the app isn’t useful (like when I’m sitting at work or otherwise stuck inside) I always find value. I enjoy being able to scroll through the storm and see the projected rain patters. I like knowing that the rain will stop in 20 minutes or if it’s going to pour for the next hour. It’s absolutely fascinating.

Check out Dark Sky.

Rapportive

Download Rapportive right now. Stop reading the article for a moment and install Rapportive. Seriously. This is the only item on this list where I’m making this statement, just do it.

Rapportive is a browser plugin for Gmail which adds contact profiles directly into your email workflow. Instead of ads, you’ll see a picture of the person you’re emailing, their work title, as well as recent tweets, Facebook statuses, and social media profiles3.

Rapportive is fantastic for putting a face to a name and getting some context to the conversation. It’s fantastic for networking, since adding someone on LinkedIn can be done with a single click. It’s also a great tool if you’re trying to find someone, as you can take guesses at their email address until the correct Rapportive profile populates.

Rapportive is the first browser plugin I install when I get a new computer/browser. It’s the first thing I recommend when talking to someone about email/Gmail. It’s an invaluable tool to my workflow.

There, was that enough of a sales pitch for you?

Check out Rapportive.

IFTTT

I usually get one of two reactions when I talk to people about If This, Then That. Either people have never heard of the service, and stare at me with blank eyes, or they’ve absolutely heard of it and seem surprised that I’m even asking.

IFTTT is exactly what it sounds like, a way to set up if this, then that rules for almost anything on the internet. It operates by checking for triggers and executing actions based on those triggers. If you favorite a tweet, then save it to Evernote. If you post a photo to Instagram, then save it to Google Drive. If it is going to snow, then send me a text message. And on and on with over 50 different services.

I use IFTTT to automatically post my blog posts here to Tumblr, to post shared linked on Facebook to LinkedIn, and to email myself if it’s going to rain. You can browse through popular “recipes,” or make them yourself.

If you’ve ever wanted to automate two seemingly unrelated services, IFTTT can probably find a way.

Check out IFTTT.

MediaWiki

As I’ve written at length before, I use MediaWiki to have my own personal Wikipedia (appropriately dubbed WikiDannia). This is the best way for me, personally, to layout and organize my brain and links I want to save. Some people use Evernote, other’s Pinboard, and others one of the many websites and services trying to capture a slice of the productivity space. For me, a private MediaWiki install is the answer.

While I’ve had a few people contact me, after reading my article, letting me know of their own Mediawiki installs, I don’t expect this process to appeal to everyone. It’s a bit complicated and takes work to edit and maintain4. MediaWiki makes this list mostly because it’s usually a surprise addition to the personal productivity market. I can’t remember my specific “ah-ha!” moment where I realized MediaWiki would be perfect for my needs, but I haven’t yet met anyone who had come to the same realization on their own, although I’m sure they’re out there.

Check out MediaWiki.

App Annie

App Annie is a fantastic tool for mobile app developers. It’s a set-and-forget service that sends a daily email with Apple and Google app sales from the previous day. It also shows percentage movement from the previous day’s sales as well as any new reviews. If you’re a mobile app developer, this free service is definitely worth checking out.

Marco Arment, the creator of Instapaper, has a great post about keeping an Apple developer account secure when using services such as App Annie. Definitely worth a read if you’re setting up App Annie.

Check out App Annie.

Themeforest.net

ThemeForest.net (affiliate), and the entire Envato family of websites, has been extremely valuable to me. Not only have I purchased multiple themes from the site, I’ve also gotten great deals on bundle promotions, videos, and code snippets. I even used CodeCanyon to find a developer for my iPhone app Reader Tracker.

Prices are pretty fantastic, too. Themeforest has saved me countless hours. And their affiliate program is pretty great as well. My blog post about creating Reader Tracker has generated roughly $40 worth of credit, effectively paying for my last few purchases.

Check out Themeforest.

Gmail Meter

I love quantifying my behavior. I’m almost always wearing my Fitbit and I will randomly find myself checking my Facebook analytics on Wolfram Alpha when I’m bored. So when a post about a Google Apps script called Gmail Meter made it to the front page of Hacker News, I immediately set it up.

Gmail Meter is a set-and-forget script that simply sends you can email every month with your email usage stats for the previous month. How many emails you sent and received, your busiest days and times, length of incoming and outgoing messages, everything. It’s complete with graphs and charts and comparisons to the previous month.

I had no idea that Google Apps spreadsheet scripts even existed. Nor that something as incredibly cool could be done. The best part of Gmail Meter is that none of your personal information is sent elsewhere to be processed (like with the Facebook analytics, which is processed by Wolfram Alpha). It’s all done through your own Google Apps suite.

Check out Gmail Meter.

Backblaze

In 2010, I decided to free up some space on my hard drive by transferring my entire music library to an external drive. This was fantastic, until the external hard drive crashed and I lost everything. I’d spent years building that collection, and now it was gone. For two years, I would open iTunes and just stare at all the song names that were now nothing but broken file links.

From then on, I decided to always backup my important files, especially pictures, videos, and documents. I decided to go with Backblaze for my notebook backups, as it’s only $5/month and runs completely in the background. It fits my favorite theme of set-and-forget services.

I’ve never had to use it yet, thankfully, but I rest much easier knowing that my laptop is constantly automatically storing all my files to the cloud somewhere, just in case5.

Check out Backblaze.

Quicksilver

Oh, Quicksilver, how I love thee. Quicksilver is a free OS X application launcher. I simply type Command-Space and start typing the name of an application or document and can immediately launch the selected file. Anywhere, any time. While that’s all I really use, Quicksilver is actually a lot more powerful and can perform actions as well as simply opening files and apps. You can interact with applications by installing plugins, which let you send emails, play music, or launch websites directly from Quicksilver.

It loads super fast and learns from your behavior. It’s the little things that make life better, and Quicksilver is definitely a helpful little tool in my collection.

Check out Quicksilver.

[sc:newsletter]
  1. And annualcreditreport.com is the only legit website for that.
  2. You’re only allowed to request a new report every 12 months, but since there are 3 different reports, you can stagger your requests, getting a different one every 4 months. Kind of like singing Row, Row, Row Your Boat with two of your friends.
  3. Assuming this information is public or you’re already connected via each social network.
  4. Not a lot of work, but more work than, say, clicking a bookmarklet and maybe adding a few tags.
  5. In addition, I manually back up my pictures, music, and documents to my Amazon cloud drive and to a local external hard drive. You know, just in case.

Social Media Alerts are FINALLY Useful or What I Build at Startup Weekend

I spent the entire weekend hacking away at the New York Startup Weekend and we build a really cool product. It’s like Google Alerts but in real-time and from the people you care about on the topics you care about. It’s called OnTheRadar.me.

Right now, I’m following a lot of interesting people on Google Reader, Twitter, Github, Stack Overflow, etc. If one of their posts relates to something I know, I’ll chime in and reply, leave a comment and generally try to help them out. I want to be noticed, to get on their radar. But usually, by the time I see the post it’s hours or days later. The question has been answered and the moment has passed.

That’s where OnTheRadar.me comes in.

We give you immediate alerts when the people you care about talk about something you care about.

If you’re eying a job, you can set up OnTheRadar.me for the team leader for that position. If that team leader ever posts a question related to your area of knowledge, you can be the first to respond and show what you know before your foot is even in the door. Then, when you get the interview, your interviewer will recognize you and has already seen your value.

Or if you’re working on a startup/business/product launch and you want to start networking with VCs1 or journalists, OnTheRadar.me is perfect. Plug them in, set up parameters based on your company’s area of expertise. If it’s ever mentioned, you’ll get an immediate alert and can be the first to respond or comment, so you’ll not only be seen when the post/idea is still fresh in the VC or Journalist’s mind, but you’ll also be seen by everyone else who comments after you.

You can probably think of a million other uses2.

We have a working prototype, but if you want us to actually build this into a consumer facing product, let us know! Do that by giving me your email address so I can go to other people and say “Look how many people want to use this!”

Hooray for customer validation!

  1. There may be a VC with a strong Internet presence comes to mind.
  2. Maybe you can be the first to help Kim Kardashian with her iPhone…

Dammit, Twitter

IFTTT email:

In recent weeks, Twitter announced policy changes* that will affect how applications and users like yourself can interact with Twitter’s data. As a result of these changes, on September 27th we will be removing all Twitter Triggers, disabling your ability to push tweets to places like email, Evernote and Facebook.

Dammit Twitter. You’re ruining everything that made me love you.

Social networks in general are in for some troubled times ahead, I reckon.

Writing My First Code and Mastering the TI-83 Plus Graphing Calculator

My high school math classes all required a TI-83 Plus graphing calculator. I wouldn’t have had it any other way. This calculator didn’t just help with calculus, the TI-83 Plus was a pre-smartphone smartphone. I’d spend hours in class playing games like Falldown, Block Dude, Tetris 1, and most importantly Drugwars2.

While I didn’t clock as many hours playing Drugwars as I did with other games, Drugwars was different: rather than only being able to play the game, an ‘edit’ button was enabled, allowing access to the source code. I found I could edit this code, changing a word here and a name there, and actually change the game. It blew me away.

I built my very first program, a game called Toy Cartel, by studying and learning the Drugwars source code, all while my teacher lectured in the background. Players bought teddy bears and lollipops, rather than heroin or cocaine, and I was able to customize each item’s pricing algorithm based on my perceived value of each item.

I soon realized that these TI-83 Plus programming skills could actually help me in my classes. While other students used the calculator’s programming environment to write notes in plain text, like a digital cheat sheet, I wrote programs that would allow me to input numbers and would return not just an answer but each step along the process, allowing me to show my work.

Each week, when we advanced to a new chapter in the book, I’d spend the first day and night perfecting that chapter’s program. As we learned more in class, I’d add to these programs, creating new features and perfecting the algorithms. These programs never ceased to amaze me, even after I had a few under by belt. Something that I had created not only worked, but was actually useful.

I learned something even more important from my days as a calculator hacker: writing these programs, which allowed me to do less work, significantly increased my understanding of the material. Ironically, after writing the program I no longer needed the program. The mere act of programming, breaking quadratic equations and other problems into their bits and pieces, helped me more than solving 10 questions every night for homework.

When I left high school, programming left with me, in favor of more liberal arts pursuits. But I’m working to get back to code, to make up for lost time. Among other things, that’s why I’m learning to program. Because it’s fun, useful, amazing, and, most importantly, it teaches me how to think. I’m thrilled to be back on the math band wagon.

Want to follow along with me? Check out the Code Journal category or subscribe to my blog.

[sc:newnewsletter]

 

  1. 2-player Tetris ruled my life Junior year.
  2. Here’s a quick overview of Drugwars for the unacquainted: You try to buy drugs at a low price and sell at a high price by traveling to different cities where drug prices vary.