Friday, 24 October 2008

Encouraging the programmers of the future

I found this interesting article on the BBC News website today about the British gaming industry, and how the UK has long been punching above its weight in the gaming industry. This has always been put down to the generation who grew up with BBC Micro's, ZX-81's, and so on. These computers generally had a BASIC interpreter build in, and you'd have to use that to run programs from tape or disk.

Thanks to these native, inexpensive computers, the UK was for years a strong player in the gaming market. Programmers cut their teeth by entering listings from a magazine, progressing to writing their own games. OK, the machines were arguably harder to use than a modern machine, but they were well documented, and there was more of a culture of programming with them - if you wanted to use one, you had to learn at least a few commands.

Now, contrast it with this article from earlier in the year, which makes for somewhat more depressing reading. Few people are learning about programming, and schools are concentrating on teaching kids how to use Word and Excel. No wonder so many people are reluctant to even consider switching to OpenOffice!

I'm nearly 30, and got my first computer (an Amstrad CPC 6128) aged around nine or ten, so I consider myself to be at the very tail end of the generation that grew up around the first home computers. Like many others, I worked my way through the tutorial in the phone-book sized manual to build an address book application, and spent hours typing in and debugging games from magazines. Being a kid at the time, I was regularly distracted from it, but I got to be OK at it.

The 90's were arguably a bad time for the computer industry in many ways, despite the fact that the Internet appeared during this decade. Commodore went under, Apple only survived by the skin of their teeth, and within the space of a few years, Windows came to dominate the desktop. Pretty much everyone else disappeared.

While Windows undoubtedly did a lot to make computers more accessible (much as I hate to admit it, as I am a Linux user!), it also relegated them to being something used for writing letters, making spreadsheets, and later, surfing the web. To a certain extent, it made a computer into a black box, as people weren't interested in learning to code.

At the same time, the games consoles began to draw much of the gaming market away from home computers. While some genres (RTS, for example), have long been strong on the home computer, and remain so, others switched almost wholesale to the console. Platform games such as the Mario and Sonic games are a good example of this. So people who in the past would have bought computers for gaming and got into programming later were rarer.

Nowadays, if you buy a Windows PC, you certainly don't get encouraged in any way to get coding. There's no guide of any kind included, nor do you get a BASIC interpreter (or any other interpreter, for that matter). Modern PC magazines don't seem to do anything to encourage people to learn to program, and I find that a little sad.

With a Windows computer, it seems to me that you actually have to be interested in coding to start with, and to know that you're interested in it, to be able to get to use it as a programming platform. By this, I mean it gives no encouragement whatsoever in learning to program in any language. Microsoft don't include any kind of programming tools at all as far as I can see.

The frustrating part is that they already have a pretty decent tool in the shape of Visual Studio Express Edition. OK, I'd rather people learn an open-source language than be tied to Windows, but I'd much rather see people encouraged to get programming in the first place. Why couldn't Microsoft include at least one of the Visual Studio Express Edition IDE's (I expect they'd probably go for Visual Basic, although that wouldn't be my first choice), and a manual (in print or pdf format), with every copy of Windows? They could place a link on the desktop that says "Start learning to program!", and let people's curiosity take over naturally. If people don't want it, they can delete it, and that's fine. As it is now, you have to go looking for it on the Microsoft website. They should be encouraging people to learn about their software and develop better applications for it.

I think that in many ways, Apple have done better in this respect. By including the Xcode IDE with every copy of OS X, they've provided a powerful tool with their computers. Also, OS X is at heart a form of Unix, making it well suited for programming. However, the fact that Xcode isn't preinstalled does mean it's not there by default, making it less likely that people will try it out of curiosity. Also, although Xcode does have loads of documentation with it, it doesn't include any kind of "beginners guide", it seems to be all for people who are already programmers. They could definitely do more to encourage people to start learning to program. I also think that OS X's polish counts against it in this case, as it means you never have to delve into the terminal to accomplish every day tasks. So again, I feel that like Windows, OS X does little to encourage people to learn how to program.

Another thing with both Apple and Microsoft is that they do emphasise IDE's over text editors. I've had a brief try at using Visual Studio Express Edition, and tinkered with Xcode, and I subscribe strongly to the view that an IDE is the last thing you want to use when you start programming. Learning a brand new and extremely complex application at the same time as learning to program is a bit too much for most people, whereas anyone can use a basic text editor. Even a more complex one, such as Vim (my personal favourite), is far easier to use than most IDE's. There's no doubt that IDE's offer a lot of features to experienced users, but they can be extremely overwhelming when someone takes their first steps in programming.

This is one of the things I like about Linux over OS X and Windows. While these days you don't actually have to use the terminal for everyday tasks in a modern distro like Ubuntu, there's a strong culture of doing so and you're encouraged to use it in solving problems. I think part of this is because the main support is through forums, and it's easier for someone to post a command for you to paste into the terminal than to say "Click this, then this, then this...". Also, the bash shell is a lot more powerful than its Windows counterpart. By and large, while there may be a learning curve, using bash is often the quickest and most convenient way to accomplish a task, and it doesn't take long for this to become clear. From using bash and changing settings by editing text files, it's not a great leap to then go on to write shell scripts or to learn to code using Perl or Python. Most distros also include a lot of documentation for the included languages. Also, languages used in Linux are almost invariably ones that can be written with a simple text editor rather than forcing someone to learn to use an IDE, which I feel makes them more accessible.

However, I still feel even Linux can do more to encourage people to learn to program. The last thing I'd want to do is to force people to learn to program when they don't want to, but I do think we should be taking more steps to encourage new programmers. Maybe just a nice handy pdf file in your /home directory called "Learn to Program" will be enough.

Having recently taken my first few steps in learning Python, I'm enjoying learning it tremendously. It's probably a more powerful language than BASIC, but I find it just as easy to get started with. Having had a go at Perl and Java in the past, and finding these a bit of a struggle for a first language, I was pleasantly surprised by Python. So it would make an ideal language to include with a new computer. OS X and most Linux distros include Python already, and I see no reason why Microsoft couldn't distribute a copy with Windows. Just add a pdf guide or two and sit back. If for some reason they didn't want to use Python, we're certainly not short of other good languages for beginners either.

How else can we get people interested in learning to code? What languages should we push? Should we encourage them to use an IDE, or go with a text editor like Vim? All answers welcome!


Ron said...

Python is easy to learn, easy to use, powerful and dynamic. It's like executable pseudocode!

Visit for 500 free online python tutorials.

MattBD said...

Thanks for the link, Ron! That looks like a great resource for learning Python, I really appreciate it!

lambda said...

The problem is what I would call the average windows user can barely manage to add a new user account.

But as whole I think one of the biggest barriers is unity, you could argue to push Python. I sure would, but knowing the internet there would be someone shouting oh no, you see Ruby is a much more suitable first language because....

So lets say we get over that, and python is chosen. Then who's way of learning python, a dictative style where the document explains every single method and function and drills in every detail. Or a more hackish, playful and experimental approach. A case could be argued for each.

What about which implementation of python, Microsoft for example have iron python... >.<

I think its not necessarily a problem of OSes lacking motivation, but more that they are pushing away from power at the BASH prompt and towards usability and prettiness at the GUI. With this movement we begin to loose that playful drive, we no longer explore our computer's internal working, read man pagess to figure out how to do this and that, we begin to click our way through everything, only turning back to the terminal in times of need.

I am lost for a solution, but it is not a problem we can ignore. How useful can a computer be without any programs to run on it, or even worse, how good an alternative can open source be without new programs rolling out.

Excellent post matt, enjoyed it very much and thanks for the link to BBC news.
Happy programming.