Recent Articles

Dec 2023

(Almost) Nought but Nulls

by in Error'd on

For this week, it's mostly nulls. But first, Finn Sami provides a provocative hint that the LLMs might be developing a theory of other minds. Says Sami: "A coworker noted that when Copilot starts to have doubts about Bing, this might be the real start of AGI." I've certainly got my doubts about some of the Alleged GIs around.


A Nice Break

by in CodeSOD on

Once upon a time, HTML had tags like <marquee>, which scrolled text across your page, and when combined with animated GIF backgrounds basically defined the Geocities aesthetic.

Since then, the HTML specification has been refined, and the choice has been made that HTML tags should (mostly) be about semantics- describing the structure of a page, the meaning of elements, and the relationship between those elements. It generally shouldn't describe the presentation of those elements (CSS should do that)- even though the semantics generally imply something about the display (paragraphs and divisions are block elements, for example).

Evaluating Perks

by in CodeSOD on

Today's anonymous submitter works for a company that handles customer rewards perks. It's handling thousands of dollars of transactions a day, which isn't a huge amount, but it's certainly non-trivial.

Now, there's a conversion formula from points to dollars: points/100*1.7. Now how would someone implement this complex formula in PHP? Well, our submitter's predecessor did it this way:

TrUe Romance

by in CodeSOD on

Mario's predecessor was writing some Java code that parsed textual input. Thus, it needed to be able to turn the string "true" into the boolean value true, but also needed to handle "True" and "TRUE".

Now, in Java, the obvious answer would be to use the equalsIgnoresCase String member function. if (value.equalsIgnoresCase("true"))…. I mean, obvious to you or me, anyway.

Capitalizing on Memories

by in CodeSOD on

Gavin inherited some "very old" C code, originally developed for old Windows systems. The code is loaded with a number of reinvented wheels.

For example, they needed to do a case insensitive string comparison. Now, instead of using stricmp, the case insensitive string comparison, they wrote this:

A Brand New Bag!

by in Error'd on

We've all been watching programming gaffes come and go, and they're almost always some variation on a set of usual themes I've been trying to classify and name. But today, we've got one for you that is amazingly, excitingly, fabulously novel! I'm calling this one ecrash unless somebody's got a better idea.

Not to keep you waiting any longer than absolutely necessary, here's Ian M. with this week's winner: "I don't even know how you do search like this, it's somehow both way more complicated and way more unsettling then it needs to be."