{"id":614,"date":"2012-03-18T17:23:34","date_gmt":"2012-03-18T17:23:34","guid":{"rendered":"http:\/\/blogs.kent.ac.uk\/mik\/?p=614"},"modified":"2020-05-15T15:46:56","modified_gmt":"2020-05-15T15:46:56","slug":"joc-22","status":"publish","type":"post","link":"https:\/\/blogs.kcl.ac.uk\/proged\/2012\/03\/18\/joc-22\/","title":{"rendered":"JoC #22: Refactoring for good style"},"content":{"rendered":"<p><em>\u00a0 \u00a0 \u00a0 We are accustomed to see men deride what they do not understand, and snarl<\/em><br \/>\n<em>\u00a0 \u00a0 \u00a0 at the good and beautiful because it lies beyond their sympathies.<\/em><br \/>\n<em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2014 Goethe<\/em><\/p>\n<p>Okay, time to get a little more professional again: Let&#8217;s clean up our code a little.<\/p>\n<p>Writing in good style is really important, so today I&#8217;ll show you a bit about refactoring. Especially, we want to create short, clear methods. (The technical term for it is <em>cohesion<\/em> \u2013 we want <em>highly cohesive<\/em> methods.)<\/p>\n<p><iframe loading=\"lazy\" title=\"The Joy of Code #22: Refactoring for good style\" width=\"584\" height=\"329\" src=\"https:\/\/www.youtube.com\/embed\/MCwTaYX2Vnk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p style=\"text-align: right\"><a href=\"http:\/\/www.greenfoot.org\/static\/joc\/mov\/JOC-22.mov\">Download video<\/a><\/p>\n<p><strong>Concepts discussed<\/strong>: <em>methods,<\/em>\u00a0<em>refactoring, style, cohesion<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 \u00a0 We are accustomed to see men deride what they do not understand, and snarl \u00a0 \u00a0 \u00a0 at the good and beautiful because it lies beyond their sympathies. \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2014 Goethe Okay, &hellip; <a href=\"https:\/\/blogs.kcl.ac.uk\/proged\/2012\/03\/18\/joc-22\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":179,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,6],"tags":[70,103],"class_list":["post-614","post","type-post","status-publish","format-standard","hentry","category-greenfoot-software-tools","category-joy-of-code","tag-method","tag-style"],"_links":{"self":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/users\/179"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/comments?post=614"}],"version-history":[{"count":1,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/614\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/614\/revisions\/1090"}],"wp:attachment":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/media?parent=614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/categories?post=614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/tags?post=614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}