polyglot - part 1
blog

Polyglot - Part 1

I have been talking to a number of companies about working for them recently, on a contract basis. All of them have asked about the possibility of me working in a language that I do not yet currently have any real commercial experience in.

This sometimes happens but having just spoken to three companies and all of them asking the same question has made me think about the languages I choose, and why, because I should probably be able to articulate to each of them the reasoning behind my response.

What Do You Know

I already have a lot of languages under my belt. Some I only used at University, others I still use daily on projects, some I have no intention of ever touching again.

Allow me to take you on a whirlwind tour, in rough chronological order, through the history of languages I have learnt, along with contempt levels.

I could talk about many of the below languages for hours, so please, excuse the brevity.

BBC Basic

My first introduction to programming. I copied a lot of things out of the BBC Acorn User and other magazines during the ’80s.

I was really too young to want to do any serious programming but I created a program to manage my RPG character sheets and print them. Doubly geeky huh?

Not terribly familiar with the entire language but then I don’t hate it either, never bit me…even though it is VERY SHOUTY BEING ALL UPPER CASE SO YOU ARE PROGRAMMING LIKE A DALEK…EXTERMINATE!

Realistically I spent more time playing Elite than I did programming on my BBC machine in the ’80s. Well, that and accessing bulletin board systems.

Language

Wikipedia

Modula-2

A lovely little language.

Unassuming, modest and sane.

Provides you with modules, pointers, aggregates and all the other good stuff an procedural imperative language should BUT LIKE BASIC, QUITE SHOUTY BECAUSE RESERVED WORDS ARE ALL UPPER CASE.

This is the first language we were “taught” as University, and I’m quite glad, I can’t imagine having Java be my first introduction to imperative programming.

shudder

In addition to using it for practically all of my first year University programming I found some bugs in the directory/file handling libraries at home on the DOS version that I exploited to “hide” files in the file system. Good times.

Language

Wikipedia

Bourne Again Shell

Bat-shit craziness that has its roots so deep in UNIX history and culture that changing it would be near impossible.

Working in shell after anything like a real programming language for me requires a temporary lobotomy to keep from going mad with all of the strictures and differences from almost every other system.

A shell script written by an expert will often be very close to line noise, Perl doesn’t even come close.

Maybe I’m being too hard on it, perhaps it’s because I hardly ever do anything serious in shell scripts. I don’t know, the language doesn’t make me want to do anything in it though which I take as a hint.

Language

Wikipedia

C++

I was really bummed-out when I started University and found out that we would not be using C++ as a language for any of the courses.

So I went and learnt it on my own.

Now, there was a large percentage of people who had enough trouble with Modula-2 even before pointers were introduced that I understand why they maybe didn’t think C++ would be the best introduction but I had a lot of fun playing with C++ and SEGFAULTing with style.

I was so enamoured with C++ that during my year in industry I even used it to create CGI programs. Yeah, I know, I know…not the correct tool for the job, I was still learning.

These days I would never start a project in C++ unless an angel appeared from heaven and told me, quite categorically, that I would need to optimise for space and speed. And even then I would probably prototype in Ruby and see if we could get away with using Java.

C++ will hardly ever be a primary language for me now. I have better languages for the things I used to use it for. If you’re going to use it, do yourself a favour and limit the number of language features you use. Oh, and read Meyers.

Language

Wikipedia

Java

When I was young I fell in love with Java after reading about it. Garbage collection, built-in threading, portable VM…it solved all of the shortcomings that C++ had that bugged the hell out of me.

Then I used it.

Hmm, wow, we have Integer and int. Weird.

No. Not just weird. Terrible code smell.

I understand why they did what they did, if they had used Objects everywhere performance would have been even worse than it was, which wasn’t great to start with, but having primitive and object types for the SAME THING is just madness.

I used java a lot so I got to know a lot of things about it that bugged me, not just the duplication of primitives by their Object counterparts but I don’t have the time to go into them all here.

Unfortunately even with all of the problems it was still nicer to code in than C++. sigh

Language

Wikipedia

C

The daddy, from which all other languages spring. Well, not really but most people think so.

One of the fastest languages, in which to shoot yourself in the foot. A little familiarity with it makes a lot of other languages seem like paradise where you’re free to do whatever you choose with no consequences…or SEGFAULTS.

I have used it to create JNI interfaces to allow Java to talk to serial-port devices that collect coins, to hook Perl up to C libraries and to monitor the uptime of remote servers.

As long as you remember that it needs courage to code with and doesn’t give a damn about you everything is fine. If you can’t live without built-in hash-tables, enumerators, garbage-collection and other poncy stuff go back to your scripting languages.

Language

Wikipedia

Perl

Whilst not religious I must, here and now, admit to proselytising. I used to seek to convert people to the Church of Perl.

Yes, once I had the revelation I couldn’t help myself.

The single biggest reason I became a Perl devotee is productivity. I could code a lot, really quickly, and it just worked.

Sure, it might be 10-30 times slower than C++ but if I’m asking for your credit card details on a website in 1998 I don’t much care if it takes nearly a second.

Of course, Perl has some…issues. Relative to other languages though they were quite minor. The OO system was a shit-show of bolt-on shonkiness and required a lot of boilerplate but if I wanted to write OO in a scripting language at the time when I started with it there wasn’t much competition.

There was a faint, brief hope that Perl would leap into the next millennium reborn, fresh, edgy and cool… Perl 6 however spent over a decade languishing and only very recently has released the first stable implementation.

I won’t spoil it but a new love came along, later in my life and stole my heart away from Perl.

Poor Perl.

Language

Wikipedia

VB Script

Don’t judge me.

You already have, haven’t you?

I was young, I needed the money!!!

The company was already using it in Active Server Pages!!!

breaks down sobbing

If any language I know screams SHITSHOW it was VB Script. I can’t tell you too much because I have spent a lot on alcohol trying to forget.

Wikipedia

Lisp

The language everyone should learn at least once, if only so that they realise when they start creating an implementation of it in their home-grown templating language.

Lisp is amazing, awesome, can slice, dice and reform itself, it’s intelligent clay that shines on many levels and no-one uses it because of all the parentheses. Or they can’t get their head around the prefix notation.

I do love Lisp, there is a lot to love.

I have spent a lot of time looking at different Common Lisp implementations to decide which one to use and these days it looks like you can’t choose, you just have to accept some common libraries to hide the differences between the runtimes.

Still waiting for someone to employ me to write Lisp. hint hint

Wikipedia

Ruby

There is a language that completely replaced Perl for me, and this is it.

If all the warts that Perl programmers endure were chipped away and sanded down you’d end up with something like Ruby.

I finally made the jump a few years ago and am so happy that I haven’t written any Perl in more than 3 years now.

There are very few things I dislike, potentially that we have three ways of creating closures that all have very slightly different semantics. Nothing compared to the problems that Perl suffers from though.

Language

Wikipedia

Racket

The language that I really want to use to build a real system is now Racket.

A clean version of Scheme that promises TCO and provides tools to build other languages on top of it.

Like Lisp I still haven’t written much in it except to solve Project Euler problems in, but I would like to. I guess I should probably have spent some of my recent free time working in it instead of playing so much Poker.

Language

Wikipedia

What Don’t You Know

Well, everything else, or nearly everything else.

Yes, I did write some Smalltalk at University, not enough to say I know the language, it’s one I would still like to play with.

I know enough Javascript to play with some front-end stuff but have never written anything from scratch using it.

Now, since this is already getting too long so I’m going to take a break before talking about how I choose what new languages to learn.

Part 2 soon…


14 December 2014 - programming language bbc basic modula-2 bash c++ java c perl vb script lisp ruby racket

There is currently no way to leave comments, but if you feel the need then email them and they will eventually, magically, appear...