{"id":1453,"date":"2011-10-11T09:01:02","date_gmt":"2011-10-11T16:01:02","guid":{"rendered":"http:\/\/juixe.com\/techknow\/?p=1453"},"modified":"2011-10-08T00:14:26","modified_gmt":"2011-10-08T07:14:26","slug":"run-on-code-statement","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2011\/10\/11\/run-on-code-statement\/","title":{"rendered":"Keep Code Statements Simple"},"content":{"rendered":"<p>I don&#8217;t count my progress by the line of codes but at the same time I don&#8217;t take pride by over engineering a solution.  Writing code is like writing for a publication, you have to know at what reading level you are writing for.  That said, the one type of code statement that gets under my skin is what I call the <b>run-on code statement<\/b>.  A Run-on code statement is one that has multiple method calls in one statement.  Here is a made up example of a run-on code statement.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nDataManager.getInstance().refreshData(obj.getAsInteger().toString());\r\n<\/pre>\n<p>In the above run-on code statement there are four method calls.  I&#8217;ve seen worse.  The reason whey run-on code statements are a pet peeve or mine is that if anyone method call fails because of a NullPointerException or some other error it&#8217;s difficult to quickly know what segment of the code statement failed.  This is also annoying to debug if you want to step into one method out of the four.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t count my progress by the line of codes but at the same time I don&#8217;t take pride by over engineering a solution. Writing code is like writing for a publication, you have to know at what reading level you are writing for. That said, the one type of code statement that gets under [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[15,19,21,3],"tags":[587,575,588,500,804,41],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-nr","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/1453"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=1453"}],"version-history":[{"count":2,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/1453\/revisions"}],"predecessor-version":[{"id":1455,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/1453\/revisions\/1455"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=1453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=1453"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=1453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}