23 February 2021 · Code and community

Lilo, Stitch… and total

A confusing variable name brought a cartoon character into a 2021 BB code review.

An illustration for this story

A picture first. The explanation followed.

On 23 February 2021, the BB channel posted a Lilo & Stitch picture with the caption “Lilo and total”. There was no accompanying message. Less than eight minutes later, the next post linked to a code review.

Names without clues

The admin had received a user’s bot code and worked through it piece by piece. A variable called historyy held a deposit notification. A similarly named resource held a number. Properties called data11 and data22 made the trail harder to follow.

The review kept returning to the same problem: a reader could see the names without knowing what they meant. The admin suggested clearer names, formatting and functions.

Enter Lilo

Then came lilo. It read a stored property called total; the next line added amount and called the result total again. The admin asked whether this mysterious Lilo was the cartoon character, and inserted the picture.

By the end, the admin’s verdict was that the code needed a rewrite. The mystery picture now had its explanation: Lilo and total.

From the archive

Original code, lines 41–42: var lilo = Bot.getProperty("total"); var total = lilo+amount;
Original two-line image from the 2021 review. The names change between the stored property and its variable. Read the code reviewSelect image to enlarge