File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assignment 1.1 Nitpicking by JC Cook [b]SPACING[/b]

 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all let me congratulate the "team of nitpickers" for responding so fast on my 1st attempt at assignment 1.1
I really triple checked my code for style before submitting it, I even printed it to see how it looked , still a totally unexpected nitpick popped up, Spacing for the following line of code:
j = j + 1; // the length of the name
I assume that it should have been
j = j + 1 ; // the length of the name
Based on 2.2 Spacing in the style guide the example:
int theTick = 5 ; // YES! Double click gets "TheTick"
I must say that I'm a bit confused by this nitpick.
Why not then complain about the spacing of this line of code:
int j = 0;
Please explain.
JdJ
ps. this is in no way meant as a criticism on the great work you or any other nitpicker is doing

[This message has been edited by Johannes de Jong (edited February 12, 2001).]
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posting this I learnt something new.
UBB code does not work in Topic header and one cant change it later.
Sorry all
[This message has been edited by Johannes de Jong (edited February 13, 2001).]
 
Daniel Olson
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just turned in an assignment similar to this. I had
s = " " + s;
I guess it should have been
s = " " + s ;
By the way, wouldn't it be easier to write
j++ ;
rather than
j = j + 1 ;
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops typo
j = j + 1; // the length of the name
Should have been :
j = j + i; // the length of the name
At least in my assigment it was correct
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
j = j + i; // the length of the name

The rule is spacing around all identifiers, including between the identifier 'i' and the punctuation.

int j = 0;

zero is not an identifier. Therefore the spacing rule does not apply here. Although an extra space may be added if desired, it is not required.

[This message has been edited by Marilyn deQueiroz (edited February 13, 2001).]
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gee I went back to my printout of the Style Guide
2.2 Spacing
Cleary states : All indentfiers are surrounded with whitespaces

Man what a start I'm making at the Cattle Drive
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic