[Bluej-discuss] formatter extension?
Aryeh M. Friedman
aryeh.friedman at gmail.com
Sun Oct 14 07:57:05 BST 2007
First of all I think you made a cardinal error that almost all beginning
programming students make. Style *IS NOT* cosmetics only it goes to the
very core of being a programmer. What I mean by this is the style you
use has been developed over 50 plus years and every single "improvement"
in style has one (and only one) goal:
Allow for the creation of more complex applications without
increasing the conceptual demands placed on the programmer. See "the
mythical man month" and "the psychology of computer programming".
In more theoretical terms one thing experimental cognitive
psychology has taught is what the mental limits on the intuitive
understanding of complex systems is. For example we can not keep more
then 4 to 5 things in short term memory, etc. Thus from a theortical
standpoint 99% of style (and app design) issues are meant to allow us to
ignore certain details that don't matter at the current level of work
(this is why OO is so powerful compared to procedural programming and
why high level langs replaced asm, etc.)
Hedley Finger wrote:
>
> Well, as a STUDENT I believe I can speak with authority on the subject
> of a formatter /extension/ as a representative of my fellow students.
In some fields students (with no previous experience) may be able to say
something is "good" or "bad" (such as essay's even if you have not taken
Eng. Comp. 1). Programming *IS NOT* one of these fields. Liken it to
Picasso he got away with very simplified forms because he *UNDERSTOOD*
the more formalistic methods.
> Second, what has DeMorgan's Law and the Rule of Nine, etc. got to do
> with simple formatting?
I was using them as a example of how unprepared must students are, at
least at the community college level, are for the logic and math
required for programming. Tell me what is easier to understand:
if(a&&b) System.out.println(true); else System.out.println(false);
or
if(a && b)
System.out.println(true);
else
System.out.println(false);
Most beginning students would say it doesn't matter when the second has
been proven by 50 years of collective experience to be far superior to
the first. The reason most of them give is the compilor doesn't
care. This is like saying it doesn't matter if I use English or
American spelling! The reason for this is as the program gets more
complex the indents allow the eye to ignore sections that are not in the
current control thread that I am intrested in. Take this for example:
if(a)
do b;
else
if(b)
do c;
else
do d;
No write it out without indents:
if(a)
do b;
else
if(b)
do c;
else
do d;
Without looking at the code before you start I give you 5 seconds to
tell me when d will be done.... an experienced programmer can do it with
ease with the indented example but not with the second one... I will
leave the reasons why as an exercise for you.
>
> If some of you prefer to bake your own bread and weave your own hair
> shirts on your own home-built loom, so be it, but don't impose your
> preferences on the students as the One True Path to Enlightenment and
> Righteousness. The rest of us, who prefer to slip down to Safeway for
> bread and nextdoor to Target for shirts are not moral lepers for
> desiring to do so.
If this is your preference why are even learning to program... by
definition programming is making your own.
>
> What I can't understand is why no-one is railing against the simple
> automated formatting that BlueJ already does, e.g. tabbing in from the
> opening { of a class when you hit carriage-return, etc.
Like I said in previous post I turn that off for my every day use and
with brand new tutoring students I turn it off.
>
> Is it a crime to want convenience aids? I am using the UML plug-in
> for class diagrams, the SyntaxSourcePrinter for colour printouts of
> code (easier to desk-check) and for exporting colour HTML I can paste
> into OpenOffice.org for assignment submissions,
UML is another example something that is wonderful for *EXPERIENCED*
developers but awful for students... the reason is it hides too much and
you get people who can make very well designed programs but can't write
a program that counts to 10.
> Checkstyle to make sure it is all nice and pretty, etc. Saves an
> absolute swag of time dealing with the cosmetic so I can concentrate
> on the substance -- learning about Java. And as somebody in this list
> remarked, no-one is forcing students to use what are, after all,
> /optional/ plug-ins for BlueJ.
>
> Sure, students might crash and burn. How many Somalian orphans will
> die as a result? Isn't it really like crashing in a aircraft
> simulator -- embarrassing but non-fatal and, ultimately, instructive?
It is better to crash and burn early when it doesn't matter and most
likely to reinforce what you have learned then later in the "real world"
More information about the bluej-discuss
mailing list