{"id":5777,"date":"2016-12-08T15:21:00","date_gmt":"2016-12-08T20:21:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=5777"},"modified":"2016-12-08T15:21:21","modified_gmt":"2016-12-08T20:21:21","slug":"zamansky-live-codes-advent-of-code-2016-2","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=5777","title":{"rendered":"Zamansky Live Codes Advent of Code 2016 #2"},"content":{"rendered":"<p> <a href=\"http:\/\/cestlaz.github.io\">Mike Zamansky<\/a> who is, after all, a teacher, demonstrates his coding technique by <a href=\"http:\/\/cestlaz.github.io\/posts\/advent-of-code-2016-2\/#.WEm5yneZOuU\">live coding the second exercise in the 2016 Advent of Code<\/a>. He is coding in C++ because that&rsquo;s what he&rsquo;s teaching at the moment but even if, like me, it&rsquo;s not your favorite language, it&rsquo;s still a nice introduction to a certain style of coding. <\/p>\n<p> That style is basically ensuring that each little piece of your code is working before you move onto to the next piece. That&rsquo;s the technique that I use and love when I&rsquo;m coding in Lisp. The REPL makes it really easy because you can execute a single statement and see what the result is without having to add special scaffolding. It&rsquo;s a little harder in a C-like language but not, as Zamansky shows, impossible. <\/p>\n<p> Note that this is a bit different from Test Driven Development. You&rsquo;re merely trying to discover your errors as soon as possible rather than trying for a rigorous demonstration of correctness at each step. Since starting to program in Lisp, I use this technique no matter what language I&rsquo;m using. Still, it works best in a REPL-driven language like Lisp. <\/p>\n<p> Another point the video makes is the importance of data representation. By choosing a good representation you can reduce the complexity of your code and also make it easier to adjust to changes in the specifications of the problem you&rsquo;re trying to solve. <\/p>\n<p> The video is 17 minutes so plan accordingly. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mike Zamansky who is, after all, a teacher, demonstrates his coding technique by live coding the second exercise in the 2016 Advent of Code. He is coding in C++ because that&rsquo;s what he&rsquo;s teaching at the moment but even if, &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=5777\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[17,161],"class_list":["post-5777","post","type-post","status-publish","format-standard","hentry","category-programming","tag-c","tag-coding"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5777"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5777\/revisions"}],"predecessor-version":[{"id":5778,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5777\/revisions\/5778"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}