How To Learn To Code
Learning how to code requires you to fail. If you don’t believe me, let me tell you how I learned how to code:
My arm pits were sweating as time ticked away. I needed to get my tests to pass by completing the long list of objectives that I’d started since 9 in the morning. Time was running out: the coding exam was supposed to be over at 7 p.m.,and there was five minutes left till then. I wasn’t going to finish in time, I knew. Took me too long to properly set up class structures. Damn. Didn’t know the exam was going to be this difficult. Hardly anytime for Google searches. Fires needed to be put out. The problems were becoming progressively more difficult.
7 p.m. The exam was over. I hung my head, dejected. There was a glimmer of hope that I’d passed the assessment test that would allow me to move onto the next round in the coding bootcamp; I’d gotten a lot of tests to pass. I plopped on my ergo chair, chatting it up with my cohort, trying to be optimistic about my prospects. We would get our results emailed to us later in the night.
I found my result after commuting home.
I failed. My heart sank. I screamed into a pillow.
But then I settled down. My bootcamp allowed you to repeat a segment just one more time. Bootcamps don’t like failures. This one was one of the more lenient ones. Know what I did next?
I looked at all the lesson briefings I’d skimmed over, too tired to read them after spending the whole day working on coding problems with a partner(pair groupings are taxing). I realized that I’d skimmed over a lot of crucial information, information that would have allowed me to solve problems a lot more quicker.
I also broke down my learning pattern at the camp. I realized that I spent far too much time paying attention to others rather than focusing on my work. I did a lot of complaining about the difficulty of coding with my cohort mates. I did a lot of sitting.
To fix these problems, I got some headphones to drown out noise and made sure to fully take advantage of my time alone. Rather than lazily skating through practise problems, I attacked them as if a paycheck was dangling over my face. My new cohort mates, the fresh recruits, thought I was a man possessed.
I even surprised myself. I began solving problems that I thought I was “too dumb to solve.” A particular favorite of mine was the snake search algorithm. I kept pushing and pushing to the point that my mentor just looked at me and said during a code review, “Wow, Raji, I’m impressed. This is great.”
By the time the exam rolled in, I popped in my headphones and listened to the Weeknd as I cruised through the exam. Throughout my remaining time, I never failed another exam.
How did I learn how to code?
There’s this oft repeated phrase that goes, “practise makes perfect.” Said without context, that is not true–at least not absolutely true. Practice brings the conscience into the subconscious, which is good. But bad practice brings bad habits into the subconscious as well.
An example of one of my bad habits was my overreliance on inefficient methods of problem-solving. Rather than using built in methods, I practised reinventing the machine, fooling myself into believing that I was becoming a good coder. I did this because it was comfortable to draw out code exactly as my brain processed them rather than looking for abstractions. I became good at being inefficient rather than becoming good at being efficient. In order to fix this, I implemented a few methods that you can use to learn how to code.
First, I asked a lot more questions my second time round. T actually learn something, we have to know the right way to do it. And to know the right way to do things we have to ask questions. I made sure that what I was doing was efficient, not only correct. It’s very easy to say, “well, the code works, so that’s that.” But why does it work? How can I do the same thing with less code? Is there some method in the documentation that will allow me to achieve this goal?
Secondly, I reinforced my learning with review. After spending the day coding, I would get home and go over the lesson plans to ensure that I grasped nuances that would help me improve. We can always reinforce our learning by changing things up. Why not read a book? Then, switch over to a quick and dirty article? What was left out? What can you add? That makes the actual coding more fun because you’re engaged with the code. Now, this is not possible for most people, but, in small increments, it may help some.
Next, I practised consistency. I dedicated a fixed number of hours per day to all-in programming. But consistency can be a few minutes per day. How do valleys form? Water erodes rock gradually over time. That’s the indelible mark we want knowledge to leave in our mind. That only happens with constant application.
He was stuck in that vicious cycle that I knew all too well, a cycle that led me to plunge into an overly expensive bootcamp. He was comfortable in that giddy stage of acquiring new information. Once that high is gone, it’s onto the next language. That’s because looking up at that mountain is far too intimidating. Building with the tools you’ve acquired takes resolve.
When you code with the aim to build something you’ve never built before, you’re no longer being passive. You will experience nagging doubt. Frustration. Oh, the frustration. You will learn along the way, but the learning will come through embarrassing mistakes. We do not like to look foolish, even in forums.
I think the greatest fear is the fear of reaching a dead end if we do take on a project. That’s because by the end you start to think if you’re really cut out for this coding business. And that really hurts. We don’t want to look in the mirror and have to admit that. So, we go back to square one. Rinse and repeat.
How do we get over this hump? Well, a mentor would be a great help. But not all of us has a coding prodigy waiting in the wings. So, the next thing we have to do is ask ourselves what we want to do with coding. I really wanted to learn to code because I always saw myself building a website to connect with others. Others might really want to someday become a senior dev.
Lay out a step by step plan and envision what you’d need to be able to acheive your goal. For me, I needed to be able to become really competent with CSS and have a good understanding of event-based programming, along with some backend knowledge. If you want that job, you can ask in forums what you need to know.
Then, you create a portfolio of projects you have to create…why am I mentioning all of this? We have to trick our brains into thinking the goal that we seek is a reality as sure as getting that meal you ordered from GrubHub.
The key is that we have to learn to code like a chef, not a diner.
What I began to realize, painfully so, was that simply reading from a textbook deluded me into thinking that I was making progress. Sure, reproducing the code examples was easy enough, but getting snippets of code to work is a far cry from solving the day to day problems of coding. There are no helpful hand holds when you actually have to set the environment up yourself. Most answers to questions that you’re going to have will be on Stack Overflow. But I did not have the mindset then that it was okay to break things, ask for help, re-build, and break things again.
I thought I was supposed to know everything after I finished reading a comprehensive book or after completing a codeacademy course. I’d start getting the are we there yet? syndrome halfway through a course, then I’d hop over to the next course. Rinse and repeat. I was that diner at the table who yells at the waiter or waitress, asking,”is the food ready yet?”
This is a mentality I couldn’t shake off till I was entrenched in a 12,000 dollar coding boot camp. During the course, it finally dawned on me that programming isn’t Biology - you don’t have to memorize every function, every bit of markup, or property.
All you need is an understanding of the steps it takes to complete a project. The online sources make up one large cookbook. You use the cookbook to help you solve your problems. Say step 1 in building a website is to set up a file structure. I can refer to the cookbook to find out how this should be done. Problem solved, file it in the memory bank, and move on.
This is what the kitchen vs restaurant mentality is all about.
Throughout our schooling, we’ve been used to getting served our education through homework, classroom lessons, and tutoring. At the end of x amount of years of education, we get served a diploma. We expect to understand everything after we’ve had a standardized learning curriculum dished out to us. The restaurant mentality works if you’re dealing with static theoretical subjects, but many people who get served this type of education realize that it hardly applies to real life.
The kitchen mentality completely shifts the way you go about learning. You set a goal, like the completion of a website, and then you set up a task list. At every step, you search Google/books/etc. for answers to questions, implement the answers, and you move on.
So, when you encounter a problem that takes more than a day to solve, you’ll keep plugging away because the goal must be reached. When that problem is finally solved, the relief you’d feel will carry you on because you’ve already laid out a plan. Every broken hurdle creates momentum.
Now, once you do break the hurdle, it’s important to learn from the struggle by recording it. You can have a file for this purpose until you get good at solving that issue. In the Art of Learning, Josh Waitzkin asserts,“If a student of any disciple could avoid ever repeating the same mistake twice, they would skyrocket to the top of their field.” That’s not to say that we can’t make the same mistake twice, it just means we have to be able to self assess.
My self-assessment allowed me to shed my bad habits quickly. Mere repetition may have allowed me to improve, but it wouldn’t have made a substantial difference. My poor habits would have caught up to me down the line. Rather, my willingness to correct my mistakes vaulted me to nearly the top of the cohort, leading me to earn some appellations, one of them being The CSS Master(relatively-speaking).
I’ll end this long diatribe by saying this: we should at least learn to love what we learn. If you love someone, you’ll be willing to overlook their faults. The same applies to coding. Sitting for long hours is tough. Staring at a screen that hardly changes is tough. Staring at a problem is tough.
But, hell, the result sure is sweet.
Bonus Content/ Glossary:
Documentation: These are pages curated by language experts that provide detailed explanation of almost every aspect of the language. It’s like the instructions to IKEA furniture. You should treat them like cheat sheets if you want to be able to solve problems as you code. They might look a little scary at first, but you’ll get used to them. You should make a habit of frequenting them wheveever you get stuck.
Coding Bootcamp There are many coding bootcamps out there. Most of them cost a lot of money and they teach you different languages depending on the bootcamp. I would honestly treat these bootcamps as a last resort if you really feel like you’ve tried everything or if you’re the sort of person that isn’t self-motivated.
Resources you can use to learn how to code
When you first start learning how to code, it can be difficult to find resources that will help you along your arduous journey. Whatever language you decide to learn will have its own set of quirks that you have to grapple with. Sometimes, you may feel like you’re not quite cut out for programming. But don’t fear. Anyone can learn to program with a little bit of perseverance. Results won’t occur in a month, two months, or three months. It may take a year or more to make much progress.
However long it takes, there will come a point where your skills will be sharpened enough to work in teams of coders to build and maintain projects.
Teach Yourself Programming in 10 years
Peter Norvig, director of research at Google, wrote a great article about the importance of treating programming like a craft. This should be pinned somewhere near your computer as you pound your way through #100daysofcode. It will remind you that growth happens over many months.
100 Days of Code
Speaking of #100daysofcode, what better way to motivate yourself than to join a challenge? The principle of this challenge is to commit an hour every day to coding. You should continuously strive. Sometimes, we need the help of others to keep ourselves accountable. You can tweet your progress and encourage others.
Carrying on the spirit of community, Dev.to offers a wealth of resources for new programmers, intermediate, programmers, and professional developers. There are topics ranging from job tips to command line tips. The articles are written by developers for developers.
The Odin Project
Your Career in Web Development Starts Here | The Odin Project
_Tracks are our way of offering multiple paths through our curriculum. You can change your track at any time, and your…_www.theodinproject.com
If you’re itching to join one of the many expensive coding bootcamps out there, try The Odin Project first. This website provides a free curriculum that will teach you how to build a website from the ground up. If you plan on becoming a web developer, you should give this site a shot.
The Code Player
There are times where reading a well-written article or book just doesn’t cut it. We need to see the code being written live.
Focusing mainly on CSS, The Code Player teaches you how to develop various website features like drop down menus and sliders. All of this is accomplished in a live code player. You can pause or adjust the coding speed to your liking.
Even the most experienced developer needs a cheat sheet from time to time. If you have a hard time remembering a particular syntax, you can simply bookmark a cheat sheet from OverAPI in a language of your choosing.
At some point in time, you are going to have to learn to document your code. Markdown is the language of documentation. Github’s guide is extremely scannable, which makes it the perfect reference for anyone who may need to know how to present,say, a code block in their documentation.
Learn Code The Hard Way
This website focuses on teaching scripting languages that aspiring back end developers may want to learn. Don’t be triggered by the title of the website: the site covers a lot of the basics of each language. Unfortunately, the only free course is Learn Ruby The Hard Way.
Front End Masters
Front End Masters is one of the best ways to learn all of those new front end technologies that technical recruiters want you to know. The videos cover Vue.js, React.js, Web Assembly, and much more. The videos are segmented into sections, so it’s easy to code along with the instructor. If you have a few dollars to spend on the courses, this site will teach you a lot.
How To Center in CSS
If you’ve worked with CSS even just a little. You may have come across the fact that centering elements isn’t always easy. Though this site is more of a crutch, you’ll learn to live with the fact that CSS requires a lot of trickery.
It’s duly appropriate that there is a site called CSS Tricks. Normally, if you have a CSS question, this will be the site that shows up in Google search. It’s a fantastic site to learn the twists and turns of CSS.
This site is unlike many tutorial sites in that it is structured like a book. The site map is laid out in the home page so you can jump from lesson to lesson. Each lesson ends with a set of tasks that help reinforce what you learned in that lesson.
Google’s Web Fundamentals
If you’re an aspiring web developer, there comes a point in time when learning how to comply with web standards becomes just as important as learning new technologies. Google’s Web Fundamentals teaches you how to provide the best user experience possible while avoiding design pitfalls.
Rich On Rails
Though Ruby on Rails may have lost steam these past few years, it is still a powerful framework that has lowered the barrier of entry to the world of web development. Rich on Rails supplements basic Rails knowledge by providing tutorials that teach beginner Rails developers how to perform routine back end tasks like authentication.
Computer Science Circles
Computer Science Circles | 01000011 01010011 01000011
_New around here? Read Using this Website. You can also click here to create an account or log in. This website teaches…_cscircles.cemc.uwaterloo.ca
If you’re a computer science student at college, you’re most likely going to be working with Python. Computer Science Circles teaches you the fundamentals of Python. It also provides a sandbox where you can try solving problems.