Monday, June 17, 2013

The Programmer Litmus Test

One of my current projects has induced me to learn Haskell, a rather dogmatic programming language notorious for its insistence on purely functional programming and extremely strict data type enforcement.  It's been both interesting and frustrating: Haskell clearly shows its origin in mathematical thinking.  On the good side, there is the elegant way that data types are inferred, the fact that sophisticated and subtle manipulations of mathematical functions are elementary to the language, and the intuitive handling to sets and recursion.  On the bad side, anything that doesn't fit the elegant paradigm is horribly painful to handle, when things do go wrong they go very wrong very quickly, and there is a mathematician-style culture of using single-character symbols and minimal comments.  I detest this last, since it renders programs extremely hard to decode.  It reminds me of a criticism of Perl that I once heard: "banging on the keyboard has a 50/50 chance of producing a valid program."

Learning Haskell also reminds me of a litmus test that I like, for testing whether somebody is a Real Programmer.  The test is a single simple question: 
"What programming languages do you know?"
If the person responds with a clear and simple list, they aren't are Real Programmer.

My own answer?  Well, mostly I work with C, C++, MATLAB, Lisp, Java, and now Haskell.  But I also deal with GNU make and bash and tcsh, some Python, recently a little SQL, then HTML and Javascript of course.  I've done a little bit of elisp hacking when I needed to, a little VHDL.  I don't know if I should count representation languages like SBOL or LTML.  Do nesC and AVR macros count as the same as C/C++ or separate?  I think the other parts of the autotools suite besides Make probably count as separate languages.  Almost forgot about regexp patterns, I think they count.  And parser definition languages like flex and yacc.  680x0 assembly, back in the day, when graphics accelerators and OpenGL didn't exist, and I guess I did some x86 assembly too in classes, and there was another processor, a toy processor specifically for classes whose name I don't remember.  Oh, and BASIC of course, my first language ever.  Research languages like Proto and MGS.  LabView made me use G---I hate graphical programming languages---though I guess Logo was fun as a kid.  I can't remember whether I ever actually wrote any AppleScript or not; same with SmallTalk.  Curl was another that came from classes, along with whatever it was we used for PAL programming before we switched to CPLDs and used VHDL instead.  Oh, and LaTeX of course---anything you can write quicksort in definitely counts as a programming language.

You get my point, I think.  I could probably keep going on for a while, and still not have everything.  This is part of the nature of working with code.  If you spend enough time working with enough complex systems, you'll inevitably have to tangle with lots of different programming languages, just through the pragmatics of making things work in whatever context of duct-tape and spackle your partners and predecessors have had to set up to get stuff done. Likewise, if you tangle with enough languages and gain a deep enough understanding of the underlying concepts, then picking up new languages is relatively easy---at least to an intermediate level.  Real Programmers have done both of these things, and it will have left its scars on their memory in one form or another---and I don't think you can really be fluent without it.

Note that being a Real Programmer doesn't necessarily make you any damned good at any particular task, though.  It just means you've got the potential to get there with a sharp learning curve if you've got the time and motivation.  For example, I'm no longer competent to carry out any but the most basic system administration tasks, since I stopped tracking that field early in grad school, which is why I own a Mac.

So, dear reader: are you a Real Programmer?

6 comments:

Unknown said...

Well, Perl isn't really a programming language, and PHP is kind of gimpy, and SQL is just so limited.... Does programming graphing calculators count? HTML and CSS definitely don't count, but I guess I've prodded at them a bit. C++ definitely counts, but I haven't done anything since classes, and likewise with Lisp, even though I nominally work on a project that's written in Lisp. Oh, and Python. And bash.

I still don't feel like a Real Programmer though. It's a pretty short list anyway. :)

Jacob Beal said...

Why wouldn't you count Perl as a programming language? It's Turing complete, which doesn't merely qualify it, but over-qualifies it. Graphing calculators also definitely count --- I forgot all about them in my list. And your answer also is complexified by the fact that you've not only worked with PHP and SQL, but developed strong enough opinions about their power relative to other languages that you needed to express them...

Now, you might well be Paul Graham's eponymous blub programmer, but you clearly pass the litmus test.

cariaso said...

Actually perl isn't quite 50/50, looks like 45/55 ...


http://www.spinellis.gr/pubs/conf/2012-PLATEAU-Fuzzer/pub/html/fuzzer.html

I thought that was a brilliant way of quantifying something many of us have often though about the languages we love, hate, and love to hate.

And according to your criteria, yes I am a Real Programmer.

However according to xkcd, I am not.
http://xkcd.com/378/

Jacob Beal said...

That's beautiful... I'll have to point that fuzzing paper out to some folks I know who will highly appreciate it...

bbirney said...

Implicit beneath your criteria is the idea that "real" programmers operate in an environment in which they get moved around from project to project, using a variety of languages that meet the particular needs of the project. But wouldn't a better "litmus test" be the logical quality and algorithmic elegance of the work product? Why is it a measure of a programmer's quality if he knows 50 languages but is a hack in all of them? And why isn't someone who programs exclusively in a couple of general purpose languages and a half dozen special purpose languages, but who creates excellent designs that are both functional and highly efficient, a "real" programmer?

I am exiting the industry very imminently, so I don't really have a personal axe to grind. I did my thing and made a decent living at it, and now I'm moving on. (I probably never met my own test for a "real programmer" anyway.) But if I were a career guy who had gotten really deep into nothing but Java, XHTML, CSS, Javascript, XML, and XSD, and some other guy came along and told me I'm not a "real programmer" me based solely on the number of languages I know--without examining the quality of my projects--I might be inclined not to take that person's assessment very seriously.

Jacob Beal said...

You raise some interesting points, Ben, but I'm afraid that I have to disagree with you. At the core of it is the passivity implied right at the beginning: "they get moved around from project to project." In my view, being a good programmer is also all tangled up in curiosity and a flexible mental approach.

To understand my point, let's take an extreme scenario and say you were to point me at somebody and say: "That person has spent 20 years in the industry maintaining FortranBeast. They don't know anything but Fortran, but their Fortran is just incredible." Maybe that's true, but I'll be quite suspicious. How could somebody spend 20 years and have so little curiosity and drive that they never set foot outside of the little patch of lawn demarcated for them, not even on their own time? Such an inflexible mind I would not trust to do anything but walk in circles in its own comfortable grooves, until proven otherwise.

Now, my litmus test still won't guarantee that somebody's any good at any particular thing that you want them to do... see, for example, my atrociousness at system administration. But it's a good starting point.