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 - Number

 
landon manning
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Formatting issues: Sorry about that, I thought that VisualStudios 4 was formating properly and I think it actually does. I think the problem is with hotmail. I shall look into it.
Style guide issues: "This includes final identifiers (using all upper case, as traditionally done in C, is a violation of OO abstraction)":
Please define what is ment by "OO abstraction" as it pertains to final identifiers and how using all uppercase is a violation of this.
(Don't worry, I'll adhere to the style guide, just wondering about the reasoning behind some of the style guide's style. )

Looks like this is the only time you use MAX_LINE_LENGTH/NUMBER . What did you gain by introducing MAX_LINE_LENGTH/NUMBER ?:
One of the things that I gained was readability. I can look back at my code and more easily understand what I was doing. With MAX_LINE_LENGTH in the formula as opposed to 80, I understand that the formula involves the maximumn character line length. If I only had 80 in there, I or someone who might potentially come along to read the code, must first figure out what the formula does and then figure out where I got 80. Using descriptive identifiers helps ease both of those burdens.
Thanks
Landon Manning
 
paul wheaton
Trailboss
Pie
Posts: 21179
Firefox Browser IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OO Abstraction will be covered later. The gist of it is that using all upper case has an implication with it as to the type of identifier. With OO, you want to keep things flexible for future changes. Later, you might make that a variable instead of a constant.
As to readability:
You're saying that
int namesPerLine = 80 / name.length() ;
is less readable than
int lineWidth = 80 ;
int namesPerLine = lineWidth / name.length() ;
Right?
I think it's a debatable point. So I think we can let it go.
Marilyn?
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we can let this one go.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic