As I was scootering to work today (it's a Razor, I'm pretty cool), I had a thought. Programming languages are like musical instruments. Think about it. You can pretty much play (a version of) any song on any instrument. Some instruments might be suited to some songs better than others, but I say beauty is in the ear of the beholder.
Who says kazoos can't be majestic?
And why can't a flute be gangsta?
Each instrument has its own community philosophy behind it: how to best play it, how to approach newcomers, the type of styles that work really well with it, the ecosystem of different accessories, tools, and cases/containers.
So I decided to match up as many as I could reasonably justify and see what everyone else has to offer. Keep in mind that this list is definitely biased based on what I know or have experienced about languages (and instruments!), so much of this will be a bit tongue in cheek. Here we go.
Language Instrument Match-Ups
Ruby: The Ukulele
It's fun! It's cute. Also, it's my favorite. You can make an E chord like this... or like this... or like this... or-- whatever's comfortable for the player and the situation. Is there a wrong way to hold a ukulele? Yes... maybe. But there is definitely not just one right way to hold one.
But overall, it's designed to be pretty portable, pretty accessible, and to make you smile just a little bit when you see it. But don't underestimate it. You can get started learning it fast, and you can make some amazing, complex, and beautiful music (code) with it. Is it a serious instrument? I don't know. There are some snobs that would scoff at it. Maybe you can't hit all the low-level notes all that easily. But still:
Yowza.
Python: The Drums
You can play them solo, or, more frequently, you can use them to tie the whole band together. They are the baseline under a lot of songs. Anybody that has hands (and probably most people that don't) can play the drums at least a little. But a really skilled drummer can steal the show.
Note: do not attempt to write Python while on a rotating hydraulic rig.
While there are many different applications and styles of drumming, the community holds to a fairly rigid set of rules and depending on whether or not you're on the beat, you can very quickly tell whether you're doing it right or wrong.
Once you're all set up, you can really get rocking, but deploying an application still requires a bit of help from others, especially for the first time — unless you can give up some of the ecosystem and settle for a bit of a smaller runtime.
In which you can still be pretty darn productive.
JavaScript: The Electric Guitar
It's everywhere, it's flashy, it's flexible. Let's be real. The cool applications that are out there have made everyone wish they were a little better at it. If you want to do it right, however, you're going to have to know (and lug along) about a bazillion different accessories, tools, plugins, and customizations. Your setup probably weighs at least 1000 MB— whoops, I mean pounds. Sometimes the underlying cables and infrastructure go bad and short the whole system out and people lose their minds.
But, the venues are slowly improving and coming along, allowing you a little more freedom. And darn it if it doesn't sound just beautiful once you get everything hooked up right.
And people will pay good money for a stage technician that's been around the block and knows how to tie everything together without blowing a fuse.
C: The Piano
It's the OG. Not necessarily the oldest or lowest-level option that's out there, but we've been using it to build a huge range of things and it still does the trick. New instruments have been built on top of its design. It's got a huge range of buttons to push, levers to turn, and even strings to tighten if you know the right way to do it (also, if you don't, the strings will snap and kill you). It definitely takes some practice before you can be very productive. Once you try to do something even a little complicated, the learning curve is much steeper than some of the other options on this list. But it gets the job done, often on its own, and if you need rhythm, bass, and melody all in one, this is where you go.
C++: The Accordion
OK, this one's definitely a joke since I don't know much about C++. But it seems like they took the piano and just kept adding buttons and knobs and then said, you know what? Screw it. You have to pump it to play it.
Impressiveness (and probably a fedora) included.
R: The Drum Machine
It's much like the drums, but the community is definitely different. It's like someone took the drums and said, I want to do this and really specialize. If you're making beats or need additional sound samples, it's definitely your friend. You wouldn't probably use it at a ceremonial drum circle (I don't know, maybe you could) but it excels at what it excels at, and it's designed to allow people who aren't necessarily focused on becoming a master drummer to do pretty high-level drumming.
Aw yeah
Go: The Electric Violin
It's built on some ancient roots, and the fundamentals are very similar to older instruments, but this version is updated for a world with things like electricity. Now, does this mean it's better? Not necessarily. Does it mean that it's pretty? Depending on who you ask and who's playing it. But it has the popularity factor of the electric guitar, with a different focus. You can do some really cool things with the collection of plugins and add-ons, but it can also be lightweight and portable.
I want one so bad.
And if someone has one, trust me, they'll tell you about it. And that's OK because you're probably interested in what they have to play!
PHP: The Voice
It can be very good, or very bad, but it's everywhere and you have to respect that. People can use it to do some pretty nasty things, but if a lot of people come together, it can be really very powerful.
And that's probably the only time you've seen Wordpress equated to the Mormon Tabernacle Choir. #Sorrynotsorry
Sometimes it's popular to mock it — or, at least, the popular depiction of it, but it's really just another programming language/instrument and it does a job. It can be hard to get it set up right if you really want to do things right. Best practices are critical in order to make sure it doesn't crack.
Java: The Pipe Organ
It's big. It's clunky. It's expensive. It's probably owned by someone richer than you. It's extremely intricate and structured. There's a ton of buttons and customizations and tooling. From the outside, the cornucopia of knobs looks very intimidating and opaque. It generally sounds best when approached slowly, with a well-architected piece, allowing each piece and sound its own space so it doesn't get muddled. But you can make some big, impressive, and reliable sounds if you do it right.
Fun fact: this piece of music was designed to be played in a cathedral and factors in for the huge amount of reverberation those spaces provide. Many of the chord structures were designed so that they would only come together after the sounds had been bouncing around the space for a little while. Compare it to this slightly less traditional version.
MATLAB: Whatever This Is
It's big. It's kind of impressive. Definitely not portable and definitely more expensive than what you probably need. Unless you really need it. Then you're all set. It can probably talk to your other robotic devices.
What Else?
I want your input. Comment below if you think you've got a good one, or let me know which ones I got right. And let's keep it civil. Every language has its uses!
Top comments (7)
Haha, love it 👌 Great post, Ryan!
What about functional languages? What kind of instruments did they represent?
Hmm I'm not sure. Without thinking too hard, I would have to say the theremin. Very cool, requires a complete mindset shift to learn, and if you meet someone that knows how to play it, you're definitely going to hear about how great it is for the muscles in your fingers. :)
Good catch, though, I can't believe I forgot about that whole branch of languages!
I think C# would be the electric piano. It's not as well loved as it's other keyboard brethren, but it's still widely used (or so I've been told). It may sound too commerical and depending on your setup cost a lot, but it's dependable and solid and you can hook it up to other instruments via MIDI (the CLR).
Nice! That’s some solid analysis!
Haskell is not an instrument, because playing music would be a side-effect.
Perl is bagpipes, because you need a Scottish-level beard to use it.
Haskell is a modular synthetizer. You'll never fully understand it.
I agree, Haskell is a perfect sine wave that doesn't worry about whether it's getting output as sound or not. :)