{"id":1303,"date":"2014-10-17T04:21:08","date_gmt":"2014-10-17T11:21:08","guid":{"rendered":"http:\/\/10kdev.net\/?p=1303"},"modified":"2014-10-20T04:06:49","modified_gmt":"2014-10-20T11:06:49","slug":"hero-time","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1303","title":{"rendered":"Hero Time!"},"content":{"rendered":"<div id=\"attachment_1304\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/tumblr_lfahidyVt41qeho4oo1_500.jpg\"><img aria-describedby=\"caption-attachment-1304\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-1304 size-medium\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/tumblr_lfahidyVt41qeho4oo1_500-300x235.jpg\" alt=\"tumblr_lfahidyVt41qeho4oo1_500\" width=\"300\" height=\"235\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/tumblr_lfahidyVt41qeho4oo1_500-300x235.jpg 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/tumblr_lfahidyVt41qeho4oo1_500.jpg 500w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1304\" class=\"wp-caption-text\">I&#8217;m Comin&#8217;, Maw! I&#8217;ll save yer application!<\/p><\/div>\n<p>When I start to look at the cost of leaving quality to the wayside I&#8217;m reminded of an experience I had with a coder, Big Hero.<\/p>\n<p>Now back when I was a *high school athlete* in American football our coach coined a term: <strong>dummy hero<\/strong>.\u00a0 Football has a practice fixture called a <em>scout team<\/em> &#8212; the group that practices against the starters to help the starters get ready for a game. \u00a0\u00a0A dummy hero is on the scout team, and <em>pretends<\/em> they do not know the play that is being practiced, but as everyone they actually do; everyone does because its repetitious practice. \u00a0But instead of playing it straight,\u00a0 the dummy hero would make a heroic effort and come up with an interception or run a touchdown even though the point of the exercise was to have the starters practice.\u00a0 They interfered with practice to make themselves look good.<\/p>\n<p><strong>Big Hero<\/strong> types are dummy heroes. \u00a0In their case they break things and fix them in the nick of time. \u00a0They could pay attention to quality, but do not; writing off deliberate, methodology for the thrill of late night release parties. \u00a0And chances to be a hero.<\/p>\n<p><!--more--><\/p>\n<p>On this project, Big Hero never wrote any tests and inserted mundane coding techniques into the company&#8217;s code base so that he could brag about it during status meetings. Sometimes it would be single classes with anonymous functions and embedded, clever, singleton enumerations. Or using Comparator to do business logic. Heck I even ran into a <em><strong>return out of a final block<\/strong> <\/em>from\u00a0Big Hero.<\/p>\n<p>In this incident, Big Hero put in\u00a0a recursion. \u00a0Clever! \u00a0Honestly I rarely ever use recursion, the last time I did was in a JavaScript menu tree. \u00a0Writing OOPs in Java I am much more likely to write iterative, broken out methods\u00a0to make them readable and testable. \u00a0But that&#8217;s just taste.<\/p>\n<p>At the big meeting I remember Big Hero talking about it and getting major accolades from some QA and management \u00a0for putting recursion into his new class. \u00a0The build master and I met eyes at that time and almost started to laugh: \u00a0defect after defect was passing from\u00a0this class. \u00a0It was a DefectFactory. \u00a0Heck, an AbstractDefectFactory &#8212; since it was the thorax in the spider graph.<\/p>\n<p>So, we went on down to our local Sonar and looked it up. \u00a0And here are the actual metrics on this class. \u00a0(If you are wondering, I save pictures of ridiculous things over the years and their narratives.)<\/p>\n<p>A Cyclomatic Index of \u00a0288 for this class. \u00a0The method itself had a 19. \u00a0The general recommendation for a whole class is usually 10-15.<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/Screenshot-from-2014-10-14-134257.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-1306 size-full\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/Screenshot-from-2014-10-14-134257.png\" alt=\"Screenshot from 2014-10-14 13:42:57\" width=\"751\" height=\"224\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/Screenshot-from-2014-10-14-134257.png 751w, http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/Screenshot-from-2014-10-14-134257-300x89.png 300w\" sizes=\"(max-width: 751px) 100vw, 751px\" \/><\/a><\/p>\n<p>A Sonar pass showed 340 major issues.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-1307 size-full\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/Screenshot-from-2014-10-14-134325.png\" alt=\"Screenshot from 2014-10-14 13:43:25\" width=\"763\" height=\"188\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/Screenshot-from-2014-10-14-134325.png 763w, http:\/\/10kdev.net\/wp-content\/uploads\/2014\/10\/Screenshot-from-2014-10-14-134325-300x73.png 300w\" sizes=\"(max-width: 763px) 100vw, 763px\" \/><\/p>\n<p>There was zero code coverage on it, of course, and it was in production.<\/p>\n<p>Over the weeks we watched as this and other classes like this repeatedly broke. \u00a0I saw the build manager (who was a developer peeled off from the group) beg Big Hero not to do certain changes. \u00a0But there was no stopping Don Quodote&#8211; and a management loved the spit Big Hero\u00a0put on his shine. \u00a0Maybe, in the end, that&#8217;s all that&#8217;s important. \u00a0That and how much it cost to do work like that . . .<\/p>\n<p>To this day I still get a chuckle\u00a0out of that meeting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I start to look at the cost of leaving quality to the wayside I&#8217;m reminded of an experience I had with a coder, Big Hero. Now back when I was a *high school athlete* in American football our coach coined a term: dummy hero.\u00a0 Football has a practice fixture called a scout team &#8212; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,14,17],"tags":[50,71,73,72],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1303"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1303"}],"version-history":[{"count":14,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1303\/revisions"}],"predecessor-version":[{"id":1323,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1303\/revisions\/1323"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1303"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}