{"id":1225,"date":"2010-12-02T00:32:38","date_gmt":"2010-12-02T05:32:38","guid":{"rendered":"https:\/\/zingman.com\/blog\/?p=1225"},"modified":"2010-12-02T00:32:38","modified_gmt":"2010-12-02T05:32:38","slug":"practicing-the-poetry-of-curly-braces","status":"publish","type":"post","link":"https:\/\/www.zingman.com\/blog\/2010\/12\/02\/practicing-the-poetry-of-curly-braces\/","title":{"rendered":"Practicing the Poetry of Curly Braces"},"content":{"rendered":"<p>For all the pressure and tumult at my job that last few months, here&#8217;s one good result: I&#8217;m writing the best code I&#8217;ve ever written.  I feel like I&#8217;ve leveled as a programmer (this seems to happen every 6 mos. to a year with me as I integrate things I&#8217;ve been learning) and can now do up to 186 points of damage with a single line of code.<\/p>\n<p>I just spent the evening finishing off a huge feature set that had been my main focus the last 2 months or so.  Tonight it was just cleaning up code finishing off a few loose ends, but I was able to sit back and look at my code and say, woah, that&#8217;s beautiful.<\/p>\n<p>It&#8217;s a bit like Denny Diaz says about the mu chord: you have to practice it until you can do it without thinking about it.  So it&#8217;s been with me and lots of best practices and design patterns that I used to work hard to implement and now they just sort of come to me as my first idea on how to approach things.<\/p>\n<p>A few specific things I&#8217;ve really been focused on down in the details dancing with the devil.  One is to never repeat any code.  Ever.  Everyone copies and pastes blocks of codes, and I used to be much more tolerant of it.  Now whenever I temped to do that, I look at the block and make it into its own method and call it from wherever I was going to paste it.  The other thing is I&#8217;ve been breaking methods up and writing shorter and shorter methods.  I&#8217;ve had as a rule of thumb that if a method doesn&#8217;t fit on a screen its too long.  Now I&#8217;m thinking more and more that in many cases over half a screen is too long.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>For all the pressure and tumult at my job that last few months, here&#8217;s one good result: I&#8217;m writing the best code I&#8217;ve ever written. I feel like I&#8217;ve leveled as a programmer (this seems to happen every 6 mos. to a year with me as I integrate things I&#8217;ve been learning) and can now &hellip; <a href=\"https:\/\/www.zingman.com\/blog\/2010\/12\/02\/practicing-the-poetry-of-curly-braces\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Practicing the Poetry of Curly Braces&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-1225","post","type-post","status-publish","format-standard","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/posts\/1225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/comments?post=1225"}],"version-history":[{"count":0,"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/posts\/1225\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/media?parent=1225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/categories?post=1225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zingman.com\/blog\/wp-json\/wp\/v2\/tags?post=1225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}