James,
Since I get my posting in the digest form from
bluej-discuss-request@bluej.org
I am reacting to (no later update as of
Nov 11 '05, 11 A.M. ET),
I did get one nibble from :
From: bluej-discuss-request@bluej.org
Reply-To: bluej-discuss@bluej.org
To: bluej-discuss@bluej.org
Subject: bluej-discuss Digest, Vol 29, Issue 5
Date: Fri, 11 Nov 2005 02:48:02 +0000
Message # 9
.............
Re: Select All and Indent (W.E.Taylor)
......start of snip ......
You can just select what you want to indent, one line or all lines, and
then select 'indent more'.
......end of snip ......
I am really at a loss to explain differently what it is I am looking
for.
I think that I am looking for programming feature in BlueJ that will
properly indent lines of code all at once using a click "select all"
then a second click "indent line(s)" according to that algorithm that
will take this model:
/* original copied from:
* http://users.tkk.fi/~t106216/english/miscellanea/style_guide.html
* Revisions bob herbst Nov 11, 2005
* updated using:
* import java.io.InputStreamReader;
* import java.io.BufferedReader;
*/
import java.io.InputStreamReader;
import java.io.BufferedReader;
public class WhichLarger { //reports which of the two input numbers is
larger
public static void main(String[] args) {
String xread,yread;
double x = 0.0;
double y = 0.0;
System.out.println ("Give two numbers!");
InputStreamReader keyboard = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(keyboard);
try{
xread = in.readLine();
x = Integer.parseInt(xread);
yread = in.readLine();
y = Integer.parseInt(yread);
//x = Read.getDouble();
//y = Read.getDouble();
} // end of try
catch (Exception e) {
e.printStackTrace();
}
if (x > y)
System.out.println("The first number is larger.");
else if (x < y)
System.out.println("The second number is larger.");
else
System.out.println("The numbers are equal.");
}
And produces this:
/* original copied from:
* http://users.tkk.fi/~t106216/english/miscellanea/style_guide.html
* Revisions bob herbst Nov 11, 2005
* updated using:
* import java.io.InputStreamReader;
* import java.io.BufferedReader;
*/
import java.io.InputStreamReader;
import java.io.BufferedReader;
public class WhichLarger { //reports which of the two input numbers is
larger
public static void main(String[] args) {
String xread,yread;
double x = 0.0;
double y = 0.0;
System.out.println ("Give two numbers!");
InputStreamReader keyboard = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(keyboard);
try{
xread = in.readLine();
x = Integer.parseInt(xread);
yread = in.readLine();
y = Integer.parseInt(yread);
//x = Read.getDouble();
//y = Read.getDouble();
} // end of try
catch (Exception e) {
e.printStackTrace();
}
if (x > y)
System.out.println("The first number is larger.");
else if (x < y)
System.out.println("The second number is larger.");
else
System.out.println("The numbers are equal.");
}
}
Bob
Steve Horsley - 11 Nov 2005 20:18 GMT
> James,
>
[quoted text clipped - 4 lines]
> then a second click "indent line(s)" according to that algorithm that
> will take this model:
<snip>
It's called a prettifier or beautifier.
I've never really felt the need because I tend to do the right
indentation as I go along. I don't have the mental capacity to
read badly indented code easily - even my own code what I just wrote.
Maybe they don't include one because they feel you should be
learning to indent as you go along and avoid learning bad/lazy
habits.
Steve
Michael Kölling - 11 Nov 2005 22:58 GMT
> Maybe they don't include one because they feel you should be
> learning to indent as you go along and avoid learning bad/lazy
> habits.
Exactly!
Michael
JS - 12 Nov 2005 10:08 GMT
Just the man Michael, on a totally different topic to this. My kentmail
address is down at the moment so not sure if you will get my email from a
home address. Can you give us some advice on CO531 Software Engineering
because we are still stuck on the sockets thing. You sent us some code of a
SimpleServer and a SimpleClient which worked like a dream. When we tried to
adapt it though we found that we could not send it out to many clients, only
the client who sent it originally, even with more than one Client connected
to the same server. how can we send out one message to many clients?
Thanks a lot and I'll email you through kentmail if it works. Im js220 by
the way.
Thanks in advance
JS
> > Maybe they don't include one because they feel you should be
> > learning to indent as you go along and avoid learning bad/lazy
[quoted text clipped - 3 lines]
>
> Michael
Roedy Green - 12 Nov 2005 03:46 GMT
On Fri, 11 Nov 2005 20:18:05 +0000, Steve Horsley
<steve.horsley@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>It's called a prettifier or beautifier.
see http://mindprod.com/jgloss/beautifier.html
http://mindprod.com/jgloss/prettyprinter.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
bherbst65@hotmail.com - 12 Nov 2005 07:49 GMT
Students with "lazy" habits taking CS use BlueJ to counter lazy habits?
I can't imagine that. But if that gets an "Exactly" then that is the
way it is.
But then there is this Google site to help them....
time to close it down so that they don't express their
feelings....."Its a pain but its how its made." (JS) and Roedy shows
that someone is charging hundreds of $'s for having inventing one
(beautifier) ......
A requirement years ago set by educators to counter laziness:
"Write it out by hand, use pen and paper, indent each paragraph...".
So in the end.... I have 2 IDE's on my desktop.... BlueJ and DrJava.
Together they get the job done "Exactly beautified". Download cost for
both .... "free".
Bob
bherbst65@hotmail.com - 12 Nov 2005 14:05 GMT
This error is not to beautify but testing the
sample program provided for correct input
.... by chance anyone really looks at it or really cares.
Since I edited the original sample to be:
xread = in.readLine();
x = Integer.parseInt(xread);
yread = in.readLine();
y = Integer.parseInt(yread);this snip
........
should be replace with this:
xread = in.readLine();
x = Double.parseDouble(xread);
yread = in.readLine();
y = Double.parseDouble(yread);
........
Bob