The Case of the Missing Parentheses


In every great detective’s career, there comes a case which baffles even the most consummate professional.

It was I, Hercule Poirot, who solved the mystery of the nested github repositories, and the double ubuntu’s, not to mention my notorious success with the case of the restricted access permissions. But a case which still haunts me to this day, is the

CASE OF THE MISSING PARENTHESES

It was summer, and I was on the Riviera, with my good friend Hastings, recuperating from a difficult windows update (the culprit was a rogue graphics driver) and was looking forward to some well earned rest, drinking small restorative liqueurs and eating geometric foods. But alas, wherever Hercule Poirot goes, crime must follow. I was awakened the next morning by an urgent error message, saying:

SYNTAX ERROR UNEXPECTED TOKEN

I immediately sprang into action, and quarantined the crime scene, by commenting out sections of my earlier work by using // and */ I am, of course, familiar with such error messages. Missing parentheses are standard in this business. And I could see it was missing parentheses at once. The error message told me so. Either that or an extra parentheses. These notorious criminals travel in pairs. Such crimes are typically easily solved. But when I saw the error message saying the unexpected token could be found on the last line of the documentmy suspicions were immediately aroused. The last line is often a red herring. Like the butler, he is often accused, but rarely guilty. I interrogated the last line, as a precaution, but I was not surprised to find it perfectly in order. And so my search began in earnest.

I checked over the entire document first, to see whether I could see anything amiss. But everything seemed to be in order. I did not get down on my hands and knees and search amongst the carpets, like one of your Scotland Yard lackeys. I did not want to dirty my suit, which is of the most exquisite quality. The amateurs may search amongst the cigarette buts. But a professional such as myself has only to employ the little grey cells.

I thought long and hard over the problem. But this problem was unfamiliar to me, and my normal methods of interrogating the suspects was difficult, as none of them spoke my native language, Belgian French, nor the English, in which I am also superior.

In order to clear my mind I went for a walk by the seaside. I drank a large cocoa and pruned my moustaches I console logged various suspects to see if they were working as expected. I found, to my satisfaction, they were. So why the error message? It is like the rare case of finding a body, and not knowing who was murdered.

I consulted to my colleagueSven Hjerson, an accomplished Finnish detective, but he was just as baffled as I. I talked to my friend Hastings, a notorious imbecile, who is easily misled (aka: The Rubber Ducky Method) Often his own disastrous apprehension of the situation allows me to see the truth with greater clarity. I searched online to see if any similar crimes had been committed nearby. I accused a few functions at random, to see how they reacted. I thought over my earlier cases, but still I was stuck. Me, Hercule Poirot!

I had a few suspects of course, one of which was a large and rather complex loop, who had arrived on the scene at around the same time as the error message. But when I went to interrogate the further, I discovered the loop had been murdered!

I decided to try a small experiment I reproduced the crime scene containing the murdered loop in a sterile environment. I used console logging and node to autopsy the loop, to see if I could ascertain the cause of death. Under the vscode scalpel, the coloured interface made it easier to see the issue. There, in the left pocket of the dead function, was the missing parentheses. Viola!