A few rambling thoughts on Learning to Code
Just my own personal observations about my learning. Thought I'd share it. YMMV.
Anyone can learn to code, young or old.
(may be controversial) The younger ones may absorb facts faster than us, older folks... so we older folks need to study smarter, not harder.
Good sleep/rest/breaks is a must -- or the brain just shuts down and can't absorb any more.
(unscientific?) It's during this break/rest/sleep stage where my brain tries to organize this new fact I just learned. I call this the "simmering/percolating" stage. It's like a new piece of a jigsaw puzzle landed inside my brain, and now the brain is trying to find its rightful place. It's at this stage where "I get it/I understand it now" and the whole bigger picture appears more clearer as the different pieces land on their correct spots. Or maybe not... then it's just filed somewhere for later recall.
Don't feel guilty about sleeping, working out, going out, watching a movie or taking a break. These distractions and rest phase are good for the brain. Your brain is still working subconsciously. Take naps! It enhances learning.... (back to the simmering analogy).
Computer Books are expensive ($35-$50) typically. I try to avoid buying them and try to find free alternatives (reference sites, free PDFs, blogs, etc).
But I find that when I do actually buy the physical book (not a PDF version) and hold the book in my hands, read it, mark it up, write notes all over it, totally OWN/AB-USE the book -- that I get a lot more out of it. i.e. my learning seems deeper.
I look at my bookshelf and noticed books that were really used/abused, wrinkled, bookmarked, dog-eared, with coffee/soda ring marks, dried food crumbs, with broken/worn down spines are the ones that I learned a lot from. I don't know why... maybe the simple act of spending "real money" on the book makes me want to extract the most information out of it. i.e. "Heck yeah, I'm going to get back my $50 (and maybe multiply it more) out of this book!"
Now, when reading a chapter/topic that I don't understand, I just keep reading... no need to get stressed over it. Somehow, the brain will organize this new, confusing information later on. And put 2 and 2 together. Take a break, sleep on it!
Which also means, it's okay to use another resource (another book, another video/course, website, PDF) to read about the same topic. Read something different or use a different mode of learning (watching video). Sometimes the video instructor will mention something casually off-hand or re-iterate something that makes you "AHA! I geeetttt it." i.e. what you read in the book, and what he said... put them together, and it finally makes sense now. And then going back and re-reading the same confusing chapter/topic may now provide more clarity.
Most of my learning happens when I'm DEBUGGING. The problem could be my own doing (typo, missed a line of code, undeclared variable) or the problem could be caused by the author/book publisher (typo, different software version used). I try to compile the code and suddenly I'm greeted with an error message (or several, like a domino effect).
I try to solve the cryptic error message, trying out different things, searching google, reading the official docs site, and when I finally solve the issue and the program compiles and run successfully and produces the expected result, it's a big CHEER and victory dance! YES!!! GOT IT!!! AHA!!! So that's how that works! I understand now!
Don't get me wrong. Debugging is not fun, sometimes its long stretches of time blankly staring at the screen, but your mind is actively executing the code in your brain... trying to understand it, trying to get into the other person's mode of thinking. But at the end of the process, you've learned a ton of new things.
Second to debugging, most of my learning happens when I'm writing my OWN code. (not retyping what I saw in the video, or saw in the book.) Maybe writing my very OWN code is related to the above process of debugging... because usually, it's going to need some fixups to make it work correctly.
Note that debugging and writing your own code are "hands-on" activities... not passive, like reading or watching a tutorial video.
If you're trying to learn woodworking, watching a bunch of videos and reading books about woodworking will not make you cut wood straight, or hammer a nail perfectly. You need actual hands-on practice to actually learn woodworking! --- well, it's the same with programming! You need to actually write code, debug code to learn programming!
Just like the learning woodworker, a learning programmer learns the most from their mistakes! So you'll know what to do (or not to do) next time!
Programming is hard. You're basically trying to teach your dumb machine some new trick. But with practice, this process gets a little bit easier/faster each time. The more you do it, the better you become. A few, small, steady forward steps added up makes for a big leap in learning. Keep coding my friend!
** Right now, I'm trying to learn .NET Core 1.1 by Microsoft.