Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nitpick in Reverse2servlet

 
juliane gross
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe so?
 
Carol Murphy
village idiot
Bartender
Posts: 1202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... a mighty long string for the HTML bits

Did you make it a constant?
[ October 09, 2003: Message edited by: Marilyn de Queiroz ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic