Codementor Events

Breaking into Coding

Published May 27, 2017Last updated Nov 23, 2017
Breaking into Coding

I have taught for the last few years under Startup Institute and now Trilogy at Northwestern University here in Chicago. One of the inevitable questions that I get with every new cohort is how do you know so much / are so confident when it comes to coding / etc? Well, it didn't happen overnight but after a solid couple of years of thinking, talking, and sometimes even crying I often appear to be completely in control of what is getting displayed on my screen. (not always the case, just ask me about cryptocurrency mining sometime, yeesh!)

This was not always the case. I used to struggle, quite often to distinguish between jQuery and vanilla JS when they seemed to glide so easily between one another. I used to mess up my opening and closing HTML tags just like you did (do?) but I got through it and I'd like to share with you some of the reasons why and how I did.

Experiment and fail early

Your console is there for a reason. Use it. Fail. Get a NaN every once in a while, or repeatidly if you wish. Try things out over and over again, changing it ever so slightly and make sure you can see the difference. That's probably the most important part. Be able to see the difference in effect that you're making. Scientists do not experiment and then willy nilly say that something is a certain way for no reason. Talk to any scientist and they will be able to come up with a root cause for whatever experiment they just ran because they only changed one thing at a time and can trace each change and every affect that had on their system.

Surround yourself with people learning the same thing

Even though I think the modern school system is broken, I still think you should surround yourself with people who are doing the same thing as you. I did this repeatedly when I first got into coding. I would invite all of my friends who I knew were coders to a starbucks with a big table and we would all work, get food, talk about what we were working on, work some more, and most importantly help each other out. We started to discuss what we were doing with each other and pointed out how to do things better or differently. We taught each other things that we never would have seen by ourselves.

Ask all the things

If you're deathly afraid of looking like an idiot every once in a while you probably shouldn't be coding. Humility is abosolutely necessary. You will read things others have written, and not understand them. You will (hopefully) surround yourself with people who are better at this than you and to that effect you will have to question every idea (experiment) that comes into your head in order for you to know it for sure. A great way to vocalize and practice this in order to internalize it quickly is actually to externalize it; to ask someone sitting right next to you. Just strike up a conversation by asking the question you just had in your head and if there was any term they used you don't understand ask what that term means then the next one then the next one until you finally have a pathway for your original question.

Rebuild things other people have built before you

There are so many JS frameworks out there. I started by rebuilding (most of) backbone.js and underscore. I eventually moved to jQuery and now have a fully functioning framework. It is over 20k lines of code and I know each piece as well as my keyboard. Start by creating an object, and create a forEach function on that object. Then make that function work. Keep going until you have a basically working copy of underscore. (30+ functions) This one "trick" has given me more confidence in my coding than almost anything else... except for this next point.

Learn to test your code

Learn how to create unit tests. I use jasmine, but I have been transitioning into my own testing framework recently because I am able to configure it to work in a couple of extra environments which jasmine simply does not. Mocha is good, I have heard good things about Tape, and many others. Test your code, break your code then fix your code. That is how you build confidence in what you are doing.

Be prepared to be you

If you're reading this you were probably not the most popular kid in your elementary or high school. I think this dichotomy goes hand in hand with coders. While coders are often home to misfits, it is not impossible that the drive to code may be to prove everyone wrong and possibly create something that everyone / anyone can use / love when we as people may not necessarily be. It creates an odd cycle where creating something that no one else has you become that much farther from the norm. Parts of you might suck. But this want, this drive to learn, does not. While it can at times be lonely, it is the only life I want for myself.

Do not be afraid to tackle hard problems

Right now I am actually avoiding working on an algorhythm for detecting line segments on a 2D plane that another algorhythm defines. Such meta, much line. I will be going to a coffee shop to work on this immediately after I finish with this post.

Measure your time

If you want to spend 10 hours a day, great. Do that. If you don't then do not, but closely monitor the number of minutes you are using. Have you ever been driving and jolted upright amazed that you cannot remember the last 10 minutes? Well imagine that happening all of the time but for hours. It happens. Stay focused. Stay alert. Take a break if you can.

Discover and read more posts from Michael McLaughlin
get started
post commentsBe the first to share your opinion
Anthony Swift
7 years ago

Great post. I agree with what you say regarding tackling harder problems and failing early. I am still relatively new to coding and I find I learn so much more when trying to solve harder problems and keep failing over and over. I feel like I learn the hard way going through the pain when my programs don’t work and it pushes me to really think about it.

John Abraham
7 years ago

I can break down anything.

Ian Wang
7 years ago

Thanks for the post Michael!
I think tackle hard problems and test your code is especially important for beginners.
Learn to break down big problems and actually control your code will make you more confident about programming.

Show more replies