Afterwood
There is a three-letter word commonly used as a prefix in programming for naming functions and methods that has the propensity to really irk me – get. It’s not alone in this as its partner in crime – set – also has a similarly undesirable effect but features less regularly and therefore avoids most of my ire. To me, the overuse of “get” speaks volumes about the level of thought that commonly goes into its selection, i.e. none. Hence I often wonder if the title of the classic 1970’s gangster movie Get Carter had suffered a similar affliction and whether there are other choices to be made that would better convey the artists’ intent?
The most obvious starting point for this discussion would be to assume that to “Get” Jack Carter would be to make some kind of journey to where he is situated. Maybe we only need to know his whereabouts and therefore we merely need to Find Carter. Perhaps once his position is secured we only intend to chat with him, a quiet word in his shell-like ear so to speak, and if the journey is the focus of our story then we might prefer Locate Carter instead. Gangsters in films have a habit of ending up in a ditch or grave in the woods and therefore while Unearth Carter might be grittier it could also give some of the game away to the audience before we’ve even started, so perhaps we should settle for the less revealing Discover Carter instead. (Let us put aside for a moment the words of George Box and hope that this analogy, while wrong, like every other, is still at least somewhat useful, somehow, at some point.)
What is more likely though is that it’s not enough to simply know where he is; a gang’s head honcho probably needs to “interact” with him in a violent way, perhaps to extract information about his enemy’s intentions, in which case we not only need to find him but bring him back too. This naturally leads us to Fetch Carter. Jack is no doubt fairly suspicious of the people he deals with and therefore it would do little good to try and Request Carter without following up in person lest it be met with a metaphorical 404 (one or two finger salute) or just time-out waiting for a response (he’s done a runner). Pubs seem a particularly common residence for gangsters so Extract Carter might convey more clearly the level of force required to obtain his full attention.
Maybe though we’re thinking about the need for Jack Carter in the wrong way; do we actually require the Jack Carter or will someone like Jack Carter do instead? What if just need “a” Jack Carter – someone who fulfils the same role by having the same knowledge and skills, what if there was a pool of Jack Carters, would it be enough to Acquire Carter and “go to work” on whoever we’ve been given in the hope that we’ll still get our desired outcome?
This raises another interesting philosophical question about Jack Carter, what if it’s not about needing him physically, but about comprehending what makes him tick, what if “getting” him really means Deconstruct Carter or Read Carter? Michael Caine’s character is surely a product of his actions and interactions with many people over his life; so what if the emphasis in the title is on the “creation” process, e.g. Allocate Carter? This seems a little too raw and so I wonder whether he was a product of his own destiny or molded by circumstances outside his control; was there a higher power attempting to Make Carter or Build Carter? But people aren’t buildings formed according to a blueprint, they’re shaped over time, carefully revealed like Michelangelo’s David, to wit we should add Sculpt Carter to the ever growing list of far more expressive terms.
Realistically though it’s a 1970’s gangster movie and that means there is going to be plenty of “claret” spilled as everyone ultimately meets a grisly demise. Hence we find the most plausible variation of “get” if we say the film’s title in a classic deep London accent. In this sense to “get someone” is to chase after them, on the premise that you’re going to do them a serious amount of harm at the very least, while death is the more inevitable outcome. In this sense Kill Carter might be more representative, if (once again) a little spoiler-ish. (I wonder if the working title for Quentin Tarantino's two-part volume staring Uma Thurman was the more ambiguous Get Bill?) Gangsters don’t tend to do things by half; they like to go over the top for dramatic effect, which would lead to the more extensive Destroy Carter. (Such is the level of ambiguity here that it’s interesting to note we’ve covered both birth and death using the same word.)
Really though we’ve barely scratched the surface on this topic as we’ve tried to fit in (albeit dubiously) within the confines of the genre in question. If we move into the realms of science fiction we can easily see a variety of plots that could give rise to a bunch of alternatives. What if our aforementioned “Mr Big” wanted to build an entire army of Jacks that were at his beck-and-call to help build an Empire, we could look to Clone Carter. Or maybe his raw intellect is all that’s desired to satisfy some hare-brained AI project and Derive Carter is a modern-day tale of Dr Frankenstein playing with neural nets and machine learning.
Okay, I’ll stop now with the flights of fancy and take George Box’s observation a little more seriously. The title of a film is a hook, its ambiguity is a selling point designed to draw you in and explore it. That’s almost the opposite of what naming functions and methods is about – they should provide you with a good indication of their purpose without you needing to either read the documentation or worse, the implementation. Granted it can be difficult to convey subtleties with only a single verb (or handful of words) but the difference between finding and creating, calculating and cloning, or reading and formatting is already pretty substantial and gives the reader a fighting chance of understanding at an abstract level what your big picture is. Remember: just because it’s called code doesn’t mean it has to be cryptic. Get it?
Chris Oldwood
20 November 2019
Chris is a freelance programmer who started out as a bedroom coder in the 80’s writing assembler on 8-bit micros. These days it's enterprise grade technology in plush corporate offices. He also commentates on the Godmanchester duck race and can be easily distracted via gort@cix.co.uk or @chrisoldwood.