<?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>Mon, 09 Mar 2026 23:32:31 GMT</lastBuildDate><item><dc:creator>Ellis Morning</dc:creator><title>Anti-Simplification</title><link>https://thedailywtf.com/articles/anti-simplification</link><category>Feature Articles</category><pubDate>Mon, 09 Mar 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/anti-simplification</guid><description>&lt;p&gt;Our &lt;b&gt;anonymous&lt;/b&gt; submitter relates a tale of simplification gone bad. As this nightmare unfolds, imagine the scenario of a new developer coming aboard at this company. Imagine being the one who has to explain this setup to said newcomer.&lt;/p&gt;

&lt;p&gt;Imagine being the newcomer who inherits it.&lt;/p&gt;

&lt;p style="float:right; padding-left:10px; padding-bottom:10px;"&gt;&lt;a title="Robert Storm Petersen, Public domain, via Wikimedia Commons" href="https://commons.wikimedia.org/wiki/File:Storm_P-maskine.jpg"&gt;&lt;img itemprop="image" width="300" alt="A &amp;#34;Storm P machine&amp;#34; - the Danish equivalent of a Rube Goldberg machine." src="https://upload.wikimedia.org/wikipedia/commons/b/b8/Storm_P-maskine.jpg?_=20240915102329"/&gt;&lt;/a&gt;&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;David&amp;#39;s job should have been an easy one. His company&amp;#39;s sales data was stored in a database, and every day the reporting system would query a SQL view to get the numbers for the daily key performance indicators (KPIs). Until the company&amp;#39;s CTO, who was proudly self-taught, decided that SQL views are hard to maintain, and the system should get the data from one of those new-fangled APIs instead.&lt;/p&gt;

&lt;p&gt;But how does one call an API? The reporting system didn&amp;#39;t have that option, so the logical choice was Azure Data Factory to call the API, then output the data to a file that the reporting system could read. The only issue was that nobody on the team spoke Azure Data Factory, or for that matter SQL. But no problem, one of David&amp;#39;s colleagues assured, they could do all the work in the best and most multifunctional language ever: C#.&lt;/p&gt;

&lt;p&gt;But you can&amp;#39;t just write C# in a data factory directly, that would be silly. What you &lt;i&gt;can&lt;/i&gt; do is have the data factory pipeline call an Azure function, which calls a DLL that contains the bytecode from C#. Oh, and a scheduler outside of the data factory to run the pipeline. To read multiple tables, the pipeline calls a separate function for each table. Each function would be based on a separate source project in C#, with 3 classes each for the HTTP header, content, and response; and a separate factory class for each of the &lt;em&gt;actual&lt;/em&gt; classes.&lt;/p&gt;

&lt;p&gt;After all, each table had a different set of columns, so you can&amp;#39;t just re-use classes for that.&lt;/p&gt;

&lt;p&gt;There was one little issue: the reporting system required an XML file, whereas the API would export data in JSON. It would be silly to expect a data factory, of all things, to convert this. So the CTO&amp;#39;s solution was to have another C# program (in a DLL called by a function from a pipeline from an external scheduler) that reads the JSON document saved by the earlier program, uses &lt;code&gt;foreach&lt;/code&gt; to go over each element, then saves the result as XML. A distinct program for each table, of course, requiring distinct classes for header, content, response, and factories thereof.&lt;/p&gt;

&lt;p&gt;Now here&amp;#39;s the genius part: to the C# class representing the output data, David&amp;#39;s colleague decided to attach one different object for each input table required. The data class would use reflection to iterate over the attached objects, and for each object, use a big &lt;code&gt;switch&lt;/code&gt; block to decide which source file to read. This allows the data class to perform joins and calculations before saving to XML.&lt;/p&gt;

&lt;p&gt;To make testing easier, each calculation would be a separate function call. For example, calculating a customer&amp;#39;s age was a function taking struct &lt;code&gt;CustomerWithBirthDate&lt;/code&gt; as input, use a &lt;code&gt;foreach&lt;/code&gt; loop to copy all the data except replacing one field, and return a &lt;code&gt;CustomerWithAge&lt;/code&gt; struct to pass to the next function. The code performed a bit slowly, but that was an issue for a later year.&lt;/p&gt;

&lt;p&gt;So basically, the scheduler calls the data factory, which calls a set of Azure functions, which call a C# function, which calls a set of factory classes to call the API and write the data to a text file. Then, the second scheduler calls a data factory, which calls Azure functions, which call C#, which calls reflection to check attachment classes, which read the text files, then call a series of functions for each join or calculation, then call another set of factory classes to write the data to an XML file, then call the reporting system to update.&lt;/p&gt;

&lt;p&gt;Easy as pie, right? So where David&amp;#39;s job could have been maintaining a couple hundred lines of SQL views, he instead inherited some 50,000 lines of heavily-duplicated C# code, where adding a new table to the process would easily take a month.&lt;/p&gt;

&lt;p&gt;Or as the song goes, &lt;i&gt;Somebody Told Me the User Provider should use an Adaptor to Proxy the Query Factory Builder ...&lt;/i&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] 
	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>10</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/anti-simplification</wfw:comment></item><item><dc:creator>Lyle Seaman</dc:creator><title>Error'd: That's What I Want</title><link>https://thedailywtf.com/articles/that-s-what-i-want</link><category>Error'd</category><pubDate>Fri, 06 Mar 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/that-s-what-i-want</guid><description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt; First up with the money quote, 
&lt;strong&gt;Peter G.
&lt;/strong&gt; remarks 
&amp;#34;Hi first_name euro euro euro, look how professional our marketing services are!
&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#1"&gt;&lt;img itemprop="image" border="0" alt="1" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/314/form_letter.jpeg"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&amp;#34;It takes real talent to mispell error&amp;#34; jokes
&lt;strong&gt;Mike S.
&lt;/strong&gt; They must have done it on purpose.
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#0"&gt;&lt;img itemprop="image" border="0" alt="0" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/314/erorr.jpeg"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I long wondered where the TikTok profits came from, and now I know. It&amp;#39;s 
&lt;strong&gt;Daniel D.
&lt;/strong&gt;
&amp;#34;I had issues with some incorrectly documented TikTok Commercial Content API endpoints. So I reached out to the support. I was delighted to know that it worked and my reference number was .

PS: 7 days later I still have not been contacted by anyone from TikTok. You can see their support is also .
&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#2"&gt;&lt;img itemprop="image" border="0" alt="2" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/314/tiktok.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Fortune favors the prepared, and 
&lt;strong&gt;Michael R.
&lt;/strong&gt; is very fortunate. 
&amp;#34;I know us Germans are known for planning ahead so enjoy the training on Friday, February 2nd &lt;em&gt;2029&lt;/em&gt;. 
&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#3"&gt;&lt;img itemprop="image" border="0" alt="3" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/314/pretix.jpeg"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Someone other than dragoncoder047 might have shared this earlier, but this time 
&lt;strong&gt;dragoncoder047
&lt;/strong&gt; definitely did.  
&amp;#34;Digital Extremes (the developers of Warframe) were making many announcements of problems with the new update that rolled out today [February 11]. They didn’t mention this one!&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#4"&gt;&lt;img itemprop="image" border="0" alt="4" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/314/img_1331.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;div&gt;
	[Advertisement] Picking up &lt;b&gt;NuGet&lt;/b&gt; is easy. Getting good at it takes time. &lt;a href="https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf&amp;amp;utm_medium=Footerad&amp;amp;utm_campaign=nuget"&gt;Download our guide to learn the best practice of NuGet for the Enterprise.&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/that-s-what-i-want</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Qaudruple Negative</title><link>https://thedailywtf.com/articles/qaudruple-negative</link><category>CodeSOD</category><pubDate>Thu, 05 Mar 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/qaudruple-negative</guid><description>&lt;p&gt;We mostly don&amp;#39;t pick on bad SQL queries here, because &lt;em&gt;mostly&lt;/em&gt; the query optimizer is going to fix whatever is wrong, and the sad reality is that databases are hard to change once they&amp;#39;re running; &lt;em&gt;especially&lt;/em&gt; legacy databases. But sometimes the code is just so hamster-bowling-backwards that it&amp;#39;s worth looking into.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Jim J&lt;/strong&gt; has been working on a codebase for about 18 months. It&amp;#39;s a big, sprawling, messy project, and it has code like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-sql"&gt;&lt;span class="hljs-keyword"&gt;AND&lt;/span&gt; &lt;span class="hljs-keyword"&gt;CASE&lt;/span&gt; &lt;span class="hljs-keyword"&gt;WHEN&lt;/span&gt; &lt;span class="hljs-variable"&gt;@c&lt;/span&gt;_usergroup &lt;span class="hljs-operator"&gt;=&lt;/span&gt; &lt;span class="hljs-number"&gt;50&lt;/span&gt; &lt;span class="hljs-keyword"&gt;AND&lt;/span&gt; &lt;span class="hljs-keyword"&gt;NOT&lt;/span&gt; &lt;span class="hljs-keyword"&gt;EXISTS&lt;/span&gt;(&lt;span class="hljs-keyword"&gt;SELECT&lt;/span&gt; &lt;span class="hljs-number"&gt;1&lt;/span&gt; &lt;span class="hljs-keyword"&gt;FROM&lt;/span&gt; l_appl_client lac &lt;span class="hljs-keyword"&gt;WHERE&lt;/span&gt; lac.f_application &lt;span class="hljs-operator"&gt;=&lt;/span&gt; fa.f_application &lt;span class="hljs-keyword"&gt;AND&lt;/span&gt; lac.c_linktype &lt;span class="hljs-operator"&gt;=&lt;/span&gt; &lt;span class="hljs-number"&gt;840&lt;/span&gt; &lt;span class="hljs-keyword"&gt;AND&lt;/span&gt; lac.stat &lt;span class="hljs-operator"&gt;=&lt;/span&gt; &lt;span class="hljs-number"&gt;0&lt;/span&gt; &lt;span class="hljs-keyword"&gt;AND&lt;/span&gt; &lt;span class="hljs-keyword"&gt;CASE&lt;/span&gt; &lt;span class="hljs-keyword"&gt;WHEN&lt;/span&gt; ISNULL(lac.f_client,&lt;span class="hljs-number"&gt;0&lt;/span&gt;) &lt;span class="hljs-operator"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="hljs-variable"&gt;@f&lt;/span&gt;_client_user &lt;span class="hljs-keyword"&gt;AND&lt;/span&gt; ISNULL(lac.f_c_f_client,&lt;span class="hljs-number"&gt;0&lt;/span&gt;) &lt;span class="hljs-operator"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="hljs-variable"&gt;@f&lt;/span&gt;_client_user &lt;span class="hljs-keyword"&gt;THEN&lt;/span&gt; &lt;span class="hljs-number"&gt;0&lt;/span&gt; &lt;span class="hljs-keyword"&gt;ELSE&lt;/span&gt; &lt;span class="hljs-number"&gt;1&lt;/span&gt; &lt;span class="hljs-keyword"&gt;END&lt;/span&gt; &lt;span class="hljs-operator"&gt;=&lt;/span&gt; &lt;span class="hljs-number"&gt;1&lt;/span&gt; ) &lt;span class="hljs-keyword"&gt;THEN&lt;/span&gt; &lt;span class="hljs-number"&gt;0&lt;/span&gt; &lt;span class="hljs-keyword"&gt;ELSE&lt;/span&gt; &lt;span class="hljs-number"&gt;1&lt;/span&gt; &lt;span class="hljs-keyword"&gt;END&lt;/span&gt; &lt;span class="hljs-operator"&gt;=&lt;/span&gt; &lt;span class="hljs-number"&gt;1&lt;/span&gt; &lt;span class="hljs-comment"&gt;-- 07.09.2022&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We&amp;#39;ll come back to what it&amp;#39;s doing, but let&amp;#39;s start with a little backstory.&lt;/p&gt;
&lt;p&gt;This code is part of a two-tier application: all the logic lives in SQL Server stored procedures, and the UI is a PowerBuilder application. It&amp;#39;s been under development for a long time, and in that time has accrued about a million lines of code between the front end and back end, and has never had more than 5 developers working on it at any given time. The backlog of feature requests is nearly as long as the backlog of bugs.&lt;/p&gt;
&lt;p&gt;You may notice the little date comment in the code above. That&amp;#39;s because until Jim joined the company, they used Visual Source Safe for version control. Visual Source Safe went out of support in &lt;em&gt;2005&lt;/em&gt;, and let&amp;#39;s be honest: even when it was in support it barely worked as a source control system. And that&amp;#39;s just the Power Builder side- the database side just didn&amp;#39;t use source control. The source of truth was the database itself. When going from development to test to prod, you&amp;#39;d manually export object definitions and run the scripts in the target environment. Manually. Yes, even in production. And yes, environments did drift and assumptions made in the scripts would frequently break things.&lt;/p&gt;
&lt;p&gt;You may also notice the fields above use a lot of Hungarian notation. Hungarian, in the best case, makes it harder to read and reason about your code. In this case, it&amp;#39;s honestly fully obfuscatory. &lt;code&gt;c_&lt;/code&gt; stands for a codetable, &lt;code&gt;f_&lt;/code&gt; for entities. &lt;code&gt;l_&lt;/code&gt; is for a many-to-many linking table. &lt;code&gt;z_&lt;/code&gt; is for temporary tables. So is &lt;code&gt;x_&lt;/code&gt;. And &lt;code&gt;t_&lt;/code&gt;. Except not all of those &amp;#34;temporary&amp;#34; tables are truly temporary, a lesson Jim learned when trying to clean up some &amp;#34;junk&amp;#34; tables which were not actually junk.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll let Jim add some more detail around these prefixes:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;an &amp;#34;application&amp;#34; may have a link to a &amp;#34;client&amp;#34;, so there is an &lt;code&gt;f_client&lt;/code&gt; field; but also it references an &amp;#34;agent&amp;#34; (which is also in the &lt;code&gt;f_client&lt;/code&gt; table, surpise!) - this is how you get an &lt;code&gt;f_c_f_client&lt;/code&gt; field. I have no clue why the prefix is &lt;code&gt;f_c_&lt;/code&gt; - but I also found &lt;code&gt;c_c_c_channel&lt;/code&gt; and &lt;code&gt;fc4_contact&lt;/code&gt; columns. The latter was a shorthand for &lt;code&gt;f_c_f_c_f_c_f_contact&lt;/code&gt;, I guess.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;#34;f_c_f_c_f_c_f_c&amp;#34; is also the sound I&amp;#39;d make if I saw this in a codebase I was responsible for. It certainly makes me want to change the c_c_c_channel.&lt;/p&gt;
&lt;p&gt;With all this context, let&amp;#39;s turn it back over to Jim to explain the code above:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;And now, with all this background in mind, let&amp;#39;s have a look at the logic in this condition. On the deepest level we check that both &lt;code&gt;f_client&lt;/code&gt; and &lt;code&gt;f_c_f_client&lt;/code&gt; are NOT equal to &lt;code&gt;@f_client_user&lt;/code&gt;, and if this is the case, we return 0 which is NOT equal to 1 so it&amp;#39;s effectively a negation of the condition. Then we check that records matching this condition do NOT EXIST, and when this is true - also return 0 negating the condition once more.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Honestly, the logic couldn&amp;#39;t be clearer, when you put it that way. I jest, I&amp;#39;ve read that twelve times and I still don&amp;#39;t understand what this is for or why it&amp;#39;s here. I just want to know who we can prosecute for this disaster. The whole thing is a quadruple negative and frankly, I can&amp;#39;t handle that kind of negativity.&lt;/p&gt;
&lt;!-- Easy Reader Version: f_c_f_c_easy_reader_version_z_x_t --&gt;
&lt;style&gt;.comment { border: none; }&lt;/style&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=Confidence&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Utilize BuildMaster&lt;/a&gt; to release your software with confidence, at the pace your business demands. &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=Confidence&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Download&lt;/a&gt; today!  
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>10</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/qaudruple-negative</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Repeating Your Existence</title><link>https://thedailywtf.com/articles/repeating-your-existence</link><category>CodeSOD</category><pubDate>Wed, 04 Mar 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/repeating-your-existence</guid><description>&lt;p&gt;Today&amp;#39;s snippet from &lt;strong&gt;Rich D&lt;/strong&gt; is short and sweet, and admittedly, not the most TFs of WTFs out there. But it made me chuckle, and sometimes that&amp;#39;s all we need. This Java snippet shows us how to delete a file:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-java"&gt;&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (Files.exists(filePath)) {
    Files.deleteIfExists(filePath);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the file exists, then if it exists, delete it.&lt;/p&gt;
&lt;p&gt;This commit was clearly submitted by the Department of Redundancy Department. One might be tempted to hypothesize that there&amp;#39;s some race condition or something that they&amp;#39;re trying to route around, but if they are, this isn&amp;#39;t the way to do it, &lt;a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#deleteIfExists-java.nio.file.Path-"&gt;per the docs&lt;/a&gt;: &amp;#34;Consequently this method may not be atomic with respect to other file system operations.&amp;#34; But also, I fail to see how this would do that anyway.&lt;/p&gt;
&lt;p&gt;The only thing we can say for certain about using &lt;code&gt;deleteIfExists&lt;/code&gt; instead of &lt;code&gt;delete&lt;/code&gt; is that &lt;code&gt;deleteIfExists&lt;/code&gt; will never throw a &lt;code&gt;NoSuchFileException&lt;/code&gt;.&lt;/p&gt;
&lt;!-- Easy Reader Version: if (article.notRepeat()) { article.postIfNotRepeat(); } --&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>22</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/repeating-your-existence</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Blocked Up</title><link>https://thedailywtf.com/articles/blocked-up</link><category>CodeSOD</category><pubDate>Tue, 03 Mar 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/blocked-up</guid><description>&lt;p&gt;&lt;strong&gt;Agatha&lt;/strong&gt; has inherited some Windows Forms code. This particular batch of such code falls into that delightful category of code that&amp;#39;s wrong in multiple ways, multiple times. The task here is to disable a few panels worth of controls, based on a condition. Or, since this is in Spanish, &amp;#34;bloquear controles&amp;#34;. Let&amp;#39;s see how they did it.&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; &lt;span class="hljs-keyword"&gt;void&lt;/span&gt; &lt;span class="hljs-title"&gt;BloquearControles&lt;/span&gt;()&lt;/span&gt;
{
	&lt;span class="hljs-built_in"&gt;bool&lt;/span&gt; bolBloquear = SomeConditionTM; &lt;span class="hljs-comment"&gt;// SomeConditionTM = a bunch of stuff. Replaced for clarity.&lt;/span&gt;

	&lt;span class="hljs-comment"&gt;// Some code. Removed for clarity.&lt;/span&gt;
	
	&lt;span class="hljs-comment"&gt;// private System.Windows.Forms.Panel pnlPrincipal;&lt;/span&gt;
	&lt;span class="hljs-keyword"&gt;foreach&lt;/span&gt; (Control C &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; &lt;span class="hljs-keyword"&gt;this&lt;/span&gt;.pnlPrincipal.Controls)
	{
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.TextBox))
		{
			C.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.ComboBox))
		{
			C.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.CheckBox))
		{
			C.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.DateTimePicker))
		{
			C.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.NumericUpDown))
		{
			C.Enabled = bolBloquear;
		}
	}
	
	&lt;span class="hljs-comment"&gt;// private System.Windows.Forms.GroupBox grpProveedor;&lt;/span&gt;
	&lt;span class="hljs-keyword"&gt;foreach&lt;/span&gt; (Control C1 &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; &lt;span class="hljs-keyword"&gt;this&lt;/span&gt;.grpProveedor.Controls)
	{
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C1.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.TextBox))
		{
			C1.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C1.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.ComboBox))
		{
			C1.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C1.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.CheckBox))
		{
			C1.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C1.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.DateTimePicker))
		{
			C1.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C1.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.NumericUpDown))
		{
			C1.Enabled = bolBloquear;
		}
	}

	&lt;span class="hljs-comment"&gt;// private System.Windows.Forms.GroupBox grpDescuentoGeneral;&lt;/span&gt;
	&lt;span class="hljs-keyword"&gt;foreach&lt;/span&gt; (Control C2 &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; &lt;span class="hljs-keyword"&gt;this&lt;/span&gt;.grpDescuentoGeneral.Controls)
	{
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C2.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.TextBox))
		{
			C2.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C2.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.ComboBox))
		{
			C2.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C2.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.CheckBox))
		{
			C2.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C2.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.DateTimePicker))
		{
			C2.Enabled = bolBloquear;
		}
		&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (C2.GetType() == &lt;span class="hljs-keyword"&gt;typeof&lt;/span&gt;(System.Windows.Forms.NumericUpDown))
		{
			C2.Enabled = bolBloquear;
		}
	}

	&lt;span class="hljs-comment"&gt;// Some more code. Removed for clarity.&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This manages two group boxes and a panel. It checks a condition, then iterates across every control beneath it, and sets their enabled property on the control. In order to do this, it checks the &lt;em&gt;type&lt;/em&gt; of the control for some reason.&lt;/p&gt;
&lt;p&gt;Now, a few things: every control inherits from the base &lt;code&gt;Control&lt;/code&gt; class, which has an &lt;code&gt;Enabled&lt;/code&gt; property, so we&amp;#39;re not doing this check to make sure the property exists. &lt;em&gt;And&lt;/em&gt; every built-in container control automatically passes its enabled/disabled state to its child controls. So there&amp;#39;s a four line version of this function where we just set the enabled property on each container.&lt;/p&gt;
&lt;p&gt;This leaves us with two possible explanations. The first, and most likely, is that the developer responsible just didn&amp;#39;t understand how these controls worked, and how inheritance worked, and wrote this abomination as an expression of that ignorance. This is extremely plausible, extremely likely, and honestly, our best case scenario.&lt;/p&gt;
&lt;p&gt;Because our &lt;em&gt;worse&lt;/em&gt; case scenario is that this code&amp;#39;s job &lt;em&gt;isn&amp;#39;t&lt;/em&gt; to disable &lt;em&gt;all&lt;/em&gt; of the controls. The reason they&amp;#39;re doing type checking is that there &lt;em&gt;are&lt;/em&gt; some controls used in these containers that don&amp;#39;t match the types listed. The purpose of this code, then, is to disable &lt;em&gt;some&lt;/em&gt; of the controls, leaving others enabled. Doing this by &lt;em&gt;type&lt;/em&gt; would be a terrible way to manage that, and is endlessly confusing. Worse, I can&amp;#39;t imagine how this behavior is interpreted by the end users; the enabling/disabling of controls following no intuitive pattern, just filtered based on the kind of control in use.&lt;/p&gt;
&lt;p&gt;The good news is that Agatha can point us towards the first option. She adds:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;They decided to not only disable the child controls one by one but to check their type and only disable those five types, some of which aren&amp;#39;t event present in the containers. And to make sure this was WTF-worthy the didn&amp;#39;t even bother to use else-if so every type is checked for every child control&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;She also adds:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At this point I&amp;#39;m not going to bother commenting on the use of &lt;code&gt;GetType() == typeof()&lt;/code&gt; instead of &lt;code&gt;is&lt;/code&gt; to do the type checking.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Bad news, Agatha: you &lt;em&gt;did&lt;/em&gt; bother commenting. And even if you didn&amp;#39;t, don&amp;#39;t worry, someone would have.&lt;/p&gt;
&lt;!-- Easy Reader Version: "bol bloquear" is fun to say --&gt;
&lt;style&gt;.comment { border: none; }&lt;/style&gt;&lt;div&gt;
	[Advertisement] Picking up &lt;b&gt;NuGet&lt;/b&gt; is easy. Getting good at it takes time. &lt;a href="https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf&amp;amp;utm_medium=Footerad&amp;amp;utm_campaign=nuget"&gt;Download our guide to learn the best practice of NuGet for the Enterprise.&lt;/a&gt;

&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;</description><slash:comments>20</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/blocked-up</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Popping Off</title><link>https://thedailywtf.com/articles/popping-off</link><category>CodeSOD</category><pubDate>Mon, 02 Mar 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/popping-off</guid><description>&lt;p&gt;Python is (in)famous for its &amp;#34;batteries included&amp;#34; approach to a standard library, but it&amp;#39;s not that notable that it has plenty of standard data structures, like &lt;code&gt;dict&lt;/code&gt;s. Nor is in surprising that &lt;code&gt;dict&lt;/code&gt;s have all sorts of useful methods, like &lt;code&gt;pop&lt;/code&gt;, which removes a key from the &lt;code&gt;dict&lt;/code&gt; and returns its value.&lt;/p&gt;
&lt;p&gt;Because you&amp;#39;re here, reading this site, you&amp;#39;ll also be unsurprised that this doesn&amp;#39;t stop developers from re-implementing that built-in function, badly. &lt;strong&gt;Karen&lt;/strong&gt; sends us this:&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;parse_message&lt;/span&gt;(&lt;span class="hljs-params"&gt;message&lt;/span&gt;):
    &lt;span class="hljs-keyword"&gt;def&lt;/span&gt; &lt;span class="hljs-title function_"&gt;pop&lt;/span&gt;(&lt;span class="hljs-params"&gt;key&lt;/span&gt;):
        &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; key &lt;span class="hljs-keyword"&gt;in&lt;/span&gt; data:
            result = data[key]
            &lt;span class="hljs-keyword"&gt;del&lt;/span&gt; data[key]
            &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; result
        &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; &lt;span class="hljs-string"&gt;&amp;#39;&amp;#39;&lt;/span&gt;

    data = json.loads(message)
    some_value = pop(&lt;span class="hljs-string"&gt;&amp;#34;some_key&amp;#34;&lt;/span&gt;)
    &lt;span class="hljs-comment"&gt;# &amp;lt;snip&amp;gt;...multiple uses of pop()...&amp;lt;/snip&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, they create an inner method, &lt;em&gt;and&lt;/em&gt; they exploit variable hoisting. While &lt;code&gt;pop&lt;/code&gt; appears in the code before &lt;code&gt;data&lt;/code&gt; is declared, all variable declarations are &amp;#34;hoisted&amp;#34; to the top. When &lt;code&gt;pop&lt;/code&gt; references &lt;code&gt;data&lt;/code&gt;, it&amp;#39;s getting that from the enclosing scope. Which while this isn&amp;#39;t a &lt;em&gt;global&lt;/em&gt; variable, it&amp;#39;s still letting a variable cross between two scopes, which is always messy.&lt;/p&gt;
&lt;p&gt;Also, this &lt;code&gt;pop&lt;/code&gt; returns a default value, which is also something the built-in method can do. It&amp;#39;s just the built-in version requires you to explicitly pass the value, e.g.: &lt;code&gt;some_value = data.pop(&amp;#34;some_key&amp;#34;, &amp;#34;&amp;#34;)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Karen briefly wondered if this was a result of the Python 2 to 3 conversion, but no, &lt;code&gt;pop&lt;/code&gt; has been part of &lt;code&gt;dict&lt;/code&gt; for a long time. I wondered if this was just an exercise in code golf, writing a shorthand function, but even then- you could just wrap the built-in &lt;code&gt;pop&lt;/code&gt; with your shorthand version (not that I&amp;#39;d recommend such a thing). No, I think the developer responsible simply didn&amp;#39;t know the function was there, and just reimplemented a built-in method badly, as so often happens.&lt;/p&gt;
&lt;!-- Easy Reader Version: Also, because `.get("key", default)` exists, any time you see `if key in data: result = data[key]` that's a sign somebody is off the beaten path --&gt;
&lt;style&gt;.comment { border: none;}&lt;/style&gt;&lt;div&gt;
	[Advertisement] Picking up &lt;b&gt;NuGet&lt;/b&gt; is easy. Getting good at it takes time. &lt;a href="https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf&amp;amp;utm_medium=Footerad&amp;amp;utm_campaign=nuget"&gt;Download our guide to learn the best practice of NuGet for the Enterprise.&lt;/a&gt;

&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;</description><slash:comments>14</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/popping-off</wfw:comment></item><item><dc:creator>Lyle Seaman</dc:creator><title>Error'd: Perverse Perseveration</title><link>https://thedailywtf.com/articles/perverse-perseveration</link><category>Error'd</category><pubDate>Fri, 27 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/perverse-perseveration</guid><description>&lt;p&gt;Pike pike pike pike Pike pike pike.
&lt;/p&gt;


&lt;p&gt;
&lt;strong&gt;Lincoln KC
&lt;/strong&gt; repeated
&amp;#34;I never knew Bank of America Bank of America Bank of America was among
the major partners of Bank of America.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#4"&gt;&lt;img itemprop="image" border="0" alt="4" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/313/screenshot_20260221-101810.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&amp;#34;Extra tokens, or just a stutter?&amp;#34; asks
&lt;strong&gt;Joel
&lt;/strong&gt;
&amp;#34;An errant alt-tab caused a needless google search, but thankfully
Gemini&amp;#39;s AI summary got straight-to-the-point(less) info.

It is nice to see the world&amp;#39;s supply of Oxford commas all in once place.
&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#0"&gt;&lt;img itemprop="image" border="0" alt="0" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/313/image2.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;
&lt;strong&gt;Alessandro M.
&lt;/strong&gt; isn&amp;#39;t the first one to call us out on our WTFs.
&amp;#34;It’s adorable how the site proudly supports GitHub OAuth
 right up until the moment you actually try to use it.
It’s like a door with a ‘Welcome’ sign that opens onto
a brick wall.&amp;#34; Meep meep.
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#1"&gt;&lt;img itemprop="image" border="0" alt="1" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/313/screenshot155905.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Float follies found 
&lt;strong&gt;Daniel W.
&lt;/strong&gt; doubly-precise.
&amp;#34;Had to go check on something in M365 Admin Center, and
when I was on the OneDrive tab, I noticed Microsoft was
calculating back past the bit.  We&amp;#39;re in quantum
space at this point.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#2"&gt;&lt;img itemprop="image" border="0" alt="2" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/313/image.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Weinliebhaber
&lt;strong&gt;
Michael R.
&lt;/strong&gt; sagt
&amp;#34;Our German linguists here will spot the WTF immediately
where my local wine shop has not. Weiẞer != WEIBER. Those
words mean really different things.&amp;#34; Is that
20 euro per kilo, or per the piece? 
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#3"&gt;&lt;img itemprop="image" border="0" alt="3" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/313/untitled.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/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=Confidence&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Utilize BuildMaster&lt;/a&gt; to release your software with confidence, at the pace your business demands. &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=Confidence&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Download&lt;/a&gt; today!  
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>24</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/perverse-perseveration</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: The Counting Machine</title><link>https://thedailywtf.com/articles/the-counting-machine</link><category>CodeSOD</category><pubDate>Thu, 26 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/the-counting-machine</guid><description>&lt;p&gt;Industrial machines are generally accompanied by &amp;#34;Human Machine Interfaces&amp;#34;, HMIs. This is industrial slang for a little computerized box you use to control the industrial machine. All the key logic and core functionality and &lt;em&gt;especially&lt;/em&gt; the safety functionality is handled at a deeper computer layer in the system. The HMI is just buttons users can push to interact with the machine.&lt;/p&gt;
&lt;p&gt;Purchasers of those pieces of industrial equipment often want to customize that user interface. They want to guide users away from functions they don&amp;#39;t need, or make their specific workflow clear, or even just brand the UI. This means that the vendor needs to publish an API for their HMI.&lt;/p&gt;
&lt;p&gt;Which brings us to &lt;strong&gt;Wendy&lt;/strong&gt;. She works for a manufacturing company which wants to customize the HMI on a piece of industrial equipment in a factory. That means Wendy has been reading the docs and poking at the open-sourced portions of the code, and these raise more questions than they answer.&lt;/p&gt;
&lt;p&gt;For example, the HMI&amp;#39;s API provides its own set of collection types, in C#. We can wonder why they&amp;#39;d do such a thing, which is certainly a WTF in itself, but this representative line raises even more questions than that:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;Int32 Count { &lt;span class="hljs-keyword"&gt;get&lt;/span&gt;; &lt;span class="hljs-keyword"&gt;set&lt;/span&gt;; }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What happens if you use the public &lt;code&gt;set&lt;/code&gt; operation on the &lt;em&gt;count of items in a collection&lt;/em&gt;? I don&amp;#39;t know. Wendy doesn&amp;#39;t either, as she writes:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&amp;#39;m really tempted to set the count but I fear the consequences.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;All I can hear in my head when I think about &amp;#34;setting the Count&amp;#34; is: &amp;#34;One! One null reference exception! Two! TWO null reference exceptions! HA HA HA HA!&amp;#34;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/File:Count_von_Count_kneeling.png#/media/File:Count_von_Count_kneeling.png"&gt;&lt;img itemprop="image" src="https://upload.wikimedia.org/wikipedia/en/2/29/Count_von_Count_kneeling.png" alt="Count von Count kneeling.png" height="338" width="295"/&gt;&lt;/a&gt;&lt;br/&gt;By &lt;a rel="nofollow" class="external free" href="http://muppet.wikia.com/wiki/Count_von_Count"&gt;http://muppet.wikia.com/wiki/Count_von_Count&lt;/a&gt;&lt;/p&gt;
&lt;!-- Easy Reader Version: A textbook example of why proper encapsulation matters. --&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>20</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/the-counting-machine</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Safegaurd Your Comments</title><link>https://thedailywtf.com/articles/safegaurd-your-comments</link><category>CodeSOD</category><pubDate>Wed, 25 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/safegaurd-your-comments</guid><description>&lt;p&gt;I&amp;#39;ve had the misfortune of working in places which did source-control via comments. Like one place which required that, with each section of code changed, you needed to add a comment with your name, the ticket number, and the reason the change was made. You know, the kind of thing you can just get from your source control service.&lt;/p&gt;
&lt;p&gt;In their defense, that policy was invented for mainframe developers and then extended to everyone else, &lt;em&gt;and&lt;/em&gt; their source control system was in Visual Source Safe. VSS was a) terrible, and b) a perennial destroyer of history, so maybe they weren&amp;#39;t entirely wrong and VSS was the real WTF. I still hated it.&lt;/p&gt;
&lt;p&gt;In any case, &lt;strong&gt;Alice&lt;/strong&gt;&amp;#39;s team uses more modern source control than that, which is why she&amp;#39;s able to explain to us the story of this function:&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;calculateMassGrossPay&lt;/span&gt;(&lt;span class="hljs-params"&gt;&lt;span class="hljs-keyword"&gt;array&lt;/span&gt; &lt;span class="hljs-variable"&gt;$employees&lt;/span&gt;, Payroll &lt;span class="hljs-variable"&gt;$payroll&lt;/span&gt;&lt;/span&gt;): &lt;span class="hljs-title"&gt;array&lt;/span&gt;
&lt;/span&gt;{
    &lt;span class="hljs-comment"&gt;// it shouldn&amp;#39;t enter here, but if it does by any change, do nth&lt;/span&gt;
    &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; [];
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once upon a time, this function actually contained logic, a big pile of fairly complicated logic. Eventually, a different method was created which streamlined the functionality, but had a different signature and logic. All the callers were updated to use &lt;em&gt;that&lt;/em&gt; method instead- by commenting out the line which called this one. This function had a comment added to the top: &lt;code&gt;// it shouldn&amp;#39;t enter here&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then, the body of this function got commented out, and the return was turned into an empty array. The comment was expanded to what you see above. Then, &lt;em&gt;eventually&lt;/em&gt;, the commented-out callers were all deleted. Years after that, the commented out body of this function was also deleted, leaving behind the skeleton you see here.&lt;/p&gt;
&lt;p&gt;This function is not referenced anywhere else, not even in a comment. It&amp;#39;s truly impossible for code to &amp;#34;enter here&amp;#34;.&lt;/p&gt;
&lt;p&gt;Alice writes: &amp;#34;Version control by commented out code does not work very well.&amp;#34;&lt;/p&gt;
&lt;p&gt;Indeed, it does not.&lt;/p&gt;
&lt;!-- Easy Reader Version: it shouldn't enter here, either --&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>30</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/safegaurd-your-comments</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>Representative Line: Years Go By</title><link>https://thedailywtf.com/articles/years-go-by</link><category>Representative Line</category><pubDate>Tue, 24 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/years-go-by</guid><description>&lt;p&gt;&lt;strong&gt;Henrik H&lt;/strong&gt;&amp;#39;s employer thought they could save money by hiring offshore, and save even more money by hiring offshore junior developers, and save &lt;em&gt;even more&lt;/em&gt; money by basically not supervising them at all.&lt;/p&gt;
&lt;p&gt;Henrik sends us just one representative line:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csharp"&gt;&lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (System.DateTime.Now.AddDays(&lt;span class="hljs-number"&gt;-365&lt;/span&gt;) &amp;lt;= f.ReleaseDate) &lt;span class="hljs-comment"&gt;// 365 days means one year &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I appreciate the comment, that certainly &amp;#34;helps&amp;#34; explain the magic number. There&amp;#39;s of course, just one little problem: It&amp;#39;s wrong. I mean, ~75% of the time, it works every time, but it happily disregards leap years. Which may or may not be a problem in this case, but if they got so far as learning about the &lt;code&gt;AddDays&lt;/code&gt; method, they were inches from using &lt;code&gt;&lt;a href="https://learn.microsoft.com/en-us/dotnet/api/system.datetime.addyears?view=net-10.0"&gt;AddYears&lt;/a&gt;.&lt;/code&gt;&lt;/p&gt;&lt;code&gt;
&lt;p&gt;I guess it&amp;#39;s true what they say: you can lead a dev to docs, but you can&amp;#39;t make them think.&lt;/p&gt;
&lt;!-- Easy Reader Version: Probably AI slop, and it's the comment that makes me think so. --&gt;&lt;div&gt;
	[Advertisement] Picking up &lt;b&gt;NuGet&lt;/b&gt; is easy. Getting good at it takes time. &lt;a href="https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf&amp;amp;utm_medium=Footerad&amp;amp;utm_campaign=nuget"&gt;Download our guide to learn the best practice of NuGet for the Enterprise.&lt;/a&gt;

&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;&lt;/code&gt;</description><slash:comments>25</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/years-go-by</wfw:comment></item><item><dc:creator>Ellis Morning</dc:creator><title>WTF: Home Edition</title><link>https://thedailywtf.com/articles/wtf-home-edition</link><category>Feature Articles</category><pubDate>Mon, 23 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/wtf-home-edition</guid><description>&lt;p&gt;The utility closet &lt;b&gt;Ellis&lt;/b&gt; had inherited and lived with for 17 years had been a cesspool of hazards to life and limb, a collection of tangible WTFs that had everyone asking an uncaring god, &amp;#34;What were they thinking?&amp;#34;&lt;/p&gt;

&lt;p&gt;Every contractor who&amp;#39;d ever had to perform any amount of work in there had come away appalled. Many had even called over their buddies to come and see the stunning mess for themselves:&lt;/p&gt;

&lt;p style="float:right; padding-left:10px; padding-bottom:10px;"&gt;&lt;a title="O&amp;#39;Laughlin, Gregory L., Public domain, via Wikimedia Commons" href="https://commons.wikimedia.org/wiki/File:INTERIOR_OF_UTILITY_ROOM_SHOWING_STORAGE_CLOSET_AT_PHOTO_CENTER_LEFT_AND_HOT_WATER_HEATER_CLOSET_AT_PHOTO_CENTER_RIGHT._VIEW_TO_EAST._-_Bishop_Creek_Hydroelectric_System,_HAER_CAL,14-BISH.V,7A-28.tif"&gt;&lt;img itemprop="image" width="300" alt="INTERIOR OF UTILITY ROOM SHOWING STORAGE CLOSET AT PHOTO CENTER LEFT AND HOT WATER HEATER CLOSET AT PHOTO CENTER RIGHT. VIEW TO EAST. - Bishop Creek Hydroelectric System, HAER CAL,14-BISH.V,7A-28" src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/INTERIOR_OF_UTILITY_ROOM_SHOWING_STORAGE_CLOSET_AT_PHOTO_CENTER_LEFT_AND_HOT_WATER_HEATER_CLOSET_AT_PHOTO_CENTER_RIGHT._VIEW_TO_EAST._-_Bishop_Creek_Hydroelectric_System%2C_HAER_CAL%2C14-BISH.V%2C7A-28.tif/lossy-page1-593px-thumbnail.tif.jpg"/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; All of the electrical components, dating from the 1980s, were scarily underpowered for what they were supposed to be powering.&lt;/li&gt;
&lt;li&gt; To get to the circuit breaker box—which was unlabeled, of course—one had to contort themselves around a water heater almost as tall as Ellis herself.&lt;/li&gt;
&lt;li&gt; As the house had no basement, the utility closet was on the first floor in an open house plan. A serious failure with said water heater would&amp;#39;ve sent 40 gallons (150 liters) of scalding-hot tsunami surging through the living room and kitchen.&lt;/li&gt;
&lt;li&gt; The furnace&amp;#39;s return air vent had been screwed into crumbling drywall, and only prayers held it in place. Should it have fallen off, it would never have been replaceable. And Ellis&amp;#39; cat would&amp;#39;ve darted right in there for the adventure of a lifetime.&lt;/li&gt;
&lt;li&gt; To replace the furnace filter, Ellis had to put on work gloves, unscrew a sharp sheet-metal panel from the side of the furnace, pull the old filter out from behind a brick (the only thing holding it in place), manipulate the filter around a mess of water and natural gas pipes to get it out, thread the new filter in the same way, and then secure it in place with the brick before screwing the panel back on. Ellis always pretended to be an art thief in a museum, slipping priceless paintings around security-system lasers.&lt;/li&gt;
&lt;li&gt; Between the water tank, furnace, water conditioning unit, fiber optical network terminal, and router, there was barely room to breathe, much less enough air to power ignition for the gas appliances. Some genius had solved this by cutting random holes in several walls to admit air from outside. One of these holes was at floor-level. Once, Ellis opened the closet door to find a huge puddle on the floor, making her fear her hot water heater was leaking. As it turned out, a power-washing service had come over earlier that day. When they&amp;#39;d power-washed the exterior of her home, some of that water shot straight through one of those holes she hadn&amp;#39;t known about, giving her utility closet a bonus bath.&lt;/li&gt;
&lt;li&gt; If air intake was a problem, venting the appliances&amp;#39; exhaust was an even worse issue. The sheet-metal vents had calcified and rusted over time. If left unaddressed, holes could&amp;#39;ve formed that would&amp;#39;ve leaked carbon monoxide into Ellis&amp;#39; house.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Considering all the above, plus the fact that the furnace and air conditioner were coming up on 20 years of service, Ellis couldn&amp;#39;t put off corrective action any longer. Last week, over a span of 3 days, contractors came in to exorcise the demons:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Upgrading electricals that hadn&amp;#39;t already been dealt with.&lt;/li&gt;
&lt;li&gt;Replacing the hot water tank with a wall-mounted tankless heater.&lt;/li&gt;
&lt;li&gt;Replacing the furnace and AC with a heat pump and backup furnace, controlled by a new thermostat.&lt;/li&gt;
&lt;li&gt;Creating new pipes for intake and venting (no more reliance on indoor air for ignition).&lt;/li&gt;
&lt;li&gt;Replacing the furnace return air vent with a sturdier one.&lt;/li&gt;
&lt;li&gt;Putting a special hinged door on the side of the furnace, allowing the filter to be replaced in a matter of seconds (RIP furnace brick).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;With that much work to be done, there were bound to be hiccups. For instance, when the Internet router was moved, an outage occurred: for no good reason, the optical network terminal refused to talk to Ellis&amp;#39; Wifi router after powering back up. A technician came out a couple days later, reset the Internet router, and everything was fine again.&lt;/p&gt;

&lt;p&gt;All in all, it was an amazing and welcome transformation. As each new update came online, Ellis was gratefully satisfied. It seemed as though the demons were finally gone.&lt;/p&gt;

&lt;p&gt;Unbeknownst to them all, there was one last vengeful spirit to quell, one final WTF that it was hell-bent on doling out.&lt;/p&gt;

&lt;p&gt;It was late Friday afternoon. Despite the installers&amp;#39; best efforts, the new thermostat still wasn&amp;#39;t communicating with the new heat pump. Given the timing, they couldn&amp;#39;t contact the company rep to troubleshoot. However, the thermostat &lt;i&gt;was&lt;/i&gt; properly communicating with the furnace. And so, Ellis was left with the furnace for the weekend. She was told not to mess with the thermostat at all except to adjust the set point as desired. They would follow back up with her on Monday.&lt;/p&gt;

&lt;p&gt;For Ellis, that was perfectly fine. With the historically cold winter they&amp;#39;d been enduring in her neck of the woods, heat was all she cared about. She asked whom to contact in case of any issues, and was told to call the main number. With all that squared away, she looked forward to a couple of quiet, stress-free days before diving back into HVAC troubleshooting.&lt;/p&gt;

&lt;p&gt;Everything was fine, until it wasn&amp;#39;t. Around 11AM on Saturday, Ellis noticed that the thermostat displayed the word &amp;#34;Heating&amp;#34; while the furnace wasn&amp;#39;t actually running. Maybe it was about to turn on? 15 minutes went by, then half an hour. Nothing had changed except for the temperature in her house steadily decreasing.&lt;/p&gt;

&lt;p&gt;Panic set in at the thought of losing heat in her home indefinitely. That fell on top of a psyche that was already stressed out and emotionally exhausted from the last several days&amp;#39; effort. Struggling for calm, Ellis first tried to call that main number line for help as directed. She noticed right away that it wasn&amp;#39;t a real person on the other end asking for her personal information, but an AI agent. The agent informed her that the on-call technician had no availablity that weekend. It would pencil her in for a service appointment on Monday. How did that sound?&lt;/p&gt;

&lt;p&gt;&amp;#34;Not good enough!&amp;#34; Ellis cried. &amp;#34;I wanna speak to a representative!&amp;#34;&lt;/p&gt;

&lt;p&gt;&amp;#34;I understand!&amp;#34; replied the blithe chatbot. &amp;#34;Hold on, let me transfer you!&amp;#34;&lt;/p&gt;

&lt;p&gt;For a moment, Ellis was buoyed with hope. She&amp;#39;d gotten past the automated system. Soon, she&amp;#39;d be talking with a live person who might even be able to walk her through troubleshooting over the phone.&lt;/p&gt;

&lt;p&gt;The new agent answered. Ellis began pouring her heart out—then stopped dead when she realized it was &lt;i&gt;another AI agent, this time with a male voice instead of a female one.&lt;/i&gt; This one proceeded through nearly the same spiel as the first. It also scheduled her for a Monday service appointment even though the other chatbot had already claimed to have done so.&lt;/p&gt;

&lt;p&gt;This was the first time an AI had ever pulled such a trick on Ellis. It was &lt;i&gt;not&lt;/i&gt; a good time for it. Ellis hung up and called the only other person she could think to contact: her sales rep. When he didn&amp;#39;t answer, she left a voicemail and texts: no heat all weekend was unacceptable. She would really appreciate a call back.&lt;/p&gt;

&lt;p&gt;While playing the horrible waiting game, Ellis tried to think about what she could do to fix this. They had told her not to mess with the thermostat. Well, from what she could see, the thermostat was sending a signal to the furnace that the furnace wasn&amp;#39;t responding to for whatever reason. It was time to look at the docs. Fortunately, the new furnace&amp;#39;s manual was resting right on top of it. She spread it open on her kitchen table.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;OK,&lt;/i&gt; Ellis thought, &lt;i&gt;this newfangled furnace has an LED display which displays status codes.&lt;/i&gt; Her old furnace had lacked such a thing. &lt;i&gt;Lemme find that.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Inside her newly remodeled utility closet, she located the blinking display, knelt, and spied the code: &lt;code&gt;1dL&lt;/code&gt;. Looking that up in the doc&amp;#39;s troubleshooting section, she found ... &lt;i&gt;Normal Operation. No action.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;The furnace was OK, then? Now what?&lt;/p&gt;

&lt;p&gt;Aside from documentation, another thing Ellis knew pretty well was tech support. She decided to break out the ol&amp;#39; turn-it-off-and-on-again. She shut off power to both the furnace and thermostat, waited a few minutes, then switched everything back on, crossing her fingers.&lt;/p&gt;

&lt;p&gt;No change. The indoor temperature kept dropping.&lt;/p&gt;

&lt;p&gt;Her phone rang: the sales rep. He connected her with the on-call technician for that weekend, who fortunately was able to arrive at her house within the hour.&lt;/p&gt;

&lt;p&gt;One tiny thermostat adjustment later, and Ellis was enjoying a warm house once more.&lt;/p&gt;

&lt;p&gt;What had happened?&lt;/p&gt;

&lt;p&gt;This is where an understanding of heat pumps comes into play. In this configuration, the heat pump is used for cooling and for heating, unless the outside temperature gets very cold. At that point, the furnace kicks in, which is more efficient. (&lt;a href="https://www.youtube.com/watch?v=7J52mDjZzto" target="_blank"&gt;Technology Connections&lt;/a&gt; has some cool videos about this if you&amp;#39;re curious.)&lt;/p&gt;

&lt;p&gt;Everything had been running fine for Ellis while the temperatures had remained below freezing. The problem came when, for the first time in approximately 12 years, the temperature rose above 40F (4C). At that point, the new thermostat decided, without telling Ellis, &lt;i&gt;I&amp;#39;m gonna tell the HEAT PUMP to heat the joint!&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;... which couldn&amp;#39;t do anything just then.&lt;/p&gt;

&lt;p&gt;Workaround: the on-call technician switched the thermostat to an &lt;i&gt;emergency heat mode&lt;/i&gt; that used the furnace no matter what.&lt;/p&gt;

&lt;p&gt;Ellis had been told not to goof around with the thermostat. Even if she had, as a heat pump neophyte, she wouldn&amp;#39;t have known to go looking for such a setting. She might&amp;#39;ve dug it up in a manual. Someone could&amp;#39;ve walked her through it over the phone. Oh, well. There is heat again, which is all that matters.&lt;/p&gt;

&lt;p&gt;They will attempt to bring the heat pump online soon. We shall see if the story ends here, or if this becomes The WTF That Wouldn&amp;#39;t Die.&lt;/p&gt;

&lt;p&gt;P.S. When Ellis explained the AI answering service&amp;#39;s deceptive behavior, she was told that the agent had been universally complained about ever since they switched to it. Fed up, they told Ellis they&amp;#39;re getting rid of it. She feels pretty chuffed about more people seeing the light concerning &lt;a href="https://thedailywtf.com/articles/ai-the-bad-the-worse-and-the-ugly" target="_blank"&gt;garbage AI&lt;/a&gt; that creates far more problems than it solves.&lt;/p&gt;
&lt;style&gt; ul { list-style-type:disc; line-height:150%; margin-left: 3em; }&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>19</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/wtf-home-edition</wfw:comment></item><item><dc:creator>Lyle Seaman</dc:creator><title>Error'd: Three Blinded Mice</title><link>https://thedailywtf.com/articles/three-blinded-mice</link><category>Error'd</category><pubDate>Fri, 20 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/three-blinded-mice</guid><description>&lt;p&gt;...sent us five wtfs. And so on anon. 
&lt;/p&gt;

&lt;p&gt;Item the first, an anon is &amp;#34;definitely not qualified&amp;#34; for this job. 
&amp;#34;These years of experience requirements are getting ridiculous.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#0"&gt;&lt;img itemprop="image" border="0" alt="0" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/312/definitelynotqualified.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Item the second unearthed by a farmanon has a loco logo.
&amp;#34;After reading about the high quality spam emails which
are indistinguishable from the company&amp;#39;s emails, I got
one from the spammer just starting his first day.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#1"&gt;&lt;img itemprop="image" border="0" alt="1" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/312/missinglogo.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;In thrid place, anon has only good things to say: &amp;#34;I&amp;#39;m
liking their newsletter recommendations so far.&amp;#34;
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#2"&gt;&lt;img itemprop="image" border="0" alt="2" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/312/20240709newsletterrecommendations.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&amp;#34;A choice so noice, they gave it twoice,&amp;#34; quipped somebody.
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#3"&gt;&lt;img itemprop="image" border="0" alt="3" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/312/anonymousesornot.png"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;And foinally, a tdwtfer asks &amp;#34;I&amp;#39;ve seen this
mixmastered calendering on several web sites. Is there
an OSS package that is doing this? Or is it a Wordpress
plugin?&amp;#34; 
I have a sneaking suspicion I posted this before.
Call me on it. &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="#4"&gt;&lt;img itemprop="image" border="0" alt="4" src="https://d3hvi6t161kfmf.cloudfront.net/images/24/q1/312/birthdate.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/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=Confidence&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Utilize BuildMaster&lt;/a&gt; to release your software with confidence, at the pace your business demands. &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=Confidence&amp;amp;utm_campaign=Buildmaster_Footer"&gt;Download&lt;/a&gt; today!  
&lt;/div&gt;
&lt;div style="clear: left;"&gt; &lt;/div&gt;
</description><slash:comments>14</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/three-blinded-mice</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Terned Backwards</title><link>https://thedailywtf.com/articles/terned-backwards</link><category>CodeSOD</category><pubDate>Thu, 19 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/terned-backwards</guid><description>&lt;p&gt;&lt;strong&gt;Antonio&lt;/strong&gt; has an acquaintance has been seeking career advancement by proactively hunting down and fixing bugs. For example, in one project they were working on, there was a bug where it would incorrectly use MiB for storage sizes instead of MB, and vice-versa.&lt;/p&gt;
&lt;p&gt;We can set aside conspiracy theories about HDD and RAM manufacturers lying to us about sizes by using MiB in marketing. It isn&amp;#39;t relevant, and besides, its not like anyone can afford RAM anymore, with crazy datacenter buildouts. Regardless, which size to use, the base 1024 or base 1000, was configurable by the user, so obviously there was a bug handling that flag. Said acquaintance dug through, and found this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-js"&gt;&lt;span class="hljs-keyword"&gt;const&lt;/span&gt; baseValue = useSI ? &lt;span class="hljs-number"&gt;1000&lt;/span&gt; : &lt;span class="hljs-number"&gt;1024&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I know I have a &amp;#34;reputation&amp;#34; when it comes to hating ternaries, but this is a perfectly fine block of code. It is also correct: if you&amp;#39;re using SI notation, you should do base 1000. &lt;!-- This is my core problem with the metric system- base 10 is actually really annoying to work with; gimmie a base 60! Or at least a base 16. --&gt;&lt;/p&gt;
&lt;p&gt;Now, given that this code is correct, you or I might say, &amp;#34;Well, I guess that isn&amp;#39;t the bug, it must be somewhere else.&amp;#34; Not this intrepid developer, who decided that they could fix it.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-js"&gt;&lt;span class="hljs-comment"&gt;//            const baseValue = useSI ? 1000 : 1024;&lt;/span&gt;
            baseValue = &lt;span class="hljs-number"&gt;1024&lt;/span&gt;
            &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (useSI === &lt;span class="hljs-literal"&gt;false&lt;/span&gt;)
            {
                baseValue = &lt;span class="hljs-number"&gt;1000&lt;/span&gt;;
            }
            &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (useSI === &lt;span class="hljs-literal"&gt;true&lt;/span&gt;)
            {
                baseValue = &lt;span class="hljs-number"&gt;1024&lt;/span&gt;;
            }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&amp;#39;s rather amazing to see a single, correct line, replaced with ten incorrect lines, and I&amp;#39;m counting commenting out the correct line as one of them.&lt;/p&gt;
&lt;p&gt;First, this doesn&amp;#39;t correctly declare &lt;code&gt;baseValue&lt;/code&gt;, which JavaScript is pretty forgiving about, but it also discards &lt;code&gt;const&lt;/code&gt;ness. Of course, you &lt;em&gt;have&lt;/em&gt; to discard &lt;code&gt;const&lt;/code&gt;ness now that you&amp;#39;ve gotten rid of the ternary.&lt;/p&gt;
&lt;p&gt;Then, our &lt;code&gt;if&lt;/code&gt; statement compares a boolean value against a boolean literal, instead of simply &lt;code&gt;if(!useSI)&lt;/code&gt;. We don&amp;#39;t use an &lt;code&gt;else&lt;/code&gt;, despite an &lt;code&gt;else&lt;/code&gt; being absolutely correct. Or actually, since we defaulted &lt;code&gt;baseValue&lt;/code&gt;, we don&amp;#39;t even need an else!&lt;/p&gt;
&lt;p&gt;But of course, all of that is just glitter on a child&amp;#39;s hand-made holiday card. The glue holding it all together is that this code just flips the logic. If we&amp;#39;re &lt;em&gt;not&lt;/em&gt; using SI, we set &lt;code&gt;baseValue&lt;/code&gt; to 1000, and if we &lt;em&gt;are&lt;/em&gt; using SI, we set it to 1024. This is wrong. This is the opposite of what the code says we should do, what words mean, and how units work.&lt;/p&gt;
&lt;!-- Easy Reader Version: From Antonio: "Everything is unaltered, including the comment's position", which boy, I *am* annoyed at how that comment is written --&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>32</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/terned-backwards</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Contains Some Bad Choices</title><link>https://thedailywtf.com/articles/contains-some-bad-choices</link><category>CodeSOD</category><pubDate>Wed, 18 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/contains-some-bad-choices</guid><description>&lt;p&gt;While I&amp;#39;m not hugely fond of ORMs (I&amp;#39;d argue that relations and objects &lt;em&gt;don&amp;#39;t&lt;/em&gt; map neatly to each other, and any ORM is going to be a very leaky abstraction for all but trivial cases), that&amp;#39;s &lt;em&gt;not&lt;/em&gt; because I love writing SQL. I&amp;#39;m a big fan of query-builder tools; describe your query programatically, and have an API that generates the required SQL as a result. This cuts down on developer error, and also hopefully handles all the weird little dialects that every database has.&lt;/p&gt;
&lt;p&gt;For example, did you know Postgres has an &lt;code&gt;@&amp;gt;&lt;/code&gt; operator? It&amp;#39;s a contains operation, which returns true if an array, range, or JSON dictionary contains your search term. Basically, an advanced &amp;#34;in&amp;#34; operation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gretchen&lt;/strong&gt;&amp;#39;s team is using the Knex library, which doesn&amp;#39;t have a built-in method for constructing those kinds of queries. But that&amp;#39;s fine, because it does offer a &lt;code&gt;whereRaw&lt;/code&gt; method, which allows you to supply raw SQL. The nice thing about this is that you can still parameterize your query, and Knex will handle all the fun things, like transforming an array into a string.&lt;/p&gt;
&lt;p&gt;Or you could just not use that, and write the code yourself:&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;buildArrayString&lt;/span&gt; = &lt;span class="hljs-function"&gt;&lt;span class="hljs-params"&gt;jsArray&lt;/span&gt; =&amp;gt;&lt;/span&gt; {
  &lt;span class="hljs-comment"&gt;// postgres has some different array syntax&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;// [1,2] =&amp;gt; &amp;#39;{1,2}&amp;#39;&lt;/span&gt;
  &lt;span class="hljs-keyword"&gt;let&lt;/span&gt; arrayString = &lt;span class="hljs-string"&gt;&amp;#39;{&amp;#39;&lt;/span&gt;;
  &lt;span class="hljs-keyword"&gt;for&lt;/span&gt;(&lt;span class="hljs-keyword"&gt;let&lt;/span&gt; i = &lt;span class="hljs-number"&gt;0&lt;/span&gt;; i &amp;lt; jsArray.&lt;span class="hljs-property"&gt;length&lt;/span&gt;; i++) {
    arrayString += jsArray[i];
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt;(i + &lt;span class="hljs-number"&gt;1&lt;/span&gt; &amp;lt; jsArray.&lt;span class="hljs-property"&gt;length&lt;/span&gt;) {
      arrayString += &lt;span class="hljs-string"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;
    }
  }
  arrayString += &lt;span class="hljs-string"&gt;&amp;#39;}&amp;#39;&lt;/span&gt;;
  &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; arrayString;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&amp;#39;s the string munging we know and love. This constructs a Postgres array, which is wrapped in curly braces.&lt;/p&gt;
&lt;p&gt;Also, little pro-tip for generating comma separated code, and this is just a real tiny optimization: before the loop append item zero, start the loop with item 1, and then you can unconditionally prepend a comma, removing any conditional logic from your loop. That&amp;#39;s not a WTF, but I&amp;#39;ve seen so much otherwise good code make that mistake I figured I&amp;#39;d bring it up.&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;buildArrayContainsQuery&lt;/span&gt; = &lt;span class="hljs-function"&gt;(&lt;span class="hljs-params"&gt;key, values&lt;/span&gt;) =&amp;gt;&lt;/span&gt; {
  &lt;span class="hljs-comment"&gt;// &lt;span class="hljs-doctag"&gt;TODO:&lt;/span&gt; do we need to do input safety checks here?&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;// console.log(&amp;#34;buildArrayContainsQuery&amp;#34;);&lt;/span&gt;

  &lt;span class="hljs-comment"&gt;// build the postgres &amp;#39;contains&amp;#39; query to compare arrays&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;// ex: to fetch files by the list of tags&lt;/span&gt;

  &lt;span class="hljs-comment"&gt;//WORKS:&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;//select * from files where _tags @&amp;gt; &amp;#39;{2}&amp;#39;;&lt;/span&gt;
  &lt;span class="hljs-comment"&gt;//query.whereRaw(&amp;#39;_tags @&amp;gt; ?&amp;#39;, &amp;#39;{2}&amp;#39;)&lt;/span&gt;

  &lt;span class="hljs-keyword"&gt;let&lt;/span&gt; returnQueryParams = [];
  returnQueryParams.&lt;span class="hljs-title function_"&gt;push&lt;/span&gt;(&lt;span class="hljs-string"&gt;`&lt;span class="hljs-subst"&gt;${key}&lt;/span&gt; @&amp;gt; ?`&lt;/span&gt;);
  returnQueryParams.&lt;span class="hljs-title function_"&gt;push&lt;/span&gt;(&lt;span class="hljs-built_in"&gt;exports&lt;/span&gt;.&lt;span class="hljs-title function_"&gt;buildArrayString&lt;/span&gt;(values));
  &lt;span class="hljs-comment"&gt;// console.log(returnQueryParams);&lt;/span&gt;
  &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; returnQueryParams;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And here&amp;#39;s where it&amp;#39;s used. &amp;#34;do we need input safety checks here?&amp;#34; is never a comment I like to see as a &lt;code&gt;TODO&lt;/code&gt;. That said, because we are still using Knex&amp;#39;s parameter handling, I&amp;#39;d &lt;em&gt;hope&lt;/em&gt; it handles escaping correctly so that the answer to this question is &amp;#34;no&amp;#34;. If the answer is &amp;#34;yes&amp;#34; for some reason, I&amp;#39;d stop using this library!&lt;/p&gt;
&lt;p&gt;That said, all of this code becomes superfluous, especially when you read the &lt;em&gt;comments in this function&lt;/em&gt;. I could just directly run &lt;code&gt;query.whereRaw(&amp;#39;_tags @&amp;gt; ?&amp;#39;, myArray)&lt;/code&gt;; I don&amp;#39;t need to munge the string myself. I don&amp;#39;t need to write a function which returns an array of parameters that I have to split back up to pass to the query I want to call.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the worst part of all of this: these functions exist in a file called &lt;code&gt;sqlUtils.js&lt;/code&gt;, which is just a pile of badly re-invented wheels, and the only thing they have in common is that they&amp;#39;re vaguely related to database operations.&lt;/p&gt;
&lt;!-- Easy Reader Version: "utils" is the junk drawer of programming, and *someplace* in there there's that pair of scissors you were looking for, hopefully you find it before it stabs you. --&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 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>11</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/contains-some-bad-choices</wfw:comment></item><item><dc:creator>Remy Porter</dc:creator><title>CodeSOD: Waiting for October</title><link>https://thedailywtf.com/articles/waiting-for-october</link><category>CodeSOD</category><pubDate>Tue, 17 Feb 2026 06:30:00 GMT</pubDate><guid>https://thedailywtf.com/articles/waiting-for-october</guid><description>&lt;p&gt;Arguably, the worst moment for date times was the shift from Julian to Gregorian calendars. The upgrade took a long time, too, as some countries were using the Julian calendar over 300 years from the official changeover, famously featured in the likely aprochryphal story &lt;a href="https://en.wikipedia.org/wiki/Russian_Empire_at_the_1908_Summer_Olympics"&gt;about Russia arriving late for the Olympics&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At least that change didn&amp;#39;t involve adding any extra months, unlike some of the Julian reforms, which involved adding multiple &amp;#34;intercalary months&amp;#34; to get the year back in sync after missing a pile of leap years.&lt;/p&gt;
&lt;p&gt;Speaking of adding months, &lt;strong&gt;Will J&lt;/strong&gt; sends us this &amp;#34;calendar&amp;#34; enum:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-cpp"&gt;&lt;span class="hljs-keyword"&gt;enum&lt;/span&gt; &lt;span class="hljs-title class_"&gt;Calendar&lt;/span&gt;
{
    April = &lt;span class="hljs-number"&gt;0&lt;/span&gt;,
    August = &lt;span class="hljs-number"&gt;1&lt;/span&gt;,
    December = &lt;span class="hljs-number"&gt;2&lt;/span&gt;,
    February = &lt;span class="hljs-number"&gt;3&lt;/span&gt;,
    Friday = &lt;span class="hljs-number"&gt;4&lt;/span&gt;,
    January = &lt;span class="hljs-number"&gt;5&lt;/span&gt;,
    July = &lt;span class="hljs-number"&gt;6&lt;/span&gt;,
    June = &lt;span class="hljs-number"&gt;7&lt;/span&gt;,
    March = &lt;span class="hljs-number"&gt;8&lt;/span&gt;,
    May = &lt;span class="hljs-number"&gt;9&lt;/span&gt;,
    Monday = &lt;span class="hljs-number"&gt;10&lt;/span&gt;,
    November = &lt;span class="hljs-number"&gt;11&lt;/span&gt;,
    October = &lt;span class="hljs-number"&gt;12&lt;/span&gt;,
    PublicHoliday = &lt;span class="hljs-number"&gt;13&lt;/span&gt;,
    Saturday = &lt;span class="hljs-number"&gt;14&lt;/span&gt;,
    Sunday = &lt;span class="hljs-number"&gt;15&lt;/span&gt;,
    September = &lt;span class="hljs-number"&gt;16&lt;/span&gt;,
    Thursday = &lt;span class="hljs-number"&gt;17&lt;/span&gt;,
    Tuesday = &lt;span class="hljs-number"&gt;18&lt;/span&gt;,
    Wednesday = &lt;span class="hljs-number"&gt;19&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Honestly, the weather in &lt;code&gt;PublicHoliday&lt;/code&gt; is usually a bit too cold for my tastes. A little later into the spring, like &lt;code&gt;Saturday&lt;/code&gt;, is usually a nicer month.&lt;/p&gt;
&lt;p&gt;Will offers the hypothesis that some clever developer was trying to optimize compile times: obviously, emitting code for one enum &lt;em&gt;has&lt;/em&gt; to be more efficient than emitting code for &lt;em&gt;many&lt;/em&gt; enums. I think it more likely that someone just wanted to shove all the calendar stuff into one bucket.&lt;/p&gt;
&lt;p&gt;Will further adds:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One of my colleagues points out that the only thing wrong with this enum is that September should be before Sunday.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes, arguably, since this enum clearly was meant to be sorted in alphabetical order, but that raises the question of: &lt;em&gt;should it really&lt;/em&gt;?&lt;/p&gt;
&lt;!-- Easy Reader Version: October's gone from being named the 8th month and being the 10th to being the 13th, which boy- can you imagine if Halloween fell on a Friday the 13th one year? The movie crossover alone! --&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>30</slash:comments><wfw:comment>https://thedailywtf.com/articles/comments/waiting-for-october</wfw:comment></item></channel></rss>