Re: Console.WriteLine(s) Is Missing Line Terminator?
- From: "RobinS" <RobinS@xxxxxxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 10:51:15 -0800
Let me step in and support Mattias here.
According to Francesco Balena: "The + operator is supported
as a string concatenation operator only for historical
reasons. Using the & operator to concatenate strings
instead of the + operator makes your code more readable
and less ambiguous."
I completely agree. When I see this:
myData = firstData + secondData
If I don't know if those are strings or numerics,
I won't know if it's concatenating or adding.
And when Microsoft says something is included "for historical
reasons", to me it's like saying "Say Hasta La Vista to
this feature in the next version, baby."
Robin S.
-------------------------------------
"Gadget" <gadget@xxxxxxxxxx> wrote in message
news:4ebi6gkpz0ah$.kvwwrhdycu4t$.dlg@xxxxxxxxxxxxx
On Sat, 18 Nov 2006 00:07:40 +0100, Mattias Sjögren wrote:
Also as a rule of thumb, avoid using '&' to concatenate strings, as it
has
a tendency to hide casting errors.
Huh? Can you give an example of that? And what do you suggest we use
instead? Hopefully not the + operator.
It's only in there for VB6 style compatibility,
No it certainly isn't.
Mattias
I'm still fascinated to hear your reasoning, Mattias. Don't let this
thread
die... :)
Cheers,
Gadget
.
- Follow-Ups:
- Re: Console.WriteLine(s) Is Missing Line Terminator?
- From: Gadget
- Re: Console.WriteLine(s) Is Missing Line Terminator?
- References:
- Console.WriteLine(s) Is Missing Line Terminator?
- From: Fir5tSight
- Re: Console.WriteLine(s) Is Missing Line Terminator?
- From: Mattias Sjögren
- Re: Console.WriteLine(s) Is Missing Line Terminator?
- From: Gadget
- Re: Console.WriteLine(s) Is Missing Line Terminator?
- From: Mattias Sjögren
- Re: Console.WriteLine(s) Is Missing Line Terminator?
- From: Gadget
- Console.WriteLine(s) Is Missing Line Terminator?
- Prev by Date: Re: I must be dumb or something
- Next by Date: Re: DataGridView - Differnt Column Widths
- Previous by thread: Re: Console.WriteLine(s) Is Missing Line Terminator?
- Next by thread: Re: Console.WriteLine(s) Is Missing Line Terminator?
- Index(es):
Relevant Pages
|