Learning to code, like a child

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.

hellow world copy
See, coding is easy

 

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.

coyote obstacle
Obstacles

The obstacles

  1. 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.

chunks
Chunk(s) [seriously that’s him on the left, yeesh]

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.

librarians dont live at library

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)

  1. 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:

adventuresinraspberrypi

Adventures in Raspberry Pi by Carrie Anne Philbin

LTPWMCover

Learn to Program with Minecraft by Craig Richardson

automateboringstuff

Automate the Boring Stuff with Python by Al Sweigart

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.

old man minecraft

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 haven’t completely ignored work based projects. The Al Sweigart book is a much more relevant to work, and is not too onerous. I’ve also picked a project to work on, so it’s useful to have that in mind. In particular a friend in another college library shared with me a rather clever piece of javascript code he wrote several years ago to automate a task that I also want to automate. Looking at it last year it was gibberish, but he was kind enough to talk through it with me last week and already some of the principles I’ve picked up from the Python lessons helped it make sense. So, with a bit of ‘fun’ introductory work I am beginning to feel like a work based project is just around the corner.

111290-LOST-John-Locke-dont-tell-me-w-zxpo
Ok John, ok. Go ahead and use those kids coding books, no one’s judging. Sensitive much?

CONCLUSION

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.

Advertisements

2 comments

  1. I am certainly no seasoned coder but it’s been a hobby of mine since having a Spectrum. However, what you’ve written all rings true for me. I’ve found it good to work on something useful (and I would define useful in this case as also meaning fun: I’ve always tried to make simple games, at least until I got sidetracked into library stuff). After an initial idea of the basics, I think it’s good to try and build something and then look up what you need (rather than learning everthing before starting). I’m trying to learn python on the third attempt, the first two of which stalled because I had nothing to do with it.

    I’ve found web programming to be a useful way to start as it’s immediate, takes care of a lot of the display niceties, and can be shared easily, etc, but that does mean having to learn how that all works first, which presents an obstacle you could probably do without. I’m also jealous of the Minecraft angle as my son would be much more impressed with that than with whatever I would normally come up with!

    Like

    • Thanks for the comment. I’m hoping to get a project going as soon as possible, but without a sense of what is feasible i have founf it hard to imagine what would be best to start on. Python seems like it might be a good fit for a variety of projects, so I;m hoping that will help. I;m interested though that a fair few people have said to me that X language is good for we, or Y language is good for something else. I hadn’t really realised that coding languages were sort of specialised in that way, but I suppose it makes some sense.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s