Monday, December 19, 2011

What coding sources do you suggest for someone starting out ?

This is a question I am often asked, usually in the form of "how do I start coding" or "where can I find a good tutorial on coding". I usually suggest that people start to learn to code by learning to make bash scripts. Bash is an often overlooked medium for the budding coder, but if we face it, it is probably the place where most of us started out and most of us didn't realise at the time that we were actually coding. I know that a lot of people will put down bash scripting and say that it is a useless thing to learn, but I strongly disagree. Once you have learnt the basics of bash, you can very quickly use it to perform quite complex tasks. The knowledge that you will attain from this can be applied to other languages as you gain experience and feel the need to move to a more powerful language or want to learn a new one such as python.

So here are a couple of what I would call quite good resources for someone wishing to start their journey into coding.

Firstly, bash

http://www.tldp.org/LDP/abs/html/index.html

Don't be put off by the title "Advanced Bash-Scripting Guide" as it starts of very basic, and then progresses to more complex topics. The author even says that "This tutorial assumes no previous knowledge of scripting or programming, " so it's perfect for the beginner.

Ok, so what if you want to learn Python.

Well I don't think that there can really be a better source on this subject than that provided the people that produce it, so in this case python.org is my suggestion to you.

http://docs.python.org/tutorial/

There is always the question when it comes to python, which version do I learn ?
Well in my opinion and remember that this is just my opinion, you should learn 2.x

Why 2.x and not 3.x ?
Well, when 3.x came out, there were significant changes to the way in which the language worked. Those changes were so significant that it made 2.x and 3.x code incompatible and backwards compatibility was broken. This caused a big rift amongst the users of python causing very few to be willing to rewrite in some cases millions of lines of code to make it 3.x compatible and as such, more than 95% of python code you will see today and probably for some years to come will still be based upon the latest 2.x version.
So because of this, I always suggest learning 2.x and not 3.x
If at some time in the future you find yourself in a situation where you need to write 3.x code, you can always pick up a book dedicated to updating your skills to 3.x python.