{"id":13,"date":"2006-07-22T14:38:18","date_gmt":"2006-07-22T13:38:18","guid":{"rendered":"http:\/\/www.bluej.org\/mrt\/?p=7"},"modified":"2020-05-15T15:46:31","modified_gmt":"2020-05-15T15:46:31","slug":"to-complete-or-not-to-complete","status":"publish","type":"post","link":"https:\/\/blogs.kcl.ac.uk\/proged\/2006\/07\/22\/to-complete-or-not-to-complete\/","title":{"rendered":"To complete or not to complete"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bluej.org\/mrt\/wp-content\/uploads\/2006\/07\/complete.jpg\" border=\"1\" alt=\"Complete\" hspace=\"12\" vspace=\"4\" width=\"473\" height=\"193\" \/><br \/>\nSome thoughts on auto-completion and auto-formatting.<br \/>\nAt the BlueJ team, we regularly get requests for new features. Two of the most requested features are auto-completion (of method names, imports and fields) and auto-formatting (a.k.a. &#8220;pretty-printing&#8221;) of code.<\/p>\n<p>We have had these discussion since the very first release of BlueJ. So far, I have always refused to include these features. Is it time to re-think?<\/p>\n<p><!--more--><br \/>\nShould the BlueJ editor (&#8220;Moe&#8221;, as it is internally known) support automatic code formatting?<\/p>\n<p>This question appeared on bluej-discuss last week again, as it did many times in the past.<\/p>\n<p>So far, I have always argued against it. My argument is this: If students have this tool, they will get used to using it. By doing this, they will never have to think about doing indentation manually, and may not even appreciate the value of correct indentation (which you only notice once it is not there).<\/p>\n<p>Then, when they leave BlueJ, as they inevitably will, if they end up in an environment that does not offer this feature, they are unable to do indentation properly. To teach the value and skill of indentation, students have to do it. Then, later, when you know you can do it, you can use a tool to automate it.<\/p>\n<p>A similar discussion is popping up regularly about code completion.<\/p>\n<p>Code completion, undoubtedly, is a very helpful tool to programmers. But the question is: does it help in <em>learning<\/em> to program?<\/p>\n<p>My worry is that code completion may be used by students as an alternative to reading documentation. When you need a method, instead of going to the javadoc pages, you just hit the dot, and make a wild guess just by method name which one may be the method you want. Now, this technique may be moderately successful for people who more or less know what they are doing, but I would not want to teach it as a strategy to my students.<\/p>\n<p>The danger plainly is: the presence of code completion may train bad habits, and prevent good ones.<\/p>\n<p>(Note that I do not have anything at all against code completion for competent programmers. On the contrary &#8211; it&#8217;s a wonderful tool.)<\/p>\n<p>Based on this reasoning, I have so far refused to add code completion or automatic formatting to Moe.<\/p>\n<p>But should I change my mind?<\/p>\n<p>During the original design of BlueJ and its editor, my guideline was always that the BlueJ editor should support all the functionality that is available in every standard work environment. But it should not automate important concepts that you may need to do manually later.<\/p>\n<p>It seems to me that the goal posts are shifting. Today, just about every reasonable Java environment has code completion. Now, if this is becoming a standard feature that we can reasonably expect to be available wherever you work, then a large part of the argument against supporting it goes away.<\/p>\n<p>Based on the principle that we should support the minimal standard toolset, and the assumption that code completion and auto-layout have become standard, we would have to conclude that we should support it now.<\/p>\n<p>Times are changing. Or are they?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some thoughts on auto-completion and auto-formatting. At the BlueJ team, we regularly get requests for new features. Two of the most requested features are auto-completion (of method names, imports and fields) and auto-formatting (a.k.a. &#8220;pretty-printing&#8221;) of code. We have had &hellip; <a href=\"https:\/\/blogs.kcl.ac.uk\/proged\/2006\/07\/22\/to-complete-or-not-to-complete\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":179,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,11,13],"tags":[25,42,107],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-bluej-software-tools","category-software-tools","category-teaching","tag-bluej-software-tools","tag-design","tag-teaching"],"_links":{"self":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/13","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=13"}],"version-history":[{"count":1,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":1074,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/13\/revisions\/1074"}],"wp:attachment":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}