Log in

No account? Create an account
December days: Programming languages 
2014-12-13 (Sat) 15:04
ewx prompted me to write about programming languages, and said "be as specific or general as feels appropriate".

Answering prompts with a personal-history kind of framing seems to be working quite well this month, so I'll stick with that for this one. I started programming when I was seven; that was on a ZX Spectrum+ which was a lovely piece of hardware for the time, so the language available was Sinclair BASIC. This wasn't a bad BASIC dialect, and I remember its PRINT command having some useful gadgets. The limited memory and the very odd encoding (numbers were always five bytes; reserved tokens were always one byte) meant that it was sometimes worthwhile to go through some ridiculous circumlocutions which have stuck in my head: INT PI was two bytes in memory against five bytes for 3 (ditto SGN PI for 1 and NOT PI for 0). At any rate this kept me going until I was 11, at which point we got an 8086-based PC.

There was a dark stage for about a year here where I didn't have any programming language worth mentioning, because MS-DOS 3.3 (I think it was) didn't ship with one. Batch files were sort of barely functional for a few things, and if you were really determined it was possible to do things like write a minimal calculator in them, but it wasn't exactly pleasant. Out of a mix of desperation and curiosity I resorted to teaching myself assembly language via DEBUG.COM; I haven't used that experience much since, but it was probably worth having done at least for a while.

When I was about 12 we upgraded to MS-DOS 5.0, which shipped with QBasic, so I had a more or less familiar language available again with slightly different quirks. Not having to number lines manually was a bit of a revelation, and I seem to remember subroutines being noticeably better. Some things were more annoying, and I seem to remember putting in some effort to add some of the facilities that the Spectrum's PRINT command had. I stuck with this until I was about 16 or so, including going to the All-Ireland Schools' Programming Competition (which I think is now the All-Ireland Programming Olympiad); I placed respectably enough but not particularly close to the medals, and reckoned that some of that was due to trying to use BASIC, which was just a bit too clunky for the job.

That summer I went on a residential course in Dublin where I learned Pascal, and that made a big difference, though part of that was probably just due to the mental flexibility involved in having learned a second language. The next year I went back to the same competition and felt I'd done much better. I sat through the awards ceremony, of course presented in reverse order, figured I'd just missed out on the medals and might try again next year, and almost fell over when they announced I'd come first. This of course did a lot for my confidence and meant I got to go to the international competition, which was mainly useful in that it was the first time I'd really hung out with other serious programmers.

I learned C at some point before going to university. If memory serves it was initially a dialect called Pacific C, although I haven't retained any of its idiosyncrasies. I think I then used Visual C++ for a bit, until I switched to Linux-based systems in 1998ish and taught myself GNU C, which even at the time was much closer to the standard. (It wasn't until a year or two later that I got hold of a copy of K&R II, at which point things started making a lot more sense than whatever I'd picked up through osmosis.)

At university they taught us ML (on the reasonable basis that virtually nobody knew it already so it levelled the playing field) and Java. ML was excellent at broadening the mind but I never kept it up. I used Java for a while, but eventually I decided that it just felt too clunky for me and I was running into its limits a lot in terms of what systems programming was reasonable at the time, and I've avoided it since.

Once I was using Linux, the scripting facilities were a lot more powerful and it often made sense to use them for things where I'd previously have used full-fledged programming languages. I used a lot of bash, sed, awk, and such around this point. In 1999 or so I taught myself Perl, and that was another big step up in terms of how quickly I could get things done. Perl is often criticised for being a write-only language, and I admit that I've occasionally contributed to this, but I think my normal style is rather more readable and it's mostly fine if you refrain from playing silly buggers too much. It remained my language of choice for some years, including lots of work on the Debian bug tracking system which is written in Perl.

When I started working for Canonical, Python was the preferred language there, so I taught myself that. That was just as well since I soon found myself being handed stuff like Germinate to maintain (nowadays it looks more like this, which is a bit more tractable). Nowadays I'm very comfortable in Python, either 2.x or 3.x, and my new job will involve even more of it. It's a reasonably nice general-purpose language with generally excellent library facilities; it's maybe not the fastest thing in the world with the standard implementation but it's not terrible, and I feel pretty comfortable with its quirks.

Apart from the time spent learning ML at university, all of these fall into the general category of procedural/imperative languages, and I have to admit I really haven't done much outside that sphere. A number of people I respect are big fans of functional languages, and I suspect that at some point I will end up teaching myself Haskell. I've done some work related to that before in a rather strange way, but I never really taught myself more than a minimal amount of the language as a result. (On the other hand, it did cause some local Haskell developers to buy me drinks, so that was a win.) Once I have more energy for free-time experimentation again then this might be reasonably high up my list.

Virtually all of this has been self-taught. I did have some formal programming education (A-level computing, which in this area at least mostly covered ground I already knew, and university), but it's mostly been driven by what I needed at any given point rather than learning new languages for the sake of it. That said, if you're learning to program I strongly recommend learning more than one language once you're over the initial hump, just so that you have a better idea of what's intrinsic to the field in general and what's just a quirk of the language you learned first.

This post is part of my December days series. Please prompt me!
This entry was originally posted at http://cjwatson.dreamwidth.org/11623.html. Please comment there using OpenID.
2014-12-13 (Sat) 17:26 (UTC)
Nice retrospective! I remember the INT PI nonsense well.
This page was loaded Jun 25th 2018, 12:07 am GMT.