Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!

# Assignment 1.1 - Number

landon manning
Ranch Hand
Posts: 47
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
Posts: 21798
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.
You're saying that
int namesPerLine = 80 / name.length() ;
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: 9067
12
I think we can let this one go.