<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?>
<?xml-stylesheet type="text/css" media="screen" href="http://syndication.thedailywtf.com/~d/styles/itemcontent.css"?>
<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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
  <channel>
    <title>The Daily WTF</title>
    <link>http://thedailywtf.com/</link>
    <description>Curious Perversions in Information Technology</description>
    <lastBuildDate>Wed, 26 Apr 2017 15:51:14 GMT</lastBuildDate>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://syndication.thedailywtf.com/TheDailyWtf" />
    <feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="thedailywtf" />
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />
    <geo:lat>41.36995</geo:lat>
    <geo:long>-81.862591</geo:long>
    <item>
      <dc:creator>Remy Porter</dc:creator>
      <title>CodeSOD: This Hits an Association</title>
      <link>http://thedailywtf.com/articles/this-hits-an-association</link>
      <category>CodeSOD</category>
      <pubDate>Wed, 26 Apr 2017 10:30:00 GMT</pubDate>
      <guid>http://thedailywtf.com/articles/this-hits-an-association</guid>
      <description>&lt;p&gt;I recently have needed to write some systems that do analysis on a stream of samples. The target stream of the analysis process was stored in a variable &lt;code&gt;targetOfAnal&lt;/code&gt;, because obviously, that&amp;#8217;s more efficient to type than &lt;code&gt;targetOfAnalysis&lt;/code&gt;. I of course needed an &lt;code&gt;analProcess&lt;/code&gt; and &lt;code&gt;analComplete&lt;/code&gt; flag, and yes, my inner &lt;span onclick="cornify_add();return false;" title="click me!"&gt;13-year old&lt;/span&gt;&lt;script type="text/javascript" src="http://www.cornify.com/js/cornify.js"&gt;&lt;/script&gt; was snickering the entire time. &lt;!-- It's pronounced "an-al-rap-ist". --&gt;&lt;/p&gt;
      
      &lt;p&gt;&lt;strong&gt;James&lt;/strong&gt;&amp;#8217;s co-worker decided to demonstrate that immature dirty jokes should only be taken so far. James heard him cursing up a storm, and thus offered to help debug whatever the problem was. You could say this code i&lt;strong&gt;s hit&lt;/strong&gt;ting the &amp;#8220;dirty variable names&amp;#8221; button a bit too hard. I present it here without modification, because honestly, there is no way to censor this code and have it convey its full meaning. Ready your alt-tab before the boss comes by:&lt;/p&gt;
      &lt;pre&gt;&lt;code class="cpp"&gt;
      for(int ishit = 0; ishit &amp;lt; shit.size(); ++ishit) {
      shitareas.clear();
      shitsubareas.clear();
      if(messed_up_order) {
      messed_up_order = false;
      continue;
      }
      if(shit[ishit].areas != &amp;quot;&amp;quot; || shit[ishit].subareas != &amp;quot;&amp;quot;) {
      if(shit[ishit].areas == &amp;quot;&amp;quot; &amp;amp;&amp;amp; shit[ishit].subareas != &amp;quot;&amp;quot; &amp;amp;&amp;amp; ishit+1&amp;lt;shit.size()) {
      messed_up_order = true;
      }
      if(shit[ishit].areas != &amp;quot;&amp;quot;) {
      auto shitstart = shit[ishit].areas.begin();
      auto shitend = shit[ishit].areas.begin();
      while(shitend != shit[ishit].areas.end()) {
      shitend = search(shitstart, shit[ishit].areas.end(), delim.begin(), delim.end());
      string asdf(shitstart,shitend);
      shitareas.push_back(asdf);
      shitstart = shitend + delim.size();
      }
      }
      if(shit[ishit].subareas != &amp;quot;&amp;quot;) {
      auto shitstart = shit[ishit].subareas.begin();
      auto shitend = shit[ishit].subareas.begin();
      while(shitend != shit[ishit].subareas.end()) {
      shitend = search(shitstart, shit[ishit].subareas.end(), delim.begin(), delim.end());
      string asdf(shitstart,shitend);
      shitsubareas.push_back(asdf);
      shitstart = shitend + delim.size();
      }
      }
      if(messed_up_order) {
      auto shitstart = shit[ishit+1].areas.begin();
      auto shitend = shit[ishit+1].areas.begin();
      while(shitend != shit[ishit+1].areas.end()) {
      shitend = search(shitstart, shit[ishit+1].areas.end(), delim.begin(), delim.end());
      string asdf(shitstart,shitend);
      shitareas.push_back(asdf);
      shitstart = shitend + delim.size();
      }
      }
      }
      }&lt;/code&gt;&lt;/pre&gt;
      
      &lt;p&gt;It&amp;#8217;s a bit cheap to say this code is remarkably self-describing, but this is clearly a mishit. It&amp;#8217;s crass as the dickens. If this developer was paid in cash, it wouldn&amp;#8217;t surprise me. Imagine the code review- bet it would have been quite the pisser.&lt;/p&gt;
      
      &lt;p&gt;Honestly, it&amp;#8217;s variable &lt;code&gt;asdf&lt;/code&gt; that&amp;#8217;s the worst thing here, but maybe that&amp;#8217;s because I type Dvorak.&lt;/p&gt;
      &lt;!-- Easy Reader Version: Heh, he said "shit". Heh. --&gt;
      &lt;link rel="stylesheet" href="http://thedailywtf.com/images/highlight/styles/github.css"&gt;
      &lt;script src="http://thedailywtf.com/images/highlight/highlight.pack.js"&gt;&lt;/script&gt;
      &lt;script&gt;hljs.initHighlightingOnLoad();&lt;/script&gt;
      &lt;div&gt;
      &lt;img src="http://thedailywtf.com/images/footer/release50.png" style="display:block; float: left; margin: 0 10px 10px 0;" /&gt;
      [Advertisement] &lt;a href="http://inedo.com/release?utm_source=tdwtf&amp;utm_medium=footer&amp;utm_content=bmgeneric&amp;utm_campaign=dailywtf15"&gt;Release!&lt;/a&gt;
      is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
      &lt;/div&gt;
      &lt;div style="clear: left;"&gt; &lt;/div&gt;&lt;div class="feedflare"&gt;
      &lt;a href="http://syndication.thedailywtf.com/~ff/TheDailyWtf?a=v51HJrxZlAg:gQjtO9DkqMs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/TheDailyWtf?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
      &lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDailyWtf/~4/v51HJrxZlAg" height="1" width="1" alt=""/&gt;</description>
      <slash:comments>14</slash:comments>
      <wfw:comment>http://thedailywtf.com/articles/comments/this-hits-an-association</wfw:comment>
    </item>
</channel>
</rss>
