{"id":1438,"date":"2007-11-29T08:00:47","date_gmt":"2007-11-29T13:00:47","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=1438"},"modified":"2007-11-29T07:37:29","modified_gmt":"2007-11-29T12:37:29","slug":"the-previous-idiot-also-me","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=1438","title":{"rendered":"The Previous Idiot (Also Me)"},"content":{"rendered":"<p>My <a href=\"?p=1391\">post on programming<\/a> the other day elicited a surprising number of responses.  I had no idea that many coders visited this site.  Compare this to my post on the <a href=\"?p=1437\">Half-Life 2 fan commentary<\/a>, which barely elicited a shrug.  Considering that this is a blog ostensibly about tabletop games and videogames, you&#8217;d expect the opposite reaction.  <\/p>\n<p>There was a comment in there (but I can&#8217;t find it now, dangit!) where someone mentioned cringing at their early code and wanting to tear it out and re-write it.  I&#8217;m going through that now with PHP.  A couple of years ago I had to write some complex (to me) PHP for my job.  Up until that point the only PHP I&#8217;d done was mucking about with WordPress themes.  Simple stuff.  But I suddenly found myself needing to write professional-grade code (instead of half-assed hobby code) which needed to interface databases, process complex form data, and do a bunch of other stuff I&#8217;d never had to deal with before.  I needed to make my code readable to my eventual successor (or my future self) and I needed to idiot-proof the thing.  As icing on the cake, the time budget for this project was more or less devised with the assumption that the guy writing the code knew what he was doing. Which I didn&#8217;t.<\/p>\n<p>(Things like this happen needlessly in large companies, but I work for a small company and sometimes us little guys have to survive on our wits and duct tape.  We can&#8217;t just run out and hire someone every time we have a gap in our knowledge.  Sometimes this MacGuyver style development can be exciting, but sometimes it&#8217;s just annoying, and you&#8217;d rather just have the big pile of money required to do it right.) <\/p>\n<p>I was both in a hurry and learning as I went, which is a great way to take newbie mistakes and set them firmly in stone.  I got through it and finished the job, but now I look back on that old PHP code and I cringe.  I could probably do the whole thing in half as many lines of code, make it more readable, and make it more re-usable, but there isn&#8217;t much of a justification for doing so.  It works just fine and my time is needed elsewhere. But the fact that there is this snarl of ugly code under the hood bothers me whenever I use it.  <\/p>\n<p>Coders are used to the sensation of looking at a block of code and wincing, &#8220;What idiot wrote this mess?&#8221;  It&#8217;s a rotten situation when that idiot is yourself.<\/p>\n<p>By the way, if you want to nitpick my code and point out all of my crimes against C++, you can check out my <a href=\"?p=141\">terrain project<\/a>.  The final page gives the <a href=\"?p=202\">source code<\/a>.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>My post on programming the other day elicited a surprising number of responses. I had no idea that many coders visited this site. Compare this to my post on the Half-Life 2 fan commentary, which barely elicited a shrug. Considering that this is a blog ostensibly about tabletop games and videogames, you&#8217;d expect the opposite [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[524],"class_list":["post-1438","post","type-post","status-publish","format-standard","hentry","category-personal","tag-programming"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/1438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1438"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/1438\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}