Curious Perversions in Information Technology
7k followers 6 статей/тиждень
CodeSOD: All the Cases Covered

David's application has loads of unit tests. Many of the unit tests even go so far as to exhaustively test every combination of parameters. So seeing something like this is pretty common: [Test] [TestCase(false, false, false, false, false)] [TestCase(false, false, false, false, true)] [TestCase(false, false, false, true, false)] [TestCase(false,...

Tue Jun 18, 2024 14:43
CodeSOD: Actively Xing Out

Today, I'm honestly not sure that the WTF is in the code we're looking at. Jeff needed to support an older PHP application which used client side JavaScript heavily. This block was copy-pasted many times throughout the code base: var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest...

Mon Jun 17, 2024 15:36
Error'd: All Michael

One of our most dedicated readers, Michael R., is also one of our most dedicated contributors, sometimes sending us several submissions in a single day. We haven't featured all of them, but now we're making up for that. Today, it's wall-to-wall Michael, mostly food misadventures. Michael might tell you we've cooked the plot, but he can't prove...

Fri Jun 14, 2024 14:00
CodeSOD: Broken Loop

Kyle sends us a puzzler of bad code today. It appears in a "JSP-like" codebase- which Kyle provides no futher details on, but certainly hints at a serious WTF underpinning this code. boolean loop = true; while (loop) { // fake loop to break out of loop = false; doesStuff(); moreStuff(); etc(); } This is a representative block,...

Thu Jun 13, 2024 14:25
CodeSOD: Gonna Need an Extension

Ever since the DOS days, determining file type based on the three letter extension in its filename has been a common practice. I'd argue that it's not a good practice, but it's become so standard that it's hard to avoid. It's so common that pretty much any language in wide use has some sort of "get extension" method. C# is no exception. Of course,...

Wed Jun 12, 2024 15:11
CodeSOD: Terminated Nulls

When you get into the world of proprietary filesystems, things can get real weird. There are many a filesystem that doesn't support directories, still in use today. Or filesystems which only allocated chunks in multi-megabyte blocks, which means you end up wasting a lot of space if you have small files. Or filesystems where the largest file size is...

Tue Jun 11, 2024 13:59

Створіть власну стрічку новин

Готові спробувати?
Спробуйте протягом 14 днів. Платіжна картка не потрібна.

Зареєструватися