{"id":30899,"date":"2016-02-29T22:16:06","date_gmt":"2016-03-01T03:16:06","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=30899"},"modified":"2016-02-29T22:16:06","modified_gmt":"2016-03-01T03:16:06","slug":"experienced-points-undertale-and-curly-braces","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=30899","title":{"rendered":"Experienced Points: Undertale and Curly Braces"},"content":{"rendered":"<p>My column this week answers <a href=\"http:\/\/www.escapistmagazine.com\/articles\/view\/video-games\/columns\/experienced-points\/16797-Experienced-Points-Undertale-and-Curly-Braces\">some reader questions about the public reaction to Undertale, the use of 2K textures in games, and to the use of curly braces in programming<\/a>. <\/p>\n<p>There&#8217;s a lot more that could be said about curly braces vs. indentation for denoting blocks of code. I wouldn&#8217;t be surprised if someone&#8217;s written a whole book on the subject. This is because code formatting isn&#8217;t a decision tree between &#8220;right&#8221; and &#8220;wrong&#8221; but instead a series of trade-offs to be managed. <\/p>\n<p>A coder will spend more time reading code than writing code, so making readable code is more important than than making code convenient to write. Sometimes reading code involves analyzing each line and figuring out exactly what it does, and sometimes it means skimming quickly through pages of the stuff, looking for one particular thing. Ideally code should facilitate both types of reading. <\/p>\n<p>But what makes something &#8220;readable&#8221;? <\/p>\n<p>Maybe you want blank lines between code blocks, which serve roughly the same purpose as the blank space between the paragraphs in this post. It divides the thoughts on a conceptual level, while also giving you visual markers so you can keep track of your position. Or maybe you want to minimize the number of blank lines, because you want to fit as much code onto a single page as possible.<\/p>\n<p>Once again, it comes down to domain. Some kinds of coding have huge blocks of dense math and you want to give the complexity some breathing room. Other code has lots of short, obvious actions and you want to pack as much of it together as you can. So you end up with a coder who writes simulations getting in an argument with someone who writes user interfaces, and a networking programmer will be sniping at both of them. All three people have very different code. When the simulation guy advocates giving code more room to breathe, the woman writing user interface code imagines the impact this policy would have on her already-sprawling code. They end up in a flame war, because they picture using the other person&#8217;s formatting on their own code. <\/p>\n<p>This isn&#8217;t helped by our need to standardize. You want one set of rules for everyone to follow so your project isn&#8217;t a mishmash of different formatting styles. But that One Set of Rules will work better in some areas than others. And of course, once you&#8217;re used to a particular set of rules then it starts to look more &#8220;correct&#8221; out of simple familiarity.<\/p>\n<p>It&#8217;s a tough problem to solve, and it doesn&#8217;t help that our projects keep getting bigger. More code, more different kinds of code, and more different programmers working on the same code. It could be that obsessing over spacing is just an awkward phase we&#8217;re going through, and what we really need are more tools for easing the burden of reading code. Maybe some sort of visual cues for code flow, or new ways of coloring code, or something else outlandish that hasn&#8217;t even been imagined yet. Maybe we need to write more robust comments not for ourselves, but for the benefit of some Google-esque code search engine. In the meantime, we&#8217;re going to be left haggling over stuff like spacing, because right now that&#8217;s all we&#8217;ve got.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My column this week answers some reader questions about the public reaction to Undertale, the use of 2K textures in games, and to the use of curly braces in programming. There&#8217;s a lot more that could be said about curly braces vs. indentation for denoting blocks of code. I wouldn&#8217;t be surprised if someone&#8217;s written [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[560],"class_list":["post-30899","post","type-post","status-publish","format-standard","hentry","category-weekly-column","tag-undertale"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/30899","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=30899"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/30899\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}