File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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!
Pauline McNamara

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

Joined: Mar 15, 2001
Posts: 1202
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

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

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

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: nitpick in Reverse2servlet
It's not a secret anymore!