{"id":1218,"date":"2021-10-25T11:19:37","date_gmt":"2021-10-25T10:19:37","guid":{"rendered":"https:\/\/www.muratyaman.co.uk\/blog\/?p=1218"},"modified":"2021-10-25T11:20:10","modified_gmt":"2021-10-25T10:20:10","slug":"serviceimporterpolicytestinterpretercontext","status":"publish","type":"post","link":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/2021\/10\/serviceimporterpolicytestinterpretercontext\/","title":{"rendered":"ServiceImporterPolicyTestInterpreterContext"},"content":{"rendered":"<p>We all agree that we should write code which is easy to understand and maintain.<\/p>\n<p>Check this out and have fun! \ud83d\ude00<br \/>\n<a href=\"https:\/\/projects.haykranen.nl\/java\/\">https:\/\/projects.haykranen.nl\/java\/<\/a><\/p>\n<p>Maybe, the class names should not be like &#8220;ServiceImporterPolicyTestInterpreterContext&#8221; either! \ud83d\ude09<br \/>\nImagine defining a variable of that type:<\/p>\n<p><code><br \/>\nServiceImporterPolicyTestInterpreterContext serviceImporterPolicyTestInterpreterContext = new ServiceImporterPolicyTestInterpreterContext();<br \/>\n<\/code><\/p>\n<p>Now, imagine reading a function with 10 lines of code, full of similar sh*t! More than half the code is not real code! Just <strong>garbage<\/strong>!<\/p>\n<p>Now, consider you have a character limit per line: 100. We have to create 2 lines as our line is 140 characters long!! &#8230;<strong>badly indented<\/strong>, most probably!<\/p>\n<p>In some programming languages, the scope of a code file, which is importing code, can be &#8220;<strong>poisoned<\/strong>&#8221; easily with the code imported from other libraries. that is one of the reasons coders are almost forced to create ridiculously long &#8220;<strong>self-explanatory<\/strong>&#8221; class\/function\/variable names.<\/p>\n<p>IMHO, e.g. local variables in a small function; we can use reasonably short comprehensible names because we have a good narrow context there.<\/p>\n<p>I love the type inference in beautifully designed languages like <strong>Kotlin<\/strong>: <a href=\"https:\/\/kotlinlang.org\/docs\/basic-syntax.html#variables\">https:\/\/kotlinlang.org\/docs\/basic-syntax.html#variables<\/a><br \/>\nsame code above can be (even if we have that stupid class name):<\/p>\n<p><code><br \/>\nvar ctx = new ServiceImporterPolicyTestInterpreterContext();<br \/>\n<\/code><\/p>\n<p>Code is much more readible!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We all agree that we should write code which is easy to understand and maintain.<\/p>\n","protected":false},"author":2,"featured_media":1219,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[47,208],"class_list":["post-1218","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-java","tag-kotlin"],"_links":{"self":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1218"}],"version-history":[{"count":2,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1218\/revisions"}],"predecessor-version":[{"id":1221,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1218\/revisions\/1221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/media\/1219"}],"wp:attachment":[{"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.muratyaman.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}