Switched On Readability
by in CodeSOD on 2026-11-30Jon has a team mate that has a coding quirk. They tend to write this pattern a lot.
switch (someEnum)
{
case EnumType::TargetValue: doStuff(); break;
default: doOtherStuff();
}
Jon has a team mate that has a coding quirk. They tend to write this pattern a lot.
switch (someEnum)
{
case EnumType::TargetValue: doStuff(); break;
default: doOtherStuff();
}
Uncharacteristically, I will be earnest for a moment. The holiday season can be a difficult time for many people, for many reasons that are beyond the scope of this column except for the fact that most of them are also wtfs. If you're one of those, stick around, because there are a lot of us here. And with that, on to BJH, who's a little behind.
B.J. H. reflects "Have there been any changes in my life in the last 55 years that could cause depression, other than the creation of the Internet?" I can think of a few but that's definitely on the list.
It's a holiday in the US, where we give thanks. Specifically, we give thanks that we're not working with the person responsible for this. Original --Remy
The Quine – i.e., a program that produces its own source code as output – lives in the esoteric realm of computing and computer science. It’s almost entirely useless, but usually pretty fun. The Quine Programmer, on the other hand, is among the pantheon of programming gods, sitting between The Great Abstractor and The PHP God.
The Quine Programmer has the uncanny gifts of being infinitely good at programming and infinitely insightful, thus allowing him to write a program to replace himself and all other programmers. The output of The Quine Programmer is system that’s fully configurable by the end-user; should the end-user want something changed, she can simply change it herself.
David came across some Java code. This particular block needed to, based on an integer masquerading as an enumerated type, return an amount of time to sleep. It has strong opinions about what should happen when you send it an invalid value:
private static int getTime(int mode) {
return switch (mode) {
case 0 -> 30 * SECOND;
case 1 -> 15 * SECOND;
case 2 -> 10 * SECOND;
case 3 -> 20 * SECOND;
case 4 -> 17 * SECOND;
case 5 -> 32 * SECOND;
default ->
// go to hell
1000000000;
};
}
At this point, each and every one of us knows more about Jensen Huang's sex life than I think any of us wanted to know. The actual scandal is the way he violated export controls to the tune of $12b in chips, but the scandal everyone is talking about is that he was "honey-trapped". A Chinese spy seduced him, got secrets out of him, and also he violated export controls for her. What can I say? People like thinking about attractive spies doing spy stuff.
It's ripe for joke of course, but it's also ripe for paranoia. I mean, think about it, we're all in tech. We all know insider secrets. At any moment, an extremely attractive person could seduce us and pump us for information about the inventory management process at Initech, and also seduce us. It could totally happen.
Earlier this year, I wrote a couple of times about my utility closet of infinite WTFs. After a total remodel and HVAC upgrade, I learned the demons had not been exorcised. Indeed, they still haunt the place, and now they're really showing off their sense of humor.
On a recent November morning with frost covering the ground and below-freezing temps, I awoke to find my house a chilly 14.4C / 58F. The gas furnace would try to start up, then fail with the message "Pressure Error - Your system may not be operational. Do not attempt to correct the problem yourself. Contact your dealer as soon as possible."
There's a bathroom on the right!
"Interesting temperature reading from WU" notes Peter G. "This must be what happens when a bulk liquid nitrogen carrier runs aground in your favourite holiday spot. Either that or you're supposed to take the average of +60 and -40 to get the actual temperature."
Today's anonymous submission is a blast from the past. This comes from an intranet HTML page that has been receiving continuous updates for some time. How long? Well, let's take a peek at how it does its layout.
<b>Extension:</b> x5555<br />
<b>Email:</b>: <a href="mailto:[email protected]"></a><br /><br />
</td>
<td width=140>
</td>
</tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
</td>
</table>
</center>
<!-- END DIRECTORY -->
<tr><td><br /></td></tr>
</td>
</tr>
</table>
<!-- MATERIAL ENDS HERE -->
<br />
<br />
</td>
</tr>
</table>
</center>
</td>
</tr>
<tr><td width=987 height=4 background="../images/table_bottom_sidebar.jpg"></td></tr>
</table>