"value":"\n <p>This week, I needed to investigate and fix a bug within some existing code.<\/p>\n\n<p>It's code written some time ago and not by anyone working on the team.<\/p>\n\n<p>The code wasn't very readable, so before I could fix the bug, I needed to figure out what the code was supposed to be doing.<\/p>\n\n<p>I started to write a list of things that would make the code easier to read and understand - no single-letter variable names, reduced levels of indentation and splitting some nested ternary operators to use separate return statements.<\/p>\n\n<p>I also watched a video of a conference talk titled \"Writing code you won't hate tomorrow\", which re-introduced me to Object Callisthenics.<\/p>\n\n<p>They are from \"The ThoughtWorks Anthology\" book and are some steps that include some of the points that I had written:<\/p>\n\n<ol>\n<li>Use only one level of indentation per method.<\/li>\n<li>Don\u2019t use the else keyword.<\/li>\n<li>Wrap all primitives and strings.<\/li>\n<li>Use only one dot per line.<\/li>\n<li>Don\u2019t abbreviate.<\/li>\n<li>Keep all entities small.<\/li>\n<li>Don\u2019t use any classes with more than two instance variables.<\/li>\n<li>Use first-class collections.<\/li>\n<li>Don\u2019t use any getters\/setters\/properties<\/li>\n<\/ol>\n\n<p>As well as the original book, there are numerous blog posts and videos on this topic.<\/p>\n\n<p>Why try some of them on the next code you write and see if it's easier to read and understand?<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>This week, I needed to investigate and fix a bug within some existing code.<\/p>\n\n<p>It's code written some time ago and not by anyone working on the team.<\/p>\n\n<p>The code wasn't very readable, so before I could fix the bug, I needed to figure out what the code was supposed to be doing.<\/p>\n\n<p>I started to write a list of things that would make the code easier to read and understand - no single-letter variable names, reduced levels of indentation and splitting some nested ternary operators to use separate return statements.<\/p>\n\n<p>I also watched a video of a conference talk titled \"Writing code you won't hate tomorrow\", which re-introduced me to Object Callisthenics.<\/p>\n\n<p>They are from \"The ThoughtWorks Anthology\" book and are some steps that include some of the points that I had written:<\/p>\n\n<ol>\n<li>Use only one level of indentation per method.<\/li>\n<li>Don\u2019t use the else keyword.<\/li>\n<li>Wrap all primitives and strings.<\/li>\n<li>Use only one dot per line.<\/li>\n<li>Don\u2019t abbreviate.<\/li>\n<li>Keep all entities small.<\/li>\n<li>Don\u2019t use any classes with more than two instance variables.<\/li>\n<li>Use first-class collections.<\/li>\n<li>Don\u2019t use any getters\/setters\/properties<\/li>\n<\/ol>\n\n<p>As well as the original book, there are numerous blog posts and videos on this topic.<\/p>\n\n<p>Why try some of them on the next code you write and see if it's easier to read and understand?<\/p>\n\n ",