Many people tell me that they would like to learn programming, and ask my advice on how to get started. I started programming so long ago — constructing BASIC programs on a BBC micro at primary school in the eighties — computing has obviously changed considerably since. Even the term programming is broader.
There are many different ways to introduce yourself to programming, some of which I approve of, some I would not recommend. If you’re thinking of dipping your toes into coding, which technologies you start to learn, largely depend on what programming you want to do.
I’ll try to give some general advice, based on over thirty years of programming in different languages, to help you decide if software engineering is for you. Programming can be rewarding and a lot fun. It can also be frustrating, so it’s important you have a positive initial experience. As for many new things in life, things worth learning aren’t easy, so allow yourself to struggle and fail occasionally. The good news is, now more then ever, there are a host of resources out there, when you do get stuck, which you will.
LEARNING FOR THE WEB
Lot’s of people will come to programming via a desire to create websites. Programming isn’t necessary for website creation nowadays. It can be sufficient to have a good grounding in computers. And I’m not talking about Facebook pages or blogs. Content Management Systems, such as WordPress use visual tools to layout and create web content, and many themes, such as Divi by Elegant Themes are so customizable, you’ll never need to touch the code.
Youtube is a great resource for learning how to do things, and this is no exception for computing. Search for “primer” or “tutorial” and then the technology you’re interested in, and you should find many useful resources.
At some point, with web design, you are going to want to get into the code. You’ll want to add more animations, effects, or interactivity to your pages. The three most important languages for the front-end of websites are:
- HTML (HyperText Markup Language). The code of the web, every internet page is laid out with html markup, so you’ll need a first grasp of it.
- CSS (Cascading style sheets) Style is everything on a modern web page: from colours and fonts to the way divs (blocks) are laid out and behave when a screen resolution changes. CSS defines a complex language to style all of your HTML elements.
- Javascript. This is a universal scripting language for code that can run on the front-end (in your browser) and perform things like animation effects, auto-update of information, form checking, and so on.
I can recommend the tutorials and reference information at ‘HTML Tutorial – W3Schools’ and suggest if you are new to the practice, you go through the tutorials on HTML, CSS, and Javascript in that order.
On the above technologies, I can also recommend the “in easy steps” series by Mike McGrath. He explains things proficiently, the material is well laid out and colourful. The use of a physical book when learning a new language can not be underestimated.
It’s much easier to browse through a book open on your desk whilst you are working on a project on your computer screen, than switch back and forth between webpages on the screen. Using websites for reference (lookup of quick information) can be very useful, but I believe, when you’re learning a new subject, it’s less distracting for your mind if you use a good book.
Additionally, a book will have gone through fastidious composition, various edits, and professional layout, prior to publication. A website you found through a Google search is more likely to have information hashed together in a hap-hazard fashion.
Having said that, it can be counter-productive to read an out-of-date book, as technology moves so fast, so always check you have the highest edition when ordering or buying books for technical use.
BACK END DEVELOPMENT
Many websites aren’t just static pages. They talk to a back-end server, which responds with page data. Most talk to a database too. The larger websites we’re all familiar with such as Google, Amazon, eBay, and so on, are distributed across many machines.
A great language to learn for back-end development and scripting is PHP. It runs half the internet and is the back-end to WordPress amongst other things. The interrelation with HTML and it’s Perl-like text-processing capabilities are what makes it so powerful as a back-end web language, but it’s also a great scripting language in its own right.
PHP is structured like C, so learning PHP, will make you familiar with many idioms common to a lot of other languages.
I can highly recommend PHP in a Nutshell (O’Reilley). The first few chapters go into the history of programming and programming in general, and act as a good primer for the subject.
If you get into databases, you’ll also need to learn their language — SQL (Structured Query Language). If this is something that appeals to you, I would recommend learning the principles of relational databases, so you can gain valuable skills of database design as well as database querying.
FORMAL LEARNING
There are so many different languages you can learn for pure software development — many specialized for different uses — that it’s impossible to pick a best first language. Despite this, there are many flame wars on the internet by ill-informed amateurs claiming otherwise. Another article on beginning coding.
When I learn a new language, I normally select it for a specific task I’m doing. But there are still so many choices that I’ll look at the trends in Computer Science and see what is popular, keeping one eye on the job market to see if the language I’m learning has a demand or not.
For learning a first language, for pure learning, it’s not so simple. I think the overriding factors for a first language are:
- Not too difficult
- Can run on different platforms (at least: windows, mac, linux)
- Not too crazy or specialized that the techniques you learn won’t be applicable to other languages
- Widely used, so there’s lots of learning resources.
When I was at school BASIC, was taught. More recently, with the popularity of SBCs (single board computers) Python seems to be the trend for education. Scratch — a visual language — has also had some traction in classrooms. For reasons I won’t go into in this blog post, I think those are all bad choices.
If you are interested in learning programming, from ground-up, in a comprehensive manner, one language stands apart from me. Go. It was developed by google by a team of Computer Science experts. It’s a lean, compiled, statically-typed language, which has an awesome set of tools, capabilities and documentation.
Go has a great many applications, from communications, web servers, embedded systems, simulations, number-crunching, and so on.
A colleague of mine teaches youngsters programmers using the Go language in a ten week course in the UK . Their experience is always a positive one. They understand how the language works and have fun with it.
I helped him with the teaching material, and he’s now made it available online at gophercoders. I can highly recommend this material and this language for anyone, of any age, serious about learning programming.
Here in Nova Scotia, the province has recognized the importance of teaching programming at an early age, and I would think, the materials in Gopher Coders would be an excellent resource for this initiative.
Good luck and have fun.
SG