Having decided to learn to code last year I then had a slight problem; how do you go about doing that? Wait, I should clarify. The question is more like: How do you go about learning to code when you barely have any free time and it’s not part of your job to be learning code?
Having mulled over the idea to learn early last year (2015) I took my first steps toward coding by getting a Raspberry Pi in the May. My motivation to get one was partly due to coding, but also the various other fun things you can do with it; the electronics, the internet of things, it looked fun, etc. I also decided early on that Python was likely to be the best language for me to learn given its affinity with the Pi and general recommendations about it being accessible to beginners. The accessibility is reflected in the relative ease to achieve something in understandable language, the print “hello” principle.
This in itself was a useful decision as it has certainly helped me filter out some of the sheer mass of potential advice and resources out there across all the different languages.
With this established I then failed to do anything for several months, until very recently. I thought it might be useful to set out the main obstacles that I found to starting (some of which resided largely in my own frazzled mind), and then set out my solutions for keeping myself going.
- Time (that old chestnut)
We all have time commitments, but I must admit I did pick a particularly time-poor moment to start. In September my second child was born and my first-born began school. In the lead up to these events, and for some time afterward I had no time to pick up anything new. I mean, apart from the baby, he was pretty new and pretty much insisted on being picked up regularly. Babies are selfish like that.
I also don’t have any allocated time at work to do any of this, this is very much off my own bat. That is not to say work aren’t supportive, after all they let me out into the wild to attend Library Carpentry. Beyond that I am on my own, this is strictly a self-motivated bit of learning in my own time.
More than anything I suspect the fear of how much time this would take has held me back. I’m used to researching history (albeit in my own amateur way) which can take bloody ages and its something I always found very difficult to manage in small chunks here and there. So I feared coding might suffer from this and frankly without being able to do it at work, small chunks here and there is all I have.
2. I am a child (part 1)
“When I was a child, I spoke as a child, I understood as a child, I thought as a child” – Kanye West (possibly, citation needed)
I am at the very, very beginning. I am a novice. A coding child. A lot of ‘learn to program’ advice says find something at work you need to fix, improve or streamline and then work out the code you need to do it, learning as you go. Or, find a coding solution that someone else implemented, pick it apart and adapt it for your own use. This makes sense, and to some extent I am starting to do that now, but the problem with this approach is that I simply had had no experience coding, at that beginning point I didn’t even understand what was possible and what was crazy talk. I looked at a few coding solutions, even easy ones looked bloody terrifying. As a coding child I need motivation to start, I need it explaining to me from the beginning without assumptions, I need it simple but not patronising.
3. I am a child (part 2) I want it to be fun, waaah, waah!
Given the first two points motivation then becomes essential, but it isn’t always hard to come by. I’ve got so say the potential work benefits aren’t always enough for me. I appreciate that I’m lucky to have some spare time (now the baby sleeps in the evenings!), I work 8-6 (including the commute) so there is some time. Yet, I don’t really want to spend my spare time always thinking about work, even if it’ll make that work easier. I love my job but I also love my sanity.
So yeah maybe it’s a bit childish, but I want to enjoy the process of learning to code. Can it can plug into my interests and hobbies? After all it’s going to be competing with them.
My strategy (for what its worth)
- Try multiple things at once
I’m jumping between a few different introductory books instead of ploughing straight through one. They are covering the same ground, but that is what I need. Each one has explained more or less the same things but from different angles, which is helping it to stick.
It helps that the introductory coding books I’ve chosen (and this may well be common across teaching tools for coding) tend to be broken up into little projects, through which you learn the next relevant principle. It’s learning by doing, step-by-step and you create your own notes as they are there in the code you create.
Also, I’ve gone ahead and bought physical copies of books, some of which were already available as online versions. It’s great that the online versions are there, it brings the cost down significantly if you really need that, but for me I like to work from a book so that I’m not switching between screens all the time.
The books I’ve gone for are:
2. Learn like a child
The first two books on the above list are for kids. There are just so many good coding resources aimed at children, particularly for Python. These two are great, they don’t assume too much knowledge, they make the learning entertaining and break it down into chunks, whilst retaining the challenge. To be honest some of the Maths in the Minecraft book had me struggling, which probably says a lot about my poor mathematical education compared to that expected of kids these days. Embrace the inner child I say.
3. Motivation by focusing on what is fun
I’m a grown-ass man learning to code by playing Minecraft, and you know what; it makes it fun and it’s memorable, so naaah! I hadn’t played Minecraft for a couple of years (like since totally before it was popular, ahem) but it’s a nice virtual environment to manipulate and spend time in. The code you write has a direct impact on a virtual world, that’s quite powerful, even if that world is made of blocks.
Now, I’m easy to convince. I’ve been a gamer all my life, it’s something I would be doing to some degree in my spare time anyway. In fact looking under the bonnet, even in a basic way as some of the lessons from these books is really enjoyable to me from that perspective. But, even if you’re not ‘a gamer’ approaching coding from this point of view should be engaging. There is a tangible, interactive outcome to the coding that you’ve learnt and you can add your own creative flourishes as you wish.
4. Keep the project stuff in mind
I guess this is something of my own peculiar personal approach to this topic, but hopefully some of the principles are relevant to others who might be interested in coding. Certainly I shall take the advice of John Locke and do it my way. If any of you seasoned coders can think of other additional steps I could take to help embed the learning let me know in the comments below.