Not sure about this topic of this thread. I'm all for options but on this point I'd
have vote -1 as, in my opinion, it is work for an option that removes code clarity.
Adding the + operator to the second line would result in other developers running the
risk of not realising that the string is continued. I believe that the line should
end with the operator as it's a clear indication that the line is continued.
Otherwise, with the operator on the next line, it is only the lack of a semi-colon
that implies that the line is coninued, and we all know how easy it is to become blind
to those.
To go against someone's earlier point, there is little need to clarify the second line
by placing the + there...as the literal string clearly does not stand up a statement
alone, the developer would naturally check if it is a piece of continued line, i.e.
the "bar" on the second line makes no sense alone.
String s = "foo" +
"bar";
I also think this applies to all expressions, not just string literals. Compare these
below when reading from the bottom and top.
double owed = productCost - (customerAccountBalance * SOME_RATIO)
- amountAlreadyPaid;
double owed = productCost - (customerAccountBalance * SOME_RATIO) -
amountAlreadyPaid.
I would even say this applies to throw clauses.
So :6 to all you second-liners. :)
Paul.
"Aeros Lau"
<[EMAIL PROTECTED]> To:
[EMAIL PROTECTED]
Sent by: cc:
[EMAIL PROTECTED] Subject: [Eap-features] Re:
String splitting: Put + on second line
tbrains.com
20/08/2002 02:49
Please respond to
eap-features
+10!!!!!!!!!!
and more, can it be a item of code style define?
"Gordon Tyler" <[EMAIL PROTECTED]> д����Ϣ����
:ajrau7$ppf$[EMAIL PROTECTED]
> Hi,
>
> I'd like an option to make string spliting put the + on the second line.
>
> For example:
>
> String s = "foo bar dongle";
>
> Becomes:
>
> String s = "foo bar "
> + "dongle";
>
> Thanks,
> Gordon
>
> --
> Sitraka -- the Java advantage
> http://www.sitraka.com/
>
>
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorized copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features