[Bluej-discuss] style extensions
Stephen Bloch
sbloch at adelphi.edu
Mon May 14 04:39:55 BST 2007
Ian Barland wrote:
>Has anybody written a BlueJ extension for indenting (for students who didn?t
>write their code top-to-bottom, or who didn?t respect BlueJ?s suggested
>indenting)?
I don't know of one, but I too would like one.
>Also, on the extensions page I see a CheckStyle extension, which looks for
>?industrial-strength? style issues. I?m planning on writing an extension
>which looks for more beginner-level problems. If anybody has already done
>this, I?d be interested in seeing how they went about it. (Or drop me a
>line if you just want to chat about the notion.)
CheckStyle is so enormously customizable that it applies to
beginner-level problems as well as "industrial-strength" issues. For
example, my sole contribution to CheckStyle was a check named
RequireThis, which complains if you refer to instance variables or
methods of your own class without a "this." in front. If you want to
allow "this"-less access to variables but not methods, or vice versa,
that's fine too. No professional Java programmer in the world needs
or wants that, but it's useful in CS1. Likewise, you can turn on
checks for "redundant boolean logic", e.g.
if (blah > snark)
return true;
else
return false;
You can turn on checks for the maximum number of lines in a method,
or the maximum nesting complexity of a method, or all sorts of other
things that help in teaching first-year students.
--
Stephen Bloch
sbloch at adelphi.edu
More information about the bluej-discuss
mailing list