So I recently started to learn how to program and one of my current jobs is "college prep tutor." Part of the approach that I teach my students is that if you study in the right way the test is easy. We've all have had the experience of zoning out reading a page of a book and realizing that you don't remember a single thing or getting to the test and realizing none of the questions were things that you studied. I don't want the equivalent of that with programming. So I want to share my current approach for learning how to code, specifically from programming tutorials and courses on youtube or udemy. My hope is that I can help other people to avoid that problem and if possible get feedback on my approach from more experienced developers.
So if I understand programming correctly my goal should be to be able to translate a "desire" into code that does that. By desire I mean both a feature request ("I want this button to look like it's pressed in when I click it") and a bug report ("the website is broken, fix it"). I also picture 3 large domains existing for programming skills:
- Technical position at a company
- Freelancing building projects for clients
I believe that this goal prepares me for all 3 of these domains. If someone with more experience can contribute to say if that is the right goal or if I'm missing part of the equation I think that would help a lot because that would change my approach to learning.
If we assume that that is a good goal then let me share how I approach learning from tutorials.
My Process for Learning Programming
- So first I start off with a desire for a computer to do something.
- Let's assume we're building a timer
- I start searching for tutorials on how to do that project on YouTube. If none exist I'll look up smaller parts of the project.
- I find a video like this on youtube
- I'll build what is in the video. I take notes by watching the videos writing down steps but not coding along. My notes are formatted into specific problem solving steps with the relevant solution in pseudocode.
- Get Text to Display on Screen
- Add <p> tag to body of HTML
- Use document.querySelector(#id).innerHTML to select
- Link that text to a variable.
- Define a variable with let and then set the variable equal to the text
- Get that variable to count up every second
- Set a counter and use setInterval()
- Set interval put the function in first, then time interval (in ms)
- After going through the coding tutorial I'll run through and quiz myself how I'm going to break down the problem in that pseudocode by trying to reconstruct the steps from memory.
- Then I'll open the code editor and start on the video's project. I find myself getting stuck for one of 3 reasons: (1) I am applying the code in the wrong way or with the wrong syntax/organization; (2) I know what I want to do but I can't remember the solution; (3) I don't know what the next "desire" is.
- For each I'll try to reason my way through: (1) consulting blogs and docs to see working examples, googling error codes, or checking the output of smaller parts of the function, (2) I'll use a piece of paper to figure out what I want the computer to do in pseudocode (3) I'll look my notes for the next feature request, but not the solution.
- If I'm still stuck I'll consult my notes on the solution with the option to reference the video if I'm completely stuck.
- I'll finish the coding project from the video.
- Then I'll start on my project trying to implement what I learned towards the solution. If I get stuck here I'll consult my former code to help me out.
- I'll google solutions to smaller quirks along the way if I want to do something different than the video's project.
What I believe that the benefits of this approach are:
- I get a working project to tinker around with and add to my portfolio quickly
- I simulate the idea of a feature request and trying to reason my way through it. Which I believe simulates programming in the real world.
- I am working towards a completely unique program.
- I'm building a more general set of problem solving skills rather than brute force memorization.
Current problems with the approach:
- I find myself making the same syntax error over and over again. This happens because I don't understand a concept beyond that specific application. I have thought to work with the documentation more but I'm not sure what to do with it. Do you have any ideas around this?
- It is incredibly slow to work through a problem like this rather than copy and pasting code and reasoning my way through understanding it. How could this be sped up? Are any parts unnecessary? When, if ever, should I just copy and paste or use existing documentation?
- If no relevant tutorial exists I'm not quite sure what I would do. How do you solve problems that no one has shared a solution to? I assume you draw largely on past knowledge, so is this even a problem that I should worry about as a beginner? At what point should I do something like look at a feature in a website that I like and try recreating it in code?
- There is no "clear progression" from novice to expert. I have no idea when I would be considered intermediate or advanced and that leads to an imposter syndrome.
- Unknown bug reports and errors are still causing a lot of worry for me. I can read the error code but if I don't know the answer and there's no stack overflow answer I'm screwed.
- I see that my goal of "turn desires into code" might miss some larger picture goals like how to decide between different ways of doing something or organizing larger projects. Can I trust tutorials to teach me the best practices for that? Should I spend time studying code? When should I learn those larger topics?
- I can give myself just enough rope to hang myself. I can select a project that's too advanced for me and it can take me a week to go through it.
- I'm not sure how interview questions fit into this. If my goal is to be able to land a job at a big tech firm when should I start drilling those problem? Should that be part of my education or should I just save that for right before I start applying?
- I have a gut feel like grasping more fundamental concepts in programming may be useful at some point. I've heard that CS50 at Harvard is a great course but I'm not sure when it would be useful or how it would benefit my skills.
These are tough questions but I feel like they are critical for making sure that I'm not fooling myself or wasting my time. If you're new hopefully this helps you understand how you can learn more from your tutorials. And if you're experienced please share how us beginners could learn the right skills faster.
- Find a problem in your life or an app that you like and work to code it yourself
- Follow along with tutorials along the way
- Go through some basic courses as you do so
- Teach as you go