File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Cattle Drive and the fly likes nitpick in Reverse2servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "nitpick in Reverse2servlet" Watch "nitpick in Reverse2servlet" New topic
Author

nitpick in Reverse2servlet

juliane gross
Ranch Hand

Joined: May 30, 2002
Posts: 161
I got this nitpick:
Why do you have three strings instead of just one big string?

I broke my HTML form thingies into 3 strings because in the style guide it says:
Do not make your code longer than 120 characters....
... Longer lines can be frustrating to work with.

Unless the nitpick tries to hint me into an other direction entirely,
I don't see how I could possibly make ONE BIG string and not extend
120 characters..

any ideas are welcome, thanx!
Juliane
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Maybe so?
Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1197
I think I used to get nitpicked on this same thing. It has something to do with concatenation taking place at run-time or it's the other way around. Marilyn can explain it very well. She did it several times in the course of nitpicking my assignments. I'll check my nitpicks. I saved them all!
juliane gross
Ranch Hand

Joined: May 30, 2002
Posts: 161
Pauline and Carol,
thanx, you are great!
(how come that this (theMightyLongString) looks so easy and yet this
idea did not come to my mind )
Carol, I also save ALL my nitpicks..
and yes, I got this, too:
Concatenating constants is figured out at compile time, not at runtime

My brain just tried to think of something more complicated
than Pauline's string :roll:
Amy Phillips
Ranch Hand

Joined: Apr 02, 2003
Posts: 280
Ok now I'm confused, i followed Paulines advise and submitted a mighty long string for the HTML bits but got the following nitpick

For cleaner code, I'll take a big collection of string constants like this and declare it in my class as one long string constant (concatenating constants is figured out at compile time, not at runtime).

I'm a bit confused as to how this is different from the mighty long string
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
... a mighty long string for the HTML bits

Did you make it a constant?
[ October 09, 2003: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: nitpick in Reverse2servlet