<?xml version="1.0" encoding="utf-8" standalone="no"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0"><channel><title>The Daily WTF</title><link>http://thedailywtf.com/</link><description>Curious Perversions in Information Technology</description><lastBuildDate>Wed, 01 Jul 2026 08:45:03 GMT</lastBuildDate><item><dc:creator>Ellis Morning</dc:creator><title>The Hot Fix</title><link>https://thedailywtf.com/articles/the-hot-fix</link><category>Feature Articles</category><pubDate>Tue, 30 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/the-hot-fix</guid><description>&lt;blockquote&gt;
&lt;p&gt;Everybody has a nemesis. A dark mirror of yourself, a challenge that is everything you hate. If you&amp;#39;ve ever worked tech-support, you know what that is: printer issues.&lt;br/&gt;
I&amp;#39;m &lt;strong&gt;Anonymous&lt;/strong&gt;, and you last saw me in the case of &lt;a href="https://thedailywtf.com/articles/the-ghost-cursor"&gt;The Ghost Cursor&lt;/a&gt;. This is my story.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As the days marched on, the chill in the air turned from bracing to painful. God had hoofed it down to Florida for the winter, and this year, he&amp;#39;d stolen Hope away with him. Between leaden skies and dirty slush, gale-force winds sent snow tearing down city streets to sandblast one and all into their constituent atoms.&lt;/p&gt;
&lt;p&gt;In that timeless slog, one year ended and another began, barely noticed. The short days and bitter cold made my foot-and-bus commute almost unbearable. Only the promise of warmth and caffeine at the other end got me through. A cup of joe at my desk, then a glance at my caseload, something I approached with a weird mix of curiosity and dread.&lt;/p&gt;
&lt;p&gt;That morning, a fresh ticket had just come my way: The new printer in HR keeps printing gibberish.&lt;/p&gt;
&lt;p&gt;Another printer. Why was it always printers? I dialed up the source, a guy named Tony, and made my introductions. “What do you mean by &amp;#39;gibberish?&amp;#39;”&lt;/p&gt;
&lt;p&gt;“It&amp;#39;d be easier to show you in person,” Tony replied, his voice jittery. “Could you stop by my cube right away?”&lt;/p&gt;
&lt;p&gt;“Sure thing.”&lt;/p&gt;
&lt;p&gt;I hung up, tossed the last dregs of coffee down my throat, and stood from my chair. At the same moment, a slight silver-haired woman made tracks down the open passageway a few feet away from me. She clutched her laptop and a stack of folders to her chest, making a beeline toward who-knew-what.&lt;/p&gt;
&lt;p&gt;My first pleasant surprise of the day. I couldn&amp;#39;t help calling out to her. “Aggie! How&amp;#39;s it goin&amp;#39;?”&lt;/p&gt;
&lt;p&gt;When I&amp;#39;d first gotten my start in Tech Support, Agnes Shaw had been one of the department&amp;#39;s top reps. She knew every system quirk, every trick to pull, every right thing to say to leave a smile on someone&amp;#39;s face. I&amp;#39;d come up under her wing, sought her advice a million times.&lt;/p&gt;
&lt;p&gt;And then they&amp;#39;d offered Aggie a promotion, with a fancy title and salary to boot. She&amp;#39;d taken it.&lt;/p&gt;
&lt;p&gt;That was years ago, now. I wasn&amp;#39;t her direct report, so I only caught glimpses of her now and then. It was a shame.&lt;/p&gt;
&lt;p&gt;Aggie halted in her tracks, dazed and startled, before looking my way. A second later, she smiled. “Hello! Doing just fine, yourself?”&lt;/p&gt;
&lt;p&gt;“Same as ever.” But my spirits had lifted. Knowing there was no time to waste, I darted over to conversational distance. “You&amp;#39;re a hard one to get ahold of.”&lt;/p&gt;
&lt;p&gt;She shrugged her shoulders with a wistful expression.&lt;/p&gt;
&lt;p&gt;“Why don&amp;#39;t we step out for a smoke?” It seemed like we both needed it. “When are you free?”&lt;/p&gt;
&lt;p&gt;“Not today. Meetings all day.” Aggie glanced askance. “It&amp;#39;s not appropriate for me to go out there, anyway. You need a place where you can vent freely.”&lt;/p&gt;
&lt;p&gt;“Spoken like a true manager,” I scolded with a smirk. “Listen, we haven&amp;#39;t caught up in ages. Could we step out for coffee sometime?”&lt;/p&gt;
&lt;p&gt;A warm glow peeked through her distraction. “I&amp;#39;d like that! Find an open spot on my schedule and book it, OK? I gotta run!” With a look of apology, Aggie backed away and rushed down the passage flanked by cubicles and filing cabinets.&lt;/p&gt;
&lt;p&gt;Aggie made these offers all the time. Then, just before the appointed hour, something always came up that required a rain check. Well, I didn&amp;#39;t care. I darted back to my desk, woke up my sleeping machine, and pulled up the office calendar to request a meeting the next day, right when I usually needed a dose of caffeine to make it through an otherwise endless afternoon. It was on Aggie to confirm or reschedule.&lt;/p&gt;
&lt;p&gt;Meanwhile, I had a date with HR.&lt;/p&gt;
&lt;p&gt;Human Resources. Normally, those words gave me an instant case of the willies. Μost of the people there were the sort of drones who couldn&amp;#39;t hack Accounting or Finance in business school. But Leila … Leila was different. I couldn&amp;#39;t help thinking about her. Back when I&amp;#39;d fielded a support ticket up in C-Town, an issue caused by the very CEO who&amp;#39;d filed the ticket, Leila had helped me keep my head attached to my neck. It seemed like maybe, just maybe, she really did want to improve this sorry joint the way she claimed.&lt;/p&gt;
&lt;p&gt;I entered the nearest stairwell and plodded down a couple flights of concrete steps. Within those narrow confines, I brought myself back to reality. Leila was one executive among dozens on the org-chart. She wouldn&amp;#39;t have a blessed thing to do with a low-level case like this. I had to stay on my toes in HR, no matter what friends I thought I&amp;#39;d made.&lt;/p&gt;
&lt;p&gt;I pushed open the stairwell door and entered a carpeted space lined with filing cabinets, supply closets, and office machines. Sharp florescent lighting revealed an older man in a tailored suit only a few feet away, frowning as he took a hair dryer to the insides of a large printer that&amp;#39;d seen better days and now begged for oblivion.&lt;/p&gt;
&lt;p&gt;As the stairwell door swung shut behind me, I froze. No matter how many years you piled up in this joint, it never ran out of new things to throw at you. This had to be the printer I was there to fix—more like save from yet another abusive higher-up who&amp;#39;d require kid-glove handling.&lt;/p&gt;
&lt;p&gt;First things first. I had no idea if I&amp;#39;d gotten there in time to save the printer, but damned if I wouldn&amp;#39;t try. Like a lifeguard diving in after a drowning victim, I rushed over to the outlet where the hair dryer was plugged in. Adding to the insanity, it was the wrong sort of outlet for a hair dryer, which needed a GFCI to run safely. I ripped the plug from the outlet and threw it aside.&lt;/p&gt;
&lt;p&gt;The roar of the dryer faded, leaving stunned silence in its wake.&lt;/p&gt;
&lt;p&gt;Burning with righteous fire, I spun around to face the perp. The HR big-shot faced me, too, brandishing his hair dryer like a revolver. Wide-eyed passersby fringed the scene like extras in a B-Western.&lt;/p&gt;
&lt;p&gt;Kicking anything or anyone when they were down was the sort of thing that stabbed through my armor of veteran cynicism, riling me up with righteous anger. But an outburst would only make things worse. For the good of all, I swallowed it, forcing a polite lie past gritted teeth. “Just wanted to make sure you could hear me, sir.”&lt;/p&gt;
&lt;p&gt;Like hell.&lt;/p&gt;
&lt;p&gt;“Tech Support,” I introduced myself. “This the printer that ain&amp;#39;t working?”&lt;/p&gt;
&lt;p&gt;Hothead&amp;#39;s glaring frustration shifted away from his victim, toward me. “Yes, and I&amp;#39;ve had it! It must be moisture inside the machine.”&lt;/p&gt;
&lt;p&gt;God, help me. Oh, right: Florida.&lt;/p&gt;
&lt;p&gt;“Good thinking, sir,” I said. “But I&amp;#39;m less worried about moisture and more worried about melting sensitive electronics with all that heat.”&lt;/p&gt;
&lt;p&gt;His eyes went wide, like the notion had never entered his brain.&lt;/p&gt;
&lt;p&gt;Slowly, I knelt to pick up the hair dryer&amp;#39;s plug. Unchallenged, I rose and started winding the power cord around my left hand, inching closer to him in the process. Once I was standing in front of him, I proffered the wire bundle.&lt;/p&gt;
&lt;p&gt;“Hold onto that for me, sir, if you don&amp;#39;t mind.” Phrasing things as favors made them go down smoother. Now to dig up a workaround that would get this guy out of everyone&amp;#39;s hair. “Is there some other printer you can use for now?”&lt;/p&gt;
&lt;p&gt;His open hand clamped over the wire as his expression soured. “Yes, but it&amp;#39;s a pain to walk over there!”&lt;/p&gt;
&lt;p&gt;“I understand, sir. It&amp;#39;s something. Don&amp;#39;t worry about this one. I&amp;#39;ll take it from here.”&lt;/p&gt;
&lt;p&gt;Hothead walked off without another word. The spell broke; the onlookers found places to be.&lt;/p&gt;
&lt;p&gt;With relief and dread, I approached the printer, fearing I&amp;#39;d be performing last rites. But as I checked it over inside and out, I found an incredible lack of melted parts. When I plugged it in and started it up, everything loaded just fine. Using the printer&amp;#39;s onboard interface, I performed every available test print. They all worked.&lt;/p&gt;
&lt;p&gt;Snatched from Death&amp;#39;s doorstep. “Hang in there,” I muttered, patting the machine&amp;#39;s plastic case. “I&amp;#39;m doing everything I can.”&lt;/p&gt;
&lt;p&gt;Like making sure Leila got an earful about this. Later.&lt;/p&gt;
&lt;p&gt;Before leaving the scene, I had a good look high and low. Ceiling tile and carpet were clean. No leaks, no spills. Even the heated indoor air lacked enough water molecules to give Hothead or anyone else the idea that “excess moisture” might&amp;#39;ve been the problem. Time to chase down the ticket-holder and see if the problem was already resolved.&lt;/p&gt;
&lt;p&gt;A couple of passersby pointed me toward a distant corner of HR, where I found a cube-desk buried under reports, folders, and other well-intentioned clutter. A man was sitting in an office chair facing the cube&amp;#39;s entrance, squeezing a rubber stress ball.&lt;/p&gt;
&lt;p&gt;“You Tony?” I entered the cube, offering my hand.&lt;/p&gt;
&lt;p&gt;He stood, shook, then immediately returned to the reassurance of his toy. “Sorry. My boss is, uh, tough like that.”&lt;/p&gt;
&lt;p&gt;“Hothead&amp;#39;s your boss? Jesus. He almost single-handedly iced that printer. Well, maybe &amp;#39;iced&amp;#39; ain&amp;#39;t the word for it.” I folded my arms. “You know who&amp;#39;s gonna hear about it? The new head of HR. When I close this ticket, I&amp;#39;ll drop her a line about what happened.”&lt;/p&gt;
&lt;p&gt;Tony&amp;#39;s eyes went wide. “Really? Thank you! I know I&amp;#39;m supposed to go up the chain, but …” He edged closer, lowering his voice. “Sometimes it&amp;#39;s the chain that&amp;#39;s the problem, y&amp;#39;know?”&lt;/p&gt;
&lt;p&gt;Something I&amp;#39;d run into only a million times. “I know. Can&amp;#39;t do much about it most of the time, but I can here, so I will.”&lt;/p&gt;
&lt;p&gt;Tony nodded. “Thanks again.”&lt;/p&gt;
&lt;p&gt;“Don&amp;#39;t mention it. Anyway, the printer. Your ticket said it was new? Looks pretty darn old to me.”&lt;/p&gt;
&lt;p&gt;“It&amp;#39;s new over here,” Tony explained. “They just it brought down and set it up for us.”&lt;/p&gt;
&lt;p&gt;“Can you try printing now?” I asked. “Let&amp;#39;s see what happens.”&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;Later that morning, I stopped by the usual smoke-break spot between office buildings. As wind and snow coursed through the alley, I recapped the morning&amp;#39;s events for my friends Megan and Reynaldo. Then I pulled a stack of folded-up paper from my trench coat pocket, splitting it in half to hand them several pages apiece. At last, I dug through my pockets for my sorely-needed cigarettes and lighter. While I carefully shielded the lighter&amp;#39;s flame from the wind to light the cigarette clenched in my teeth, they studied the printouts with looks that quickly turned baffled.&lt;/p&gt;
&lt;p&gt;”I don&amp;#39;t feel safe working with Cheryl?” Reynaldo read aloud.&lt;/p&gt;
&lt;p&gt;”John keeps staring at me in the break room. I&amp;#39;ve told him twice.” Megan&amp;#39;s eyes found mine. “What the hell? Every print request does this?”&lt;/p&gt;
&lt;p&gt;“Every print job except for test prints,” I replied. “We&amp;#39;re lucky the poor thing starts up at all after Hothead gave it the salon treatment.”&lt;/p&gt;
&lt;p&gt;Megan smirked, handing back her pages before hugging herself against the cold. “Sounds to me like it might be a network issue.” She glanced Reynaldo&amp;#39;s way for confirmation.&lt;/p&gt;
&lt;p&gt;Our veteran network admin was too busy frowning at the stack of paper he rifled through to notice. “What have you tried?” he asked me.&lt;/p&gt;
&lt;p&gt;I helped myself to a long, warming drag. “The printer already spent some time turned off and unplugged.” Hothead had seen to that. “Since it&amp;#39;s old, figured I&amp;#39;d reinstall the drivers, clear the print queue. Didn&amp;#39;t help.” I shrugged. “Megan&amp;#39;s right. Since it doesn&amp;#39;t happen with test prints, it seems like something fishy&amp;#39;s happening when the print requests coming through the network.”&lt;/p&gt;
&lt;p&gt;Reynaldo frowned in thoughtful silence for a while, then glanced between us. “Do you remember that system for submitting HR complaints anonymously through the intranet?”&lt;/p&gt;
&lt;p&gt;Forcing my brain-pointer back into memory spaces I usually steered clear of, it came back to me a little, through a thick fog. “Few years back? Before your time,” I added for Megan&amp;#39;s benefit. “Never paid it much mind. Never really believed those gripes would actually be anonymous.”&lt;/p&gt;
&lt;p&gt;“Yeah, that&amp;#39;s crazy!” Megan said. “Who would trust that?”&lt;/p&gt;
&lt;p&gt;I hefted the printouts she&amp;#39;d returned to me, each page loaded with more beef than a Texas ranch. “That&amp;#39;s who.”&lt;/p&gt;
&lt;p&gt;“They retired that program ages ago,” Reynaldo said. “The server was decommissioned—at least, so I thought.” He dropped his cigarette butt to the slush-covered asphalt and crushed it underfoot, sighing heavily with a knowing look. “Let&amp;#39;s go trace some IPs.”&lt;/p&gt;
&lt;p&gt;“Swell!” I was about to grind my partially-smoked cigarette against the brick wall behind me to save it for later when I caught the hopeful look in Megan&amp;#39;s eye.&lt;/p&gt;
&lt;p&gt;“Can I help, too?” she asked.&lt;/p&gt;
&lt;p&gt;What fool would say no?&lt;/p&gt;
&lt;p&gt;“We may need a good developer at that,” I said. “C&amp;#39;mon!”&lt;/p&gt;

&lt;p&gt;&lt;b&gt;To be continued…&lt;/b&gt;&lt;/p&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. &lt;a href="https://inedo.com/proget/private-nuget-server?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter&amp;amp;utm_campaign=Cyclops2020"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>23</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/the-hot-fix</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Off the Path</title><link>https://thedailywtf.com/articles/off-the-path</link><category>CodeSOD</category><pubDate>Mon, 29 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/off-the-path</guid><description>&lt;p&gt;File path separators are a common pain point when writing cross platform software. Of course, not every programming language has a graceful API for handling that. For example, prior to C++ 17, you had to do some &lt;code&gt;#ifdef&lt;/code&gt; preprocessor magic to handle that. Which people usually did (or they&amp;#39;d use the Boost suite of libraries).&lt;/p&gt;
&lt;p&gt;Code like this wouldn&amp;#39;t be out of place or incorrect:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-cpp"&gt;&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; defined(WIN32) || defined(_WIN32) &lt;/span&gt;
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;define&lt;/span&gt; PATH_SEPARATOR &lt;span class="hljs-string"&gt;&amp;#34;\\&amp;#34;&lt;/span&gt; &lt;/span&gt;
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;else&lt;/span&gt; &lt;/span&gt;
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;define&lt;/span&gt; PATH_SEPARATOR &lt;span class="hljs-string"&gt;&amp;#34;/&amp;#34;&lt;/span&gt; &lt;/span&gt;
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;endif&lt;/span&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Do I like it? No. But now I&amp;#39;ve got a pre-processor constant that I can use to assemble my paths in a way that will work across different file path conventions.&lt;/p&gt;
&lt;p&gt;Of course, that&amp;#39;s the &amp;#34;normal&amp;#34; solution. You could, if you wanted, to it completely wrong. That&amp;#39;s what &lt;strong&gt;Xian&lt;/strong&gt;&amp;#39;s predecessor did.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-cpp"&gt;&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;ifdef&lt;/span&gt; UNIX&lt;/span&gt;
           filename += &lt;span class="hljs-string"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;;
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;else&lt;/span&gt;&lt;/span&gt;
           filename += &lt;span class="hljs-string"&gt;&amp;#34;\\&amp;#34;&lt;/span&gt;;
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;endif&lt;/span&gt;&lt;/span&gt;
           filename += (*exSeq)[i].path;
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;ifdef&lt;/span&gt; WIN32&lt;/span&gt;
           &lt;span class="hljs-built_in"&gt;ReplaceAll&lt;/span&gt;(filename, &lt;span class="hljs-string"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;, &lt;span class="hljs-string"&gt;&amp;#34;\\&amp;#34;&lt;/span&gt;);
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;else&lt;/span&gt;&lt;/span&gt;
           &lt;span class="hljs-built_in"&gt;ReplaceAll&lt;/span&gt;(filename, &lt;span class="hljs-string"&gt;&amp;#34;\\&amp;#34;&lt;/span&gt;, &lt;span class="hljs-string"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;);
&lt;span class="hljs-meta"&gt;#&lt;span class="hljs-keyword"&gt;endif&lt;/span&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If we&amp;#39;re compiling for unix, append a &amp;#34;/&amp;#34; to the filename. Otherwise, append a &amp;#34;\&amp;#34;. Then we append a path out of an array. Then, if we&amp;#39;re on Windows, find all the &amp;#34;/&amp;#34; in our filename and replace them with &amp;#34;\&amp;#34;. Otherwise, find all the &amp;#34;\&amp;#34; in our filename and replace them with &amp;#34;/&amp;#34;.&lt;/p&gt;
&lt;p&gt;Instead of defining a constant and using it everywhere you need to construct paths, this code was copy/pasted everywhere you needed to append a path separator onto your string. Well, almost everywhere. Clearly, we don&amp;#39;t know that the contents of &lt;code&gt;(*exSeq)[i].path&lt;/code&gt; are correct for our target operating system, hence we have to do the &lt;code&gt;ReplaceAll&lt;/code&gt; call to sanitize it. Why didn&amp;#39;t we sanitize the portion we&amp;#39;re appending instead of the whole &lt;code&gt;filename&lt;/code&gt; (which presumably is already sanitized?)? A better question: is this running inside of a loop? It looks like it is, based on the &lt;code&gt;[i]&lt;/code&gt; array access there.&lt;/p&gt;
&lt;p&gt;Multiple developers have copy/pasted this code into multiple places. Not one of them gave a shot at refactoring it. And somehow, there are still code paths that output the wrong path separator sometimes, though at least modern Windows is forgiving about that.&lt;/p&gt;
&lt;!-- Easy Reader Version: And nobody properly supports the Files-11 path syntax anyway. Though tagging files with versions was cool. https://en.wikipedia.org/wiki/Files-11 --&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/buildmaster-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	&lt;a href="https://inedo.com/BuildMaster?utm_source=tdwtf&amp;amp;utm_medium=footerad&amp;amp;utm_term=2018&amp;amp;utm_content=Self_Service&amp;amp;utm_campaign=Buildmaster_Footer"&gt;BuildMaster&lt;/a&gt; allows you to create a self-service release management platform that allows different teams to manage their applications. &lt;a href="https://inedo.com/BuildMaster/download?utm_source=tdwtf&amp;amp;utm_medium=footerad&amp;amp;utm_term=2018&amp;amp;utm_content=Self_Service&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Explore how!&lt;/a&gt; 
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>29</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/off-the-path</wfw:comment></item><item><dc:creator>Lyle Seaman</dc:creator><title>Error'd: Fi fa foe</title><link>https://thedailywtf.com/articles/fi-fa-foe</link><category>Error'd</category><pubDate>Fri, 26 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/fi-fa-foe</guid><description>&lt;p&gt;First up this week is a little story about a fifafail. I do wonder if this was a failure of the television station, or whether &lt;a href="https://bobdahacker.com/blog/fifa-hack"&gt;there was something more to it than that&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Hercules&lt;/strong&gt; wrote to alert us to these World Cup shenanigans, explaing 
&amp;#34;At least the flags were correct. And yes, this was
live TV. The host got the country names correctly, and
even called out that the written text was wrong&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#5503f1d7141948f88f4650c17468ff46"&gt;&lt;img itemprop="image" border="0" alt="5503f1d7141948f88f4650c17468ff46" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/25/5503f1d7141948f88f4650c17468ff46.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;
&amp;#34;I&amp;#39;m very open in my job search but I did
limit it to France. The search has been working well
for months, but this morning I got a bevy of
new interesting propositions. It seems France is much bigger than
it was yesterday.&amp;#34; Apparently
&lt;strong&gt;WorkerNumber29200&lt;/strong&gt;
is surprised by the expansionist nature of an imperialist coloniser. Plus ça change, Worker. 
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#f05fd09185bd4f2ebeacc92de9609131"&gt;&lt;img itemprop="image" border="0" alt="f05fd09185bd4f2ebeacc92de9609131" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/25/f05fd09185bd4f2ebeacc92de9609131.jpeg"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;We have a couple of wtfs from Github.  First 
&lt;strong&gt;Hans K.&lt;/strong&gt;
&amp;#34;would love to find a, so I could fix
this GitHub Dependabot issue.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#4d41995a2e7a423cbf8de6e960b876c4"&gt;&lt;img itemprop="image" border="0" alt="4d41995a2e7a423cbf8de6e960b876c4" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/25/4d41995a2e7a423cbf8de6e960b876c4.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;And
&lt;strong&gt;Peter S.&lt;/strong&gt; figures that 
&amp;#34;GitHub has trouble doing basic math -- or they have an
unpublished proof that 0=1&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#e954781458d64f6da02bfad014efc854"&gt;&lt;img itemprop="image" border="0" alt="e954781458d64f6da02bfad014efc854" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/25/e954781458d64f6da02bfad014efc854.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Finally 
&lt;strong&gt;Michele&lt;/strong&gt; has just encountered one of the most maddening phenomena on Amazon recently.
&amp;#34;Searching for a cheap USB-C fast charger. Got
a list of expensive CDs of obscure artists.&amp;#34;  All of them AI-generated, like the &lt;a href="https://lcamtuf.coredump.cx/blog/whys2.jpg"&gt;100000 Whys&lt;/a&gt; books?
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#cdf7c2baae7541a9ad8e90b9c4ecb0c4"&gt;&lt;img itemprop="image" border="0" alt="cdf7c2baae7541a9ad8e90b9c4ecb0c4" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/25/cdf7c2baae7541a9ad8e90b9c4ecb0c4.jpeg"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/buildmaster-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	&lt;a href="https://inedo.com/BuildMaster?utm_source=tdwtf&amp;amp;utm_medium=footerad&amp;amp;utm_term=2018&amp;amp;utm_content=Self_Service&amp;amp;utm_campaign=Buildmaster_Footer"&gt;BuildMaster&lt;/a&gt; allows you to create a self-service release management platform that allows different teams to manage their applications. &lt;a href="https://inedo.com/BuildMaster/download?utm_source=tdwtf&amp;amp;utm_medium=footerad&amp;amp;utm_term=2018&amp;amp;utm_content=Self_Service&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Explore how!&lt;/a&gt; 
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>15</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/fi-fa-foe</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>The Roadmap</title><link>https://thedailywtf.com/articles/the-roadmap</link><category>Feature Articles</category><pubDate>Thu, 25 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/the-roadmap</guid><description>&lt;p&gt;When &lt;strong&gt;Gary&lt;/strong&gt; was called in for a meeting with a few of his managers- because of course he had several- he thought it was going to be for an &amp;#34;attaboy&amp;#34;, because things had been going really well for the past few months.&lt;/p&gt;
&lt;p&gt;Gary had inherited a mess, and taken over a nightmare application. It was the kind of application that &lt;em&gt;should&lt;/em&gt; be a simple CRUD-style data-driven app, but somehow despite only having 20ish entities it managed, someone had generated 500+ controllers for managing them. Most of those controllers were copy/pasted code with minor changes in the &lt;code&gt;WHERE&lt;/code&gt; clause of a SQL query.&lt;/p&gt;
&lt;p&gt;And that was just the code. The infrastructure was similarly a mess, with duplicate resources provisioned in their cloud host. There was no CI/CD, no unit tests to speak of, no deployment process that wasn&amp;#39;t &amp;#34;manually copy these files and pray&amp;#34;. And uptime? You&amp;#39;ve heard about &amp;#34;five nines&amp;#34;, but this product was lucky to get even &lt;em&gt;one&lt;/em&gt; nine. Especially because the manual deployment process meant a few hours of downtime.&lt;/p&gt;
&lt;p&gt;And that was just the infrastructure. The backlog was similarly messy. There were lots of tasks- many thousands- but not a single one had a priority. Most of the tasks were something like, &amp;#34;Fix database timeouts&amp;#34;, or &amp;#34;Bug 531&amp;#34; with no description to explain what they were. At best, some of the &amp;#34;new feature&amp;#34; tasks linked to a Google Doc that explained a software roadmap that had been last updated in 2020.&lt;/p&gt;
&lt;p&gt;So with no guidance, Gary and the rest of his team got to work. Cloud costs were massive. Just cutting the duplicate resources would help, but with actual &lt;em&gt;planning&lt;/em&gt; it wasn&amp;#39;t hard to find even bigger wins. In total, Gary got the cloud costs down 60%- essentially saving the company a small multiple of his salary every year.&lt;/p&gt;
&lt;p&gt;With that out of the way, getting a CI/CD pipeline running was next. Within a few weeks, manual deployments were gone. Everything was automated. Downtime nearly vanished. And now, with all the cost savings in cloud resources, for a fraction of what they were paying, it was easy to automate provisioning test environments for each new feature.&lt;/p&gt;
&lt;p&gt;So Gary was very ready for some congratulations when he sat down with management. He was prepared to discuss all the wins he and the rest of the developers on the project had gotten over the past few months.&lt;/p&gt;
&lt;p&gt;&amp;#34;I&amp;#39;m sure you know why we&amp;#39;re sitting down,&amp;#34; Manager the First said when they settled into the conference room.&lt;/p&gt;
&lt;p&gt;&amp;#34;I&amp;#39;m sure,&amp;#34; said Manager the Second.&lt;/p&gt;
&lt;p&gt;&amp;#34;We have some concerns about your performance,&amp;#34; Manager the Third said.&lt;/p&gt;
&lt;p&gt;&amp;#34;My performance?&amp;#34; Gary asked.&lt;/p&gt;
&lt;p&gt;&amp;#34;Yes,&amp;#34; said Manager the First. &amp;#34;Let me pull up the backlog.&amp;#34;&lt;/p&gt;
&lt;p&gt;&amp;#34;And the roadmap,&amp;#34; said Manager the Second.&lt;/p&gt;
&lt;p&gt;&amp;#34;Yes, I&amp;#39;m getting that up too, thank you.&amp;#34; The trio of managers struggled with pulling up the appropriate pages, and after about 15 minutes, gave up. Instead, they discussed their complaint without visual aids. &amp;#34;You haven&amp;#39;t completed any of the tasks on the roadmap. Bug 673 has been open since you started on the team. None of the roadmap milestones have been touched. There&amp;#39;s absolutely no progress.&amp;#34;&lt;/p&gt;
&lt;p&gt;&amp;#34;Okay, but that document was wildly out of date,&amp;#34; Gary said. &amp;#34;Instead I put cycles into solving the actual problems we&amp;#39;re having. I&amp;#39;ve saved the company a huge amount of money. I&amp;#39;ve gotten our development cycle time down to a fraction of what it was. And we have basically no downtime!&amp;#34;&lt;/p&gt;
&lt;p&gt;&amp;#34;That&amp;#39;s all very nice, I&amp;#39;m sure,&amp;#34; said Manager the Third. &amp;#34;But none of that was on our roadmap.&amp;#34;&lt;/p&gt;
&lt;p&gt;&amp;#34;Well, maybe we should set up a meeting to go over the roadmap,&amp;#34; Gary said. &amp;#34;Because a lot of the tasks on there don&amp;#39;t make much sense right now-&amp;#34;&lt;/p&gt;
&lt;p&gt;&amp;#34;I don&amp;#39;t think that&amp;#39;s a good use of time,&amp;#34; Manager the Second said. &amp;#34;Large meetings are expensive. Just stick to the roadmap, please.&amp;#34;&lt;/p&gt;
&lt;p&gt;With that, the meeting ended. Gary went back to work…&lt;/p&gt;
&lt;p&gt;… updating his resume.&lt;/p&gt;
&lt;!-- Easy Reader Version: Stick to the roadmap --&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. &lt;a href="https://inedo.com/proget/private-nuget-server?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter&amp;amp;utm_campaign=Cyclops2020"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>26</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/the-roadmap</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Authorized Logger</title><link>https://thedailywtf.com/articles/authorized-logger</link><category>CodeSOD</category><pubDate>Wed, 24 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/authorized-logger</guid><description>&lt;p&gt;&lt;strong&gt;Gretchen&lt;/strong&gt;&amp;#39;s company recently got purchased by Initech. Specifically, they were bought for their dev team, of all things. They had a few software products that were high performers, and Initech wanted that secret sauce. They bought the company, and then split the dev team up and migrated the developers to new products.&lt;/p&gt;
&lt;p&gt;That actually worked out okay for Gretchen, most of the time. For a few projects, the dev team was given some requirements and a free hand to figure out how to deliver them. They were free to reuse code that existed or rewrite entirely, based on their own judgement. They were free to pick the tools they wanted to use, and the results worked out well.&lt;/p&gt;
&lt;p&gt;But there were some projects that… were a different story. After those successes, Gretchen got moved onto a project that was 90% firefighting. The app had code like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-javascript"&gt;req.&lt;span class="hljs-property"&gt;body&lt;/span&gt;.&lt;span class="hljs-property"&gt;externalId&lt;/span&gt; = !!req.&lt;span class="hljs-property"&gt;body&lt;/span&gt;.&lt;span class="hljs-property"&gt;externalId&lt;/span&gt; ? req.&lt;span class="hljs-property"&gt;body&lt;/span&gt;.&lt;span class="hljs-property"&gt;externalId&lt;/span&gt; + &lt;span class="hljs-string"&gt;&amp;#34;&amp;#34;&lt;/span&gt; : &lt;span class="hljs-string"&gt;&amp;#34;&amp;#34;&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;How&amp;#39;s that for some null handling.&lt;/p&gt;
&lt;p&gt;The whole thing can&amp;#39;t run on a version of NodeJS newer than 14: a version that last got an update in 2023.&lt;/p&gt;
&lt;p&gt;&amp;#34;The code follows no conventions,&amp;#34; Gretchen writes, &amp;#34;there&amp;#39;s no logging.&amp;#34;&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-javascript"&gt;&lt;span class="hljs-built_in"&gt;exports&lt;/span&gt;.&lt;span class="hljs-property"&gt;create&lt;/span&gt; = &lt;span class="hljs-function"&gt;(&lt;span class="hljs-params"&gt;req, res&lt;/span&gt;) =&amp;gt;&lt;/span&gt; {
  logger.&lt;span class="hljs-title function_"&gt;debug&lt;/span&gt;(&lt;span class="hljs-string"&gt;&amp;#39;creating new staffClient&amp;#39;&lt;/span&gt;);
  logger.&lt;span class="hljs-title function_"&gt;debug&lt;/span&gt;(req.&lt;span class="hljs-property"&gt;body&lt;/span&gt;)
  &lt;span class="hljs-comment"&gt;// let staffClient = new StaffClient({});&lt;/span&gt;

  &lt;span class="hljs-comment"&gt;// // run through and create all fields on the model&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;// for(var k in req.body) {&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;//   if(req.body.hasOwnProperty(k)) {&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;//     staffClient[k] = req.body[k];&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;//   }&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;// }&lt;/span&gt;


  &lt;span class="hljs-title class_"&gt;StaffClient&lt;/span&gt;.&lt;span class="hljs-title function_"&gt;query&lt;/span&gt;().&lt;span class="hljs-title function_"&gt;insert&lt;/span&gt;(req.&lt;span class="hljs-property"&gt;body&lt;/span&gt;)
  .&lt;span class="hljs-title function_"&gt;returning&lt;/span&gt;(&lt;span class="hljs-string"&gt;&amp;#39;*&amp;#39;&lt;/span&gt;)
  .&lt;span class="hljs-title function_"&gt;then&lt;/span&gt;(&lt;span class="hljs-function"&gt;&lt;span class="hljs-params"&gt;staffClient&lt;/span&gt; =&amp;gt;&lt;/span&gt; {
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt;(staffClient) {
      res.&lt;span class="hljs-title function_"&gt;send&lt;/span&gt;({&lt;span class="hljs-attr"&gt;success&lt;/span&gt;: &lt;span class="hljs-literal"&gt;true&lt;/span&gt;, staffClient})
    } &lt;span class="hljs-keyword"&gt;else&lt;/span&gt; {
      res.&lt;span class="hljs-title function_"&gt;send&lt;/span&gt;({ &lt;span class="hljs-attr"&gt;success&lt;/span&gt;: &lt;span class="hljs-literal"&gt;false&lt;/span&gt;, &lt;span class="hljs-attr"&gt;message&lt;/span&gt;: &lt;span class="hljs-string"&gt;&amp;#34;Could not save StaffClient&amp;#34;&lt;/span&gt;})
    }
  });
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, you may say to yourself, &amp;#34;What do you mean there&amp;#39;s no logging? I see it right there!&amp;#34; There is a logger utility class, and do you know what it prints when you call &lt;code&gt;logger.debug(&amp;#34;some message&amp;#34;)&lt;/code&gt;? It prints &lt;code&gt;DEBUG&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This code handles an HTTP request, and stuffs the body of the request into the database; here&amp;#39;s hoping that it&amp;#39;s a well formed request. Somebody&amp;#39;s got a lot of faith in their front end. WHat&amp;#39;s interesting about this one is they&amp;#39;ve tried &lt;em&gt;two different ways&lt;/em&gt; of copying the request object into the database, the first one focusing on making sure they only copied non-inherited properties, and the second just YOLOing the data into the database.&lt;/p&gt;
&lt;p&gt;Now, this particular segment goes through their ORM to write data into the database. But not &lt;em&gt;all&lt;/em&gt; the code does that. Many places write data through direct SQL, and guess what happens there: SQL injection vulnerabilities.&lt;/p&gt;
&lt;p&gt;You may also notice that this function doesn&amp;#39;t do any authorization checks, which is fine, that should be configured in the middleware. &lt;em&gt;Should&lt;/em&gt; be- but isn&amp;#39;t. Most endpoints have no authorization checks at all. Even the endpoints that do, like their admin API, have copies of the same endpoint &lt;em&gt;with no authentication configured&lt;/em&gt;.&lt;/p&gt;
&lt;!-- Easy Reader Version: Don't worry, the authentication is also janky. --&gt;
&lt;style&gt;.comment { border: none; }&lt;/style&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.&lt;a href="https://inedo.com/proget?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>4</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/authorized-logger</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Do a Lot to Do Nothing</title><link>https://thedailywtf.com/articles/do-a-lot-to-do-nothing</link><category>CodeSOD</category><pubDate>Tue, 23 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/do-a-lot-to-do-nothing</guid><description>&lt;p&gt;Today&amp;#39;s anonymous submitter works in finance. I&amp;#39;ll let them start the introduction:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is a legacy application that has been running for nearly a decade in production so one could say that it&amp;#39;s been thoroughly tested by daily production use and nothing needs changing&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a collection of two C# methods, and we&amp;#39;ll start with &lt;code&gt;ValueAGPFund&lt;/code&gt;, which isn&amp;#39;t a WTF per se, but definitely not code I&amp;#39;d want to maintain either.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;&lt;span class="hljs-function"&gt;&lt;span class="hljs-keyword"&gt;public&lt;/span&gt; Valuation &lt;span class="hljs-title"&gt;ValueAGPFund&lt;/span&gt;(&lt;span class="hljs-params"&gt;&lt;span class="hljs-built_in"&gt;int&lt;/span&gt; valuationId, ValueAFundParameters parameters, CapitalAccount capitalAccount, &lt;span class="hljs-built_in"&gt;int&lt;/span&gt;? lotId&lt;/span&gt;)&lt;/span&gt;
{
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (parameters.UseActiveCoefficientSet)
    {
        parameters.CoefficientSet = _coefficientSetQueries.GetActive();
    }
    parameters.InternationalDveCoefficientSets = _coefficientSetQueries.GetInternationalDveActive();
    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; referenceData = _referenceDataFactory.CreateReferenceData(parameters, capitalAccount);
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (lotId != &lt;span class="hljs-literal"&gt;null&lt;/span&gt;)
    {
        &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; di = referenceData.FundDirectInvestments.Where(x =&amp;gt; x.PositionId == lotId);
        referenceData.FundDirectInvestments = di;
    }

    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; countryMappings = _countryQueries.GetFullIsoCountryList();
    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; valuation = _valuationFactory.Initialise(referenceData, parameters, countryMappings);
    valuation = ApplyValuators(valuation, referenceData, _valuatorFactory.CreateValuators(valuation, &lt;span class="hljs-keyword"&gt;this&lt;/span&gt;));

    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; valuationForCoverage = _valuationQueries.GetWithDirectValuationsAndFundValuations(valuationId);
    valuation = ApplyCoverage(valuation, valuationForCoverage);

    &lt;span class="hljs-keyword"&gt;foreach&lt;/span&gt; (&lt;span class="hljs-keyword"&gt;var&lt;/span&gt; fv &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; valuation.FundValuations)
    {
        _logger.Info(&lt;span class="hljs-string"&gt;$&amp;#34;Debugging distributions: for fund (parameter fund id = &lt;span class="hljs-subst"&gt;{parameters.FundId}&lt;/span&gt;, valuation fund id = &lt;span class="hljs-subst"&gt;{valuation.FundId}&lt;/span&gt;, fund valuation fund id = &lt;span class="hljs-subst"&gt;{fv.GpFundId}&lt;/span&gt;) in valuation &lt;span class="hljs-subst"&gt;{valuationId}&lt;/span&gt;,&amp;#34;&lt;/span&gt; +
            &lt;span class="hljs-string"&gt;$&amp;#34; loaded fund investment distributions from &lt;span class="hljs-subst"&gt;{&lt;span class="hljs-built_in"&gt;string&lt;/span&gt;.Join(&lt;span class="hljs-string"&gt;&amp;#34;, &amp;#34;&lt;/span&gt;, fv.FundInvestmentDistributions.Select(x =&amp;gt; &lt;span class="hljs-string"&gt;$&amp;#34;&lt;span class="hljs-subst"&gt;{x.InvestmentId}&lt;/span&gt;:&lt;span class="hljs-subst"&gt;{x.TransactionDate:yyyy/MM/dd}&lt;/span&gt;&amp;#34;&lt;/span&gt;))}&lt;/span&gt;&amp;#34;&lt;/span&gt;);
    }

    &lt;span class="hljs-keyword"&gt;foreach&lt;/span&gt; (&lt;span class="hljs-keyword"&gt;var&lt;/span&gt; fv &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; valuation.FundValuations.Where(x =&amp;gt; parameters.InvestmentIds.Contains(x.EqtInvestmentId)))
    {
        fv.ValuationId = valuationId;
        _fundValuationCommands.Add(fv);
    }

    &lt;span class="hljs-keyword"&gt;foreach&lt;/span&gt; (&lt;span class="hljs-keyword"&gt;var&lt;/span&gt; dv &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; valuation.DirectValuations.Where(x =&amp;gt; x.LotIdDiOnly == lotId))
    {
        dv.ValuationId = valuationId;
        _directValuationCommands.Add(dv);
    }

    &lt;span class="hljs-keyword"&gt;foreach&lt;/span&gt; (&lt;span class="hljs-keyword"&gt;var&lt;/span&gt; vw &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; valuation.ValuationWarnings)
    {
        vw.ValuationId = valuationId;
        _valuationWarningCommands.Add(vw);
    }

    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; previousValuation = CheckPreviousValuationIfRequired(valuationId, parameters, capitalAccount, lotId);

    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (previousValuation != &lt;span class="hljs-literal"&gt;null&lt;/span&gt;)
        valuation.ChildValuations.Add(previousValuation);

    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (parameters.Frequency == ValuationFrequency.Daily)
    {
        &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; unapprovedValuations = _valuationQueries.GetList(valuation.FundId, valuation.ValuationDate, valuation.Frequency, valuation.Purpose)
                                                    .Where(x =&amp;gt; x.IsApproved == ValuationStatus.Unapproved)
                                                    .ToList();

        _valuationCommands.Delete(unapprovedValuations.Select(x =&amp;gt; x.Id).ToArray());
    }

    valuation.Id = valuationId;
    _valuationCommands.Update(valuation);
    _valuationCacheService.Refresh(valuation.Frequency, &lt;span class="hljs-literal"&gt;true&lt;/span&gt;);

    &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; valuation;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The key problem with this function is that it&amp;#39;s got loads of side effects. It modifies the &lt;code&gt;parameters&lt;/code&gt; parameter, which while it was passed by value, the value itself is a reference, so you &lt;em&gt;are&lt;/em&gt; updating it on the caller, whether the caller likes it or not. It also modifies a bunch of internal class members. It&amp;#39;s also just… doing a lot of different steps. It&amp;#39;s not a WTF, but it&amp;#39;s bad code. Note the call in the middle to &lt;code&gt;CheckPreviousValuationIfRequired&lt;/code&gt;- we&amp;#39;re going to come back to that in a second.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s take a look at how it&amp;#39;s called.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;&lt;span class="hljs-function"&gt;&lt;span class="hljs-keyword"&gt;private&lt;/span&gt; Valuation &lt;span class="hljs-title"&gt;CheckPreviousValuationIfRequired&lt;/span&gt;(&lt;span class="hljs-params"&gt;&lt;span class="hljs-built_in"&gt;int&lt;/span&gt; valuationId, ValueAFundParameters parameters, CapitalAccount capitalAccount, &lt;span class="hljs-built_in"&gt;int&lt;/span&gt;? lotId&lt;/span&gt;)&lt;/span&gt;
{
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; ((parameters.Frequency == ValuationFrequency.Quarterly || parameters.Frequency == ValuationFrequency.Monthly)
        &amp;amp;&amp;amp; ValuationPurposeHelper.UserGenerated(parameters.Frequency).Contains(parameters.Purpose))
    {
        &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; inPeriodParams = &lt;span class="hljs-keyword"&gt;new&lt;/span&gt; ValueAFundParameters
        {
            FundId = parameters.FundId,
            ValuationDate = parameters.ValuationDate.GetPreviousValuationDate(parameters.Frequency),
            CreatedBy = parameters.CreatedBy,
            Purpose = ValuationPurpose.InPeriodCalculation,
            Frequency = parameters.Frequency,
            InvestmentIds = parameters.InvestmentIds,
            UseActiveCoefficientSet = &lt;span class="hljs-literal"&gt;true&lt;/span&gt;,
            UseAmericanDve = parameters.UseAmericanDve,
            ValuationOptions = parameters.ValuationOptions
        };

        &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; openingValuation = _valuationQueries.GetInPeriodOpeningValuation(inPeriodParams.FundId, inPeriodParams.ValuationDate, valuationId);

        &lt;span class="hljs-comment"&gt;//return openingValuation == null&lt;/span&gt;
        &lt;span class="hljs-comment"&gt;//       ? null&lt;/span&gt;
        &lt;span class="hljs-comment"&gt;//       : ValueAGPFund(openingValuation.Id, inPeriodParams, capitalAccount, lotId);&lt;/span&gt;
        &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; openingValuation == &lt;span class="hljs-literal"&gt;null&lt;/span&gt;
                ? ValueAGPFund(openingValuation.Id, inPeriodParams, capitalAccount, lotId)
                : &lt;span class="hljs-literal"&gt;null&lt;/span&gt;;
    }

    &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; &lt;span class="hljs-literal"&gt;null&lt;/span&gt;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This function checks the input parameters. Depending on the values, it will either return null, or it will call &lt;code&gt;ValueAGPFund&lt;/code&gt;. Wait a second, &lt;code&gt;ValueAGPFund&lt;/code&gt; calls this function. That&amp;#39;s not good.&lt;/p&gt;
&lt;p&gt;But let&amp;#39;s really focus in on the return statement and its comment:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;        &lt;span class="hljs-comment"&gt;//return openingValuation == null&lt;/span&gt;
        &lt;span class="hljs-comment"&gt;//       ? null&lt;/span&gt;
        &lt;span class="hljs-comment"&gt;//       : ValueAGPFund(openingValuation.Id, inPeriodParams, capitalAccount, lotId);&lt;/span&gt;
        &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; openingValuation == &lt;span class="hljs-literal"&gt;null&lt;/span&gt;
                ? ValueAGPFund(openingValuation.Id, inPeriodParams, capitalAccount, lotId)
                : &lt;span class="hljs-literal"&gt;null&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;em&gt;current&lt;/em&gt; version checks if &lt;code&gt;openingValuation&lt;/code&gt; is null, and if it is, tries to access it, thus triggering a &lt;code&gt;NullReferenceException&lt;/code&gt;. This function either returns &lt;code&gt;null&lt;/code&gt; or throws a &lt;code&gt;NullReferenceException&lt;/code&gt;. So all that worrying about side effects and circular calls doesn&amp;#39;t matter, but this likely isn&amp;#39;t correct. The comment indicates that there &lt;em&gt;used&lt;/em&gt; to be a correct version, which only called &lt;code&gt;ValueAGPFund&lt;/code&gt; if the valuation wasn&amp;#39;t null- but that version likely had all the problems of circular calls and unpredictable side effects.&lt;/p&gt;
&lt;p&gt;As it stands, the &lt;em&gt;application as a whole&lt;/em&gt; works. Since &lt;code&gt;CheckPreviousValuationIfRequired&lt;/code&gt; only ever returns null or throws an exception, and since &lt;code&gt;ValueAGPFund&lt;/code&gt; is only called from here, it &lt;em&gt;looks like&lt;/em&gt; these functions could just both be removed without problems. But our submitter is wary of doing that:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The problem is that I first need to figure out whether 1) this piece of code produces any side effects and 2) nobody is relying on the System.NullReferenceException being thrown here.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;No worries, though, right? I&amp;#39;m sure your unit tests will catch any regressions caused by removing that. Because this is the kind of code that definitely has great unit tests.&lt;/p&gt;
&lt;!-- Easy Reader Version: This is 100% a load bearing exception. Remove this and something will break. --&gt;
&lt;style&gt;.comment { border: none; }&lt;/style&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	ProGet’s got you covered with security and access controls on your NuGet feeds. &lt;a href="https://inedo.com/proget/private-nuget-server?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=GotYouCoveredFooter&amp;amp;utm_campaign=Cyclops2020"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>12</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/do-a-lot-to-do-nothing</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: When False is True</title><link>https://thedailywtf.com/articles/when-false-is-true</link><category>CodeSOD</category><pubDate>Mon, 22 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/when-false-is-true</guid><description>&lt;p&gt;&lt;strong&gt;Lillith&lt;/strong&gt; was integrating some new tools into an existing Ruby on Rails API. The existing API allowed you to send a &lt;code&gt;dry_run&lt;/code&gt; flag along with the request, so that you could have the service calculate its changes without applying them.&lt;/p&gt;
&lt;p&gt;The problem was, the new tool Lillith was integrating could send, in the body of the request, &lt;code&gt;{&amp;#34;dry_run&amp;#34;: false}&lt;/code&gt;, but the service would see it as true. Consistently.&lt;/p&gt;
&lt;p&gt;The helper method which checked for &amp;#34;true&amp;#34; parameters looked like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-ruby"&gt;&lt;span class="hljs-keyword"&gt;def&lt;/span&gt; &lt;span class="hljs-title function_"&gt;param_true?&lt;/span&gt;(&lt;span class="hljs-params"&gt;param_name&lt;/span&gt;)
  param_value = params[param_name]
  params.key?(param_name) &amp;amp;&amp;amp; (!param_value |&lt;span class="hljs-params"&gt;&lt;/span&gt;| param_value.to_s.downcase == &lt;span class="hljs-string"&gt;&amp;#39;true&amp;#39;&lt;/span&gt;)
&lt;span class="hljs-keyword"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The purpose of this function is to handle stringy or nil inputs gracefully. And there&amp;#39;s one thing I can say about the function: it will always identify a &lt;em&gt;true&lt;/em&gt; value correctly. If your false value is a string, &lt;code&gt;&amp;#34;false&amp;#34;&lt;/code&gt;, it also works. But that pesky &lt;code&gt;!param_value&lt;/code&gt; mean that any actual &lt;em&gt;boolean&lt;/em&gt; false value will be seen as true.&lt;/p&gt;
&lt;p&gt;This function has been in wide use through the application. Lillith&amp;#39;s best guess is that up to this point, no one had set the dry run flag on anything but &lt;code&gt;GET&lt;/code&gt; requests, where everything was strings. On &lt;code&gt;POST&lt;/code&gt;/&lt;code&gt;PATCH&lt;/code&gt;/&lt;code&gt;PUT&lt;/code&gt; requests, where the data was passed in the body as JSON, it got parsed into actual boolean values, and thus failed.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the WTF, certainly, that this function was lurking and waiting to cause this confusion. But the &lt;em&gt;annoying&lt;/em&gt; thing in this function is that it fetches the value from the associative array, &lt;em&gt;then&lt;/em&gt; calls &lt;code&gt;params.key?&lt;/code&gt; to see if the key exists. That&amp;#39;s &lt;em&gt;fine&lt;/em&gt;, since Ruby just returns a &lt;code&gt;nil&lt;/code&gt; if a key doesn&amp;#39;t exist, it&amp;#39;s just &lt;em&gt;annoying&lt;/em&gt;. I hate to see it. This is, admittedly, more of a &amp;#34;me&amp;#34; problem, but I hate it.&lt;/p&gt;
&lt;!-- Easy Reader Version: Functions like this shouldn't exist. You should just parse into the type you want to see, *then* evaluate for truth. This is always going to cause problems. --&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. &lt;a href="https://inedo.com/proget/private-nuget-server?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter&amp;amp;utm_campaign=Cyclops2020"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>7</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/when-false-is-true</wfw:comment></item><item><dc:creator>Lyle Seaman</dc:creator><title>Error'd: Microbits</title><link>https://thedailywtf.com/articles/microbits</link><category>Error'd</category><pubDate>Fri, 19 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/microbits</guid><description>&lt;p&gt;This week we have got a couple of Mathanon&amp;#39;s. Maybe they&amp;#39;re the same person, maybe they&amp;#39;re not, there&amp;#39;s really no way to know!&lt;/p&gt;

&lt;p&gt;Frist anon has a &amp;#34;Numeric fun fact&amp;#34; for us:
&amp;#34;Got a form sent from work to express interest in
some event. They actually enforced the validation that the answer
must be a number, so I submitted &amp;#34;42&amp;#34;.&amp;#34;  Bravo.
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#97007ddf5e024b1387e4f04fea560955"&gt;&lt;img itemprop="image" border="0" alt="97007ddf5e024b1387e4f04fea560955" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/18/97007ddf5e024b1387e4f04fea560955.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Next anon has a different numeric fun factor:
&amp;#34;&lt;a href="https://www.flysas.com/fi-en/travel-info/onboard/food-drinks?category=day-of-travel"&gt;
The SAS website&lt;/a&gt; wants us to know the size of the
file behind the link down to the nanobyte precision.&amp;#34; They split the bit! That must be what this quantum computing thing is about.
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#0a662a2420f54deab7167aa5e92a5bf3"&gt;&lt;img itemprop="image" border="0" alt="0a662a2420f54deab7167aa5e92a5bf3" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/18/0a662a2420f54deab7167aa5e92a5bf3.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Conscientious dad 
&lt;strong&gt;Mark R.&lt;/strong&gt; takes all the responsibilities.
&amp;#34;My kid&amp;#39;s school ensures they&amp;#39;re legally covered on all things
said and unsaid.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#55a99d3a5f5b4e588c8dd17063de6058"&gt;&lt;img itemprop="image" border="0" alt="55a99d3a5f5b4e588c8dd17063de6058" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/18/55a99d3a5f5b4e588c8dd17063de6058.jpeg"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;
&lt;strong&gt;Philipp H.&lt;/strong&gt; points out
&amp;#34;The Redmond philosophers have created something the old Greek philosophers
will have to rethink. Or is this a pun on Schrödinger&amp;#39;s Cat?
German→English translation: &amp;#34;We cannot bring/transfer/switch you to this message because
you&amp;#39;re in a chat, in which you&amp;#39;re not in.&amp;#34;&amp;#34;  
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#35d852325db54dbdbbe52fff86de5cc7"&gt;&lt;img itemprop="image" border="0" alt="35d852325db54dbdbbe52fff86de5cc7" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/18/35d852325db54dbdbbe52fff86de5cc7.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;We haven&amp;#39;t heard from 
&lt;strong&gt;Michael R.&lt;/strong&gt; in a while. Here he is with a pithy &amp;#34;The irony is not lost on me.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#a045bde3e7c94088ae041de113a1d58a"&gt;&lt;img itemprop="image" border="0" alt="a045bde3e7c94088ae041de113a1d58a" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/18/a045bde3e7c94088ae041de113a1d58a.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Happy Juneteenth to those who celebrate.&lt;/p&gt;
&lt;div&gt;
	[Advertisement] &lt;b&gt;Plan Your .NET 9 Migration with Confidence&lt;/b&gt;&lt;br/&gt;Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. &lt;b&gt;&lt;a href="https://inedo.com/support/whitepapers/dotnet-guide?utm_campaign=dotnet&amp;amp;utm_source=tdwtf-footer"&gt;Download Free Guide Now!&lt;/a&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;</description><slash:comments>23</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/microbits</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>Representative Line: Sort This Out</title><link>https://thedailywtf.com/articles/sort-this-out</link><category>Representative Line</category><pubDate>Thu, 18 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/sort-this-out</guid><description>&lt;p&gt;Today&amp;#39;s anonymous submitter has spent a long time toiling through many, many tickets. Their effort has been an attempt to &amp;#34;save&amp;#34; their employer from the disaster left behind by by a highly-paid consultant. As one does, our submitter started with the highest priority tickets with the highest severity. Eventually, they whittled down that list, and had some bandwidth to start looking at the pieces of the code which clearly weren&amp;#39;t &lt;em&gt;exploding right now&lt;/em&gt; (because there were no tickets), but were likely to explode at some point in the future (creating a storm of tickets).&lt;/p&gt;
&lt;p&gt;Scanning through the JavaScript, our submitter found a &lt;code&gt;sort&lt;/code&gt; function. That was automatically concerning- why was that particular wheel being reinvented?&lt;/p&gt;
&lt;p&gt;The first line of the sort function was this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-javascript"&gt;obj[x.&lt;span class="hljs-property"&gt;_id&lt;/span&gt;.&lt;span class="hljs-property"&gt;account_id&lt;/span&gt;] = x.&lt;span class="hljs-property"&gt;count_total&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this case, &lt;code&gt;x._id&lt;/code&gt; is meant to be the unique identifier from their Mongo DB. That, uh, should be not &lt;em&gt;precisely&lt;/em&gt; a UUID (Mongo does its own weird version), but it definitely shouldn&amp;#39;t have an &lt;code&gt;account_id&lt;/code&gt; field on it. They are storing an arbitrary object &lt;em&gt;as&lt;/em&gt; their unique identifier in the database. Which, I&amp;#39;m no Mongo expert, but I don&amp;#39;t need to be Flash Gordon to know that&amp;#39;s a bad idea. &lt;!-- Yes, I recognize that Flash is not, at least at the start of his tale, a Mongo expert either, but he's a serial character who lives there for a long time and eventually does become an expert. Or at the very least, in the 1980 film, becomes enough of an expert to thwart Ming and return home. --&gt;&lt;/p&gt;
&lt;p&gt;But setting aside the choice of using random objects as unique identifiers, there&amp;#39;s also the other question: how is this furthering the goal of sorting? Why on Earth am I building an object in the form: &lt;code&gt;{&amp;#34;id0&amp;#34;: 5, &amp;#34;id1&amp;#34;: 7, &amp;#34;id2&amp;#34;: 11}&lt;/code&gt;? Or am I even doing that? This is the first line of the function, so we&amp;#39;re not even doing a loop, it&amp;#39;s just &lt;code&gt;{&amp;#34;id0&amp;#34;: 5}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This isn&amp;#39;t just an unexploded bomb, it&amp;#39;s a mystery: the primary mystery being &lt;em&gt;why hasn&amp;#39;t this exploded already&lt;/em&gt;? The second mystery is: what&amp;#39;s going to happen when your luck runs out?&lt;/p&gt;
&lt;!-- Easy Reader Version: FLASH! AH HAAAAAAAAAAA! SAVIOR OF THE UNIVERSE! --&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	ProGet’s got you covered with security and access controls on your NuGet feeds. &lt;a href="https://inedo.com/proget/private-nuget-server?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=GotYouCoveredFooter&amp;amp;utm_campaign=Cyclops2020"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>8</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/sort-this-out</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Weekly Calculated</title><link>https://thedailywtf.com/articles/weekly-calculated</link><category>CodeSOD</category><pubDate>Wed, 17 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/weekly-calculated</guid><description>&lt;p&gt;There&amp;#39;s a language out there called &amp;#34;Progress Advanced Business Language&amp;#34; (or &amp;#34;Open Edge Advanced Business Language&amp;#34;). Just hearing that string of words in a sequence tells you you&amp;#39;re in for it. It&amp;#39;s a verbose, &amp;#34;English-like&amp;#34; programming language. But we&amp;#39;re not here to pick on the language.&lt;/p&gt;
&lt;p&gt;A long time ago, &lt;strong&gt;Mirjam&lt;/strong&gt; had the &amp;#34;pleasure&amp;#34; of working in a Progress ABL environment. At some point, one of the developers had needed to find a date six months prior to the current date. It didn&amp;#39;t need to be accurate, and thus said developer littered the code with comments reminding everyone that it didn&amp;#39;t need to be that accurate. They arguably spent more time defending the choice to be inaccurate than it would have taken to write code that would have been accurate.&lt;/p&gt;
&lt;p&gt;Mirjam doesn&amp;#39;t have the code anymore, so what we have here is a mix of her remembered pseudocode, Progress syntax, and my attempts to clarify all of it. Let&amp;#39;s not worry too much about the language, and instead focus on the logic:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-progress"&gt;ASSIGN v-date = TODAY.

/* Calculates the current week/year */
RUN week.p(INPUT v-date, OUTPUT v-weeknumber, OUTPUT v-year).

IF v-weeknumber &amp;gt; 26 THEN 
    ASSIGN v-weeknumber = v-weeknumber - 26.
ELSE 
    ASSIGN v-weeknumber = 52 - 26 - v-weeknumber
           v-year       = v-year - 1.

/* Turn the result of that calculation back into a date */
RUN week2.p(INPUT v-weeknumber, INPUT v-year, OUTPUT v-resultdate).
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This code gets the current date. It then breaks that into week number of the date (1-52), and the year of the date. Then, if the week number is greater than 26, it subtracts 26 from it, giving us a date half a year ago, ish. If the current weak number is less than or equal to 26, we do &lt;code&gt;52 - 26 - v-weeknumber&lt;/code&gt;, and decrement the year. Which yes, is a fairly round about way to handle the rollover- &lt;code&gt;52 - 26&lt;/code&gt; happens to be… &lt;code&gt;26&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s worth noting, that as primitive looking as this syntax is, Progress ABL does have an &lt;code&gt;ADD_INTERVAL&lt;/code&gt; function, which lets you do date arithmetic, without all this nonsense. In fact, Mirjam went ahead and replaced all of this with a single line.&lt;/p&gt;
&lt;p&gt;That said, as a little bonus WTF, &lt;a href="https://docs.progress.com/bundle/abl-reference/page/DATE-function.html"&gt;Progress does have some weird date quirks&lt;/a&gt;, for example, you can construct a date from an integer. Which has a very &lt;em&gt;unsurprising&lt;/em&gt; (but also, weirdly surprising) range of possible values:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The value of the expression cannot be a date value before 12/31/-32768 or after 12/31/32767.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;At least that covers a range that includes both the discovery of agriculture &lt;em&gt;and&lt;/em&gt; the eventual rediscovery of agriculture after the event that enters into legend as &amp;#34;The Fall&amp;#34;.&lt;/p&gt;
&lt;!-- Easy Reader Version: It also includes the date of human extinction, but obviously isn't long enough to account for our eventual replacement by creatures descended from marmosets --&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.&lt;a href="https://inedo.com/proget?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>51</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/weekly-calculated</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Required Fields</title><link>https://thedailywtf.com/articles/required-fields</link><category>CodeSOD</category><pubDate>Tue, 16 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/required-fields</guid><description>&lt;p&gt;If you want to connect to another system, you need to supply credentials. That&amp;#39;s a pretty obvious requirement. We can set aside the whole technical challenge of managing those credentials and the security problems various techniques create, and just focus in on: you must supply some credentials to authenticate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lisa&lt;/strong&gt; has inherited a method which connects to another system. It, correctly, will complain if you don&amp;#39;t supply parameters for credentials. It will, incorrectly, mislead you about their requirement:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-php"&gt;&lt;span class="hljs-keyword"&gt;public&lt;/span&gt; &lt;span class="hljs-function"&gt;&lt;span class="hljs-keyword"&gt;function&lt;/span&gt; &lt;span class="hljs-title"&gt;connect&lt;/span&gt;(&lt;span class="hljs-params"&gt;&lt;span class="hljs-keyword"&gt;string&lt;/span&gt; &lt;span class="hljs-variable"&gt;$username&lt;/span&gt; = &lt;span class="hljs-string"&gt;&amp;#34;&amp;#34;&lt;/span&gt;, &lt;span class="hljs-keyword"&gt;string&lt;/span&gt; &lt;span class="hljs-variable"&gt;$password&lt;/span&gt; = &lt;span class="hljs-string"&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;/span&gt;): &lt;span class="hljs-title"&gt;void&lt;/span&gt;
&lt;/span&gt;{
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (&lt;span class="hljs-variable"&gt;$username&lt;/span&gt; === &lt;span class="hljs-string"&gt;&amp;#34;&amp;#34;&lt;/span&gt;) {
        &lt;span class="hljs-keyword"&gt;throw&lt;/span&gt; &lt;span class="hljs-keyword"&gt;new&lt;/span&gt; &lt;span class="hljs-built_in"&gt;InvalidArgumentException&lt;/span&gt;(&lt;span class="hljs-string"&gt;&amp;#34;username is required.&amp;#34;&lt;/span&gt;);
    }
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (&lt;span class="hljs-variable"&gt;$password&lt;/span&gt; === &lt;span class="hljs-string"&gt;&amp;#34;&amp;#34;&lt;/span&gt;) {
        &lt;span class="hljs-keyword"&gt;throw&lt;/span&gt; &lt;span class="hljs-keyword"&gt;new&lt;/span&gt; &lt;span class="hljs-built_in"&gt;InvalidArgumentException&lt;/span&gt;(&lt;span class="hljs-string"&gt;&amp;#34;username is required.&amp;#34;&lt;/span&gt;);
    }
    &lt;span class="hljs-comment"&gt;// ... other stuff&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;$username&lt;/code&gt; and &lt;code&gt;$password&lt;/code&gt; fields here are set to default values. Which means it is syntactically valid to invoke the function &lt;code&gt;connect()&lt;/code&gt;. It won&amp;#39;t work if you do that, as it will definitely throw an exception, but this is a bit of misleading ergonomics. If the parameters are required, they should probably, I don&amp;#39;t know, &lt;em&gt;be required&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;What really draws our attention here, however, is not the misuse of default parameters, but the absolute disaster that debugging issues with this function could easily become. If you fail to enter a username, you&amp;#39;ll get an exception telling you &amp;#34;username is required&amp;#34;. And if you fail to enter a password, you&amp;#39;ll &lt;em&gt;also&lt;/em&gt; get an error message telling you &amp;#34;username is required&amp;#34;.&lt;/p&gt;
&lt;p&gt;Which is a factually true statement: username is required. But it&amp;#39;s not the cause of my error, which is that I failed to supply the password. Theoretically, though, we could adopt this to make writing exception messages easier. I could make &lt;em&gt;every&lt;/em&gt; exception message be &amp;#34;username is required&amp;#34;, and it wouldn&amp;#39;t be wrong. And clearly, that&amp;#39;s what we truly mean when we say &amp;#34;not even wrong&amp;#34;.&lt;/p&gt;
&lt;!-- Easy Reader Version: username remains required --&gt;
&lt;style&gt;.comment { border: none; }&lt;/style&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.&lt;a href="https://inedo.com/proget?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>23</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/required-fields</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Caught a Mistake</title><link>https://thedailywtf.com/articles/caught-a-mistake</link><category>CodeSOD</category><pubDate>Mon, 15 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/caught-a-mistake</guid><description>&lt;p&gt;&lt;strong&gt;Daniel&lt;/strong&gt; recently started a new job. His first task was to fetch some data from the database and render it to the user. Easy enough, and there were already wrapper functions around the database to make it easy. He called &lt;code&gt;execute_read&lt;/code&gt;, passed it a query, and checked the results.&lt;/p&gt;
&lt;p&gt;There were no results. But the query definitely should have returned results. What was going on?&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-python"&gt;&lt;span class="hljs-keyword"&gt;def&lt;/span&gt; &lt;span class="hljs-title function_"&gt;execute_read&lt;/span&gt;(&lt;span class="hljs-params"&gt;conn, query, params, only_one=&lt;span class="hljs-literal"&gt;False&lt;/span&gt;&lt;/span&gt;):
    result = &lt;span class="hljs-literal"&gt;None&lt;/span&gt;
    cursor = &lt;span class="hljs-literal"&gt;None&lt;/span&gt;
    &lt;span class="hljs-keyword"&gt;try&lt;/span&gt;:
        start_time = time.time()
        cursor = conn.cursor()
        cursor.execute(query, params)

        &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; only_one:
            result = cursor.fetchone()
        &lt;span class="hljs-keyword"&gt;else&lt;/span&gt;:
            result = cursor.fetchall()

        end_time = time.time()
        time_taken = end_time - start_time

        &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; env.is_production():
            &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; time_taken &amp;gt; &lt;span class="hljs-number"&gt;0.4&lt;/span&gt;:
                logger.critical(&lt;span class="hljs-string"&gt;&amp;#34;long query&amp;#34;&lt;/span&gt;, query=query, time_taken=time_taken)
        &lt;span class="hljs-keyword"&gt;else&lt;/span&gt;:
            &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; time_taken &amp;gt; &lt;span class="hljs-number"&gt;0.2&lt;/span&gt;:
                logger.warning(&lt;span class="hljs-string"&gt;&amp;#34;long query&amp;#34;&lt;/span&gt;, query=query, time_taken=time_taken)

    &lt;span class="hljs-keyword"&gt;except&lt;/span&gt; Exception &lt;span class="hljs-keyword"&gt;as&lt;/span&gt; err:  &lt;span class="hljs-comment"&gt;# pragma: no cover&lt;/span&gt;
        logger.exception(&lt;span class="hljs-string"&gt;&amp;#34;execute_read exception&amp;#34;&lt;/span&gt;, exception_msg=err, query=query)

    &lt;span class="hljs-keyword"&gt;finally&lt;/span&gt;:
        logger.debug(&lt;span class="hljs-string"&gt;&amp;#34;execute_read debug&amp;#34;&lt;/span&gt;, query=query, params=params, only_one=only_one)
        &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; &lt;span class="hljs-keyword"&gt;not&lt;/span&gt; result:
            &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; only_one:
                result = {}
            &lt;span class="hljs-keyword"&gt;else&lt;/span&gt;:
                result = []
        &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; cursor:
            cursor.close()

    &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; result
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There are a &lt;em&gt;lot&lt;/em&gt; of things I don&amp;#39;t like about this function. The &lt;code&gt;only_one&lt;/code&gt; parameter, for starters. Note how the database library actually breaks that behavior out as different functions- that&amp;#39;s a much more appropriate model, especially since you have wildly different return types depending on how that flag is set.&lt;/p&gt;
&lt;p&gt;Similarly, checking &lt;code&gt;env.is_production()&lt;/code&gt; to check a timing threshold is itself pretty awful. I can sympathize with wanting different timing constraints based on what environment you&amp;#39;re in- but if that&amp;#39;s the case, the &lt;em&gt;timing constraint&lt;/em&gt; is the parameter. &lt;code&gt;env.long_query_threshold&lt;/code&gt; should be the configuration parameter. Also, your database should be able to alert you to these kinds of things, so that it doesn&amp;#39;t live in your code anyway.&lt;/p&gt;
&lt;p&gt;But the WTF here is the promiscuous exception handler, which catches all errors and simply logs them. This created a situation where Daniel sent a query to the database and got no results. He didn&amp;#39;t go straight to the logs and tried to debug it more directly, so it took him quite some time to find the &lt;code&gt;execute_read exception&lt;/code&gt; log line which told him what was wrong: his SQL query had a syntax error.&lt;/p&gt;
&lt;p&gt;Daniel writes: &amp;#34;I can&amp;#39;t imagine the disaster that this causes if there&amp;#39;s a network hiccup in production.&amp;#34; Failing silently and returning empty results sets &lt;em&gt;definitely&lt;/em&gt; is inviting a lot of confusion.&lt;/p&gt;
&lt;!-- Easy Reader Version: I once met someone who just caught all exceptions because it meant "my program will never crash" --&gt;
&lt;style&gt;.comment { border: none; }&lt;/style&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.&lt;a href="https://inedo.com/proget?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>12</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/caught-a-mistake</wfw:comment></item><item><dc:creator>Lyle Seaman</dc:creator><title>Error'd:  No Rush</title><link>https://thedailywtf.com/articles/no-rush</link><category>Error'd</category><pubDate>Fri, 12 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/no-rush</guid><description>&lt;p&gt;This week, friend 
&lt;strong&gt;Adam R.&lt;/strong&gt; sent in an entry and included with it a link to a short-form YouTube video. Presumably this was a mistake, because I watched that video and the next one and the next one and the next one and after two hours I still haven&amp;#39;t got this column ready. I won&amp;#39;t share the video link with you. You&amp;#39;re welcome.
&lt;/p&gt;

&lt;p&gt;What Adam &lt;em&gt;really&lt;/em&gt; wanted to say was: 
&amp;#34;The USPS offers a sincerely service called Informed Delivery that,
every morning, emails you scans of the exterior of your
postal mail that you&amp;#39;re expected to receive that day, which
is a genuinely useful service (#not-sponsored). In today&amp;#39;s digest, however,
the subject line had an extra None thrown in there.
Some Python script gone wrong that wasn&amp;#39;t tested before production,
perhaps?&amp;#34;  We get lots of NaN, null, and undefined submissions, but None are actually rare. 
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#1b83568aee6945e79583f845c9c25d80"&gt;&lt;img itemprop="image" border="0" alt="1b83568aee6945e79583f845c9c25d80" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/11/1b83568aee6945e79583f845c9c25d80.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;
&lt;strong&gt;Carlos&lt;/strong&gt; sent us a fresh email, reporting
&amp;#34;Mint Mobile hit the jackpot but
their template engine didn&amp;#39;t.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#1866069ff694449e92574129d7315e0a"&gt;&lt;img itemprop="image" border="0" alt="1866069ff694449e92574129d7315e0a" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/11/1866069ff694449e92574129d7315e0a.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;&amp;#34;No Rush&amp;#34; stated 
&lt;strong&gt;Robert F.&lt;/strong&gt; calmly.
&amp;#34;My Carbonite backup files will be deleted in 11250001 days
if I don&amp;#39;t reconnect the drive. Well, there&amp;#39;s no rush,
really. They have given me 30,822 years to reconnect it.
(It was never disconnected in the first place!)&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#72788c6d3e3944a7b6cf6aa056ed4c3a"&gt;&lt;img itemprop="image" border="0" alt="72788c6d3e3944a7b6cf6aa056ed4c3a" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/11/72788c6d3e3944a7b6cf6aa056ed4c3a.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&amp;#34;Roosting indeed&amp;#34; harumphs 
&lt;strong&gt;The Beast in Black&lt;/strong&gt;.
&amp;#34;Somebody should tell Claude Code that it keeps using that
word but I do not think it means what it
thinks it means. On the other hand, considering how sssllllllooooooowwww
it usually is, perhaps this is honesty.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#7a4c719bb94a4c66843d2a548b93de1e"&gt;&lt;img itemprop="image" border="0" alt="7a4c719bb94a4c66843d2a548b93de1e" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/11/7a4c719bb94a4c66843d2a548b93de1e.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;
&lt;strong&gt;Peter S.&lt;/strong&gt; has been driven to madness by Sixt, right along with me.
&amp;#34;Now that I am silver, Sixt&amp;#39;s top offer is to
fill all mandatory fields in their data extension. I wonder
what gold gives me.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#f4936743eb534c85804e190ef3b5a37c"&gt;&lt;img itemprop="image" border="0" alt="f4936743eb534c85804e190ef3b5a37c" src="https://d3hvi6t161kfmf.cloudfront.net/images/2026/06/11/f4936743eb534c85804e190ef3b5a37c.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.&lt;a href="https://inedo.com/proget?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>18</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/no-rush</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Dating in Hungarian</title><link>https://thedailywtf.com/articles/dating-in-hungarian</link><category>CodeSOD</category><pubDate>Thu, 11 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/dating-in-hungarian</guid><description>&lt;p&gt;A horse can only be so tenderized, but as well established at this point: I don&amp;#39;t like Hungarian Notation. &lt;strong&gt;Richard G&lt;/strong&gt; sends us an example of yet more of it, being misused, as well as some bad date handling. That&amp;#39;s basically two of the easiest things to complain about, so let&amp;#39;s take a look!&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;DateTime sCDate2 = Convert.ToDateTime(Hdn_SelectedDate.Value);
Double dStart2 = &lt;span class="hljs-built_in"&gt;double&lt;/span&gt;.Parse(Hdn_SelectedShifts.Value.Split(&lt;span class="hljs-string"&gt;&amp;#39;@&amp;#39;&lt;/span&gt;)[&lt;span class="hljs-number"&gt;0&lt;/span&gt;]); &lt;span class="hljs-comment"&gt;// Gets something like &amp;#34;10.5&amp;#34; for 10:30&lt;/span&gt;

&lt;span class="hljs-comment"&gt;// More code ...&lt;/span&gt;

DateTime lSelectedStartAdd = DateTime.Parse(sCDate2.ToShortDateString() + &lt;span class="hljs-string"&gt;&amp;#34; &amp;#34;&lt;/span&gt; + DateTime.FromOADate((dStart2) / &lt;span class="hljs-number"&gt;24&lt;/span&gt;).ToShortTimeString());
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We take the value of &lt;code&gt;Hdn_SelectedDate&lt;/code&gt;, which is &lt;em&gt;one case&lt;/em&gt; where I&amp;#39;m actually willing to be a bit flexible on my hate of Hungarian Notation. In this case, it tells us that this is a &amp;#34;hidden&amp;#34; field on an ASP .Net form. Of course, storing a bunch of data in hidden fields on your form is a dangerous pattern, and in this case, they&amp;#39;re carrying between 30 and 50 different pieces of data from one page to the next as hidden fields.&lt;/p&gt;
&lt;p&gt;In any case, we take the value of that field and convert it to a datetime, storing the result in &lt;code&gt;sCDate2&lt;/code&gt;. Here, the questions start. &lt;code&gt;s&lt;/code&gt;, conventionally, tells us that this is a string. But it is not a string, it is a date. Why is it &lt;code&gt;CDate&lt;/code&gt;? Actually, why is it &lt;code&gt;CDate2&lt;/code&gt;? What&amp;#39;s so &lt;code&gt;2&lt;/code&gt; about this? There is no &lt;code&gt;sCDate&lt;/code&gt;, &lt;code&gt;sCDate1&lt;/code&gt;, or any other variation thereof- why &lt;code&gt;2&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;Then, we look the contents of &lt;code&gt;Hdn_SelectedShifts&lt;/code&gt;. This is another hidden field, and this one stores a string that is delimited by &lt;code&gt;@&lt;/code&gt;s. We take the first element, which represents a time of day- &lt;em&gt;as a double&lt;/em&gt;. &lt;code&gt;10.5&lt;/code&gt; means &lt;code&gt;10:30&lt;/code&gt;. That&amp;#39;s certainly a way to represent a time of day.&lt;/p&gt;
&lt;p&gt;With this data in hand, we then use this to populate the &lt;code&gt;lSelectedStartAdd&lt;/code&gt; variable. Once again, the &lt;code&gt;l&lt;/code&gt; exists to mystify us. In some Hungarian flavors, it could mean &amp;#34;local variable&amp;#34;, but if that&amp;#39;s the case, why aren&amp;#39;t we using that for any of the other local variables? More commonly, it might mean &amp;#34;long integer&amp;#34;, but once again: it&amp;#39;s a date.&lt;/p&gt;
&lt;p&gt;This all brings us to &lt;code&gt;DateTime.FromOADate&lt;/code&gt;. No, this is not when you Netflix and chill while watching &lt;a href="https://en.wikipedia.org/wiki/The_OA"&gt;cheap streaming sci-fi&lt;/a&gt;, OA in this case stands for OLE Automation, and now we have to go down a rabbit hole which has nothing to do with any of this code.&lt;/p&gt;
&lt;p&gt;One of the things which made Windows what it was was the use of COM; the Component Object Model was an object oriented approach for letting applications talk to each other. It&amp;#39;s what gave us &lt;a href="https://en.wikipedia.org/wiki/DLL_hell"&gt;DLL Hell&lt;/a&gt;, but it was also a really powerful system for automating software. You could use Visual Basic to leverage COM libraries provided by other software; even if the software you were targeting didn&amp;#39;t have a scripting system, you could write your own scripts to control it anyway. OLE, Object Linking and Embedding, was a subset of all the COM functionality. It replaced Dynamic Data Exchange, which was the &lt;em&gt;previous&lt;/em&gt; way of automating applications. With COM, COM+, DCOM, DDE, OLE, Microsoft created a whole soup of ways to link to functionality exposed by other applications. It was a giant mess, and I just put this paragraph here to flashback on the horrors of that era.&lt;/p&gt;
&lt;p&gt;In any case, because OLE was mostly about automating Office applications, and because of Remy&amp;#39;s Law of Requirements (no matter what the users said they want, what they really want is Excel), OLE Automation has its own date data type, which is a floating point number measuring the offset from December 30th, 1899. Which, of course, is not Excel&amp;#39;s date epoch: Excel starts at 31-DEC-1899. &lt;em&gt;Except&lt;/em&gt; Excel inherited its epoch from an older spreadsheet tool, Lotus 1-2-3. And Lotus had a bug: it thought 1900 was a leap year. Which means &lt;em&gt;in practice&lt;/em&gt;, for any date past 28-FEB-1900, the &lt;em&gt;effective&lt;/em&gt; epoch is 30-DEC-1899. Excel intentionally recreated the bug, because it needed to be compatible with Lotus 1-2-3 if it had any hope of competing in the market. One pesky little detail and now 1900 is a de facto leap year.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, we&amp;#39;ve got afield. We have &lt;code&gt;dStart2&lt;/code&gt;, which is a floating point number representing hours in the day, with minutes as the fraction. We divide that by 24, then pass it to &lt;code&gt;FromOADate&lt;/code&gt;, which will now treat that as an offset from 30-DEC-1899 00:00:00, giving us a date like 30-DEC-1899 10:30:00. We grab the time string off that, the date string of four date, munge them together and parse it back to a date.&lt;/p&gt;
&lt;p&gt;Of course, the C# DateTime type has an &lt;code&gt;AddHours&lt;/code&gt;, so they could have just done &lt;code&gt;scDate2.AddHours(dStart2)&lt;/code&gt; and skipped all the parsing.&lt;/p&gt;
&lt;p&gt;You want to know something more fun about this? That floating point representing time? It&amp;#39;s initially populated by having users select off a drop down, and the drop down uses as its labels the more conventional &lt;code&gt;HH:mm&lt;/code&gt; format. The &lt;em&gt;value&lt;/em&gt; stored by the drop down is the floating point value. And yes, someone did manually write all that out in the code, they didn&amp;#39;t use a loop or anything.&lt;/p&gt;
&lt;p&gt;In any case, this is a long winded reminder: I hate Hungarian Notation.&lt;/p&gt;
&lt;!-- Easy Reader Version: Obligatory XKCD: https://www.explainxkcd.com/wiki/index.php/2676:_Historical_Dates --&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.&lt;a href="https://inedo.com/proget?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=PlebsFooter"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>27</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/dating-in-hungarian</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Delicious Fudge</title><link>https://thedailywtf.com/articles/delicious-fudge</link><category>CodeSOD</category><pubDate>Wed, 10 Jun 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/delicious-fudge</guid><description>&lt;p&gt;&lt;strong&gt;Stella&lt;/strong&gt; (&lt;a href="https://thedailywtf.com/articles/a-dumbain-specific-language"&gt;previously&lt;/a&gt;) sends us a much elided snippet. The original code is several thousand lines contained in a single &lt;code&gt;try&lt;/code&gt; block. But the WTF is pretty clear without seeing all of that:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-python"&gt;&lt;span class="hljs-keyword"&gt;try&lt;/span&gt;:
  &lt;span class="hljs-comment"&gt;# the whole business logic without any exception handling&lt;/span&gt;
&lt;span class="hljs-keyword"&gt;except&lt;/span&gt;:
  &lt;span class="hljs-built_in"&gt;print&lt;/span&gt;(&lt;span class="hljs-string"&gt;&amp;#34;Fudge&amp;#34;&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=11q4q3S57jE&amp;amp;pp=ygUZZXhjZXB0IEkgZGlkbid0IHNheSBmdWRnZQ%3D%3D"&gt;They didn&amp;#39;t really say fudge&lt;/a&gt; of course, but we mostly try to keep profanity off our main page. Mostly. In any case, when your operation fails someplace in the middle and you have no idea where, why, or how: &amp;#34;Oh, fudge!&amp;#34; is the appropriate expression.&lt;/p&gt;
&lt;!-- Easy Reader Version: If you don't live in the US, it's hard to explain how inescapable A Christmas Story was growing up. --&gt;&lt;div&gt;
	&lt;img src="https://thedailywtf.com/images/inedo/proget-icon.png" style="display:block; float: left; margin: 0 10px 10px 0;"/&gt; [Advertisement] 
	ProGet’s got you covered with security and access controls on your NuGet feeds. &lt;a href="https://inedo.com/proget/private-nuget-server?utm_source=tdwtf&amp;amp;utm_medium=footer&amp;amp;utm_content=GotYouCoveredFooter&amp;amp;utm_campaign=Cyclops2020"&gt;Learn more.&lt;/a&gt;
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>11</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/delicious-fudge</wfw:comment></item></channel></rss>