{"id":1029,"date":"2009-08-11T00:32:58-04:00","date_gmt":"2009-08-11T04:32:58+00:00","guid":{"rendered":"http:\/\/peterjanes.ca\/blog\/?p=1029"},"modified":"2009-08-11T00:32:58-04:00","modified_gmt":"2009-08-11T04:32:58+00:00","slug":"kool-aid-drinking-the","status":"publish","type":"post","link":"https:\/\/peterjanes.ca\/blog\/2009\/08\/11\/kool-aid-drinking-the\/","title":{"rendered":"Kool-Aid, drinking&nbsp;the"},"content":{"rendered":"<div class='e-content'><p>At work, I&#8217;ve finally had a chance to apply some of the practices I&#8217;ve been reading about (and advocating) for months.  Foremost among them are the related concepts of test-driven development, (proper) unit testing, dependency injection and the principle of least knowledge (aka the Law of Demeter).<\/p>\r\n\r\n<p>And what do you know: they actually <em>work<\/em>!<\/p>\r\n\r\n<p>I&#8217;ve also wound up doing quite a bit of refactoring&#8212;mostly, as someone (maybe Michael Feathers?) put it, of &#8220;new legacy&#8221; code, stuff that&#8217;s been written in the last few months (not by me) which is full of <a href=\"http:\/\/misko.hevery.com\/code-reviewers-guide\/flaw-brittle-global-state-singletons\/\">global state<\/a> and complex un-mockable setup.  Most of that has been scattershot\/mercenary work to make life easier for myself, rather than a concerted effort to rebuild the foundations without tearing down the walls, but I think I&#8217;ve made some incremental improvements that will help in the long run.<\/p>\r\n\r\n<p>Now I just have to get the rest of the source control\/build monkeys off my back.  A few months ago I&#8217;d almost divested myself of one, through no small or short-lived effort, but just when I thought I was out&#8230;.<\/p><\/div><div class=\"syndication-links\"><\/div>","protected":false},"excerpt":{"rendered":"At work, I&#8217;ve finally had a chance to apply some of the practices I&#8217;ve been reading about (and advocating) for months. Foremost among them are the related concepts of test-driven development, (proper) unit testing, dependency injection and the principle of least knowledge (aka the Law of Demeter). And what do you know: they actually work!&hellip;","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":[],"venue_id":0},"categories":[3],"tags":[],"kind":false,"_links":{"self":[{"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/posts\/1029"}],"collection":[{"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/comments?post=1029"}],"version-history":[{"count":1,"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/posts\/1029\/revisions"}],"predecessor-version":[{"id":1030,"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/posts\/1029\/revisions\/1030"}],"wp:attachment":[{"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/media?parent=1029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/categories?post=1029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peterjanes.ca\/blog\/wp-json\/wp\/v2\/tags?post=1029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}