Re: VB.NET or C#.NET ???
In addition, although this is not something that should be done very often,
it allows one to put multiple statements on the same line, and thus compact
your code a bit. There are a few situations where this comes in handy, such
as in switch statements.
switch (foo)
{
case (1): someFunction(); break;
case (2): SomeOtherFuncti on(); break;
//...
}
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
news:MPG.1e5b9a cbdb5fbdb798ce2 f@msnews.micros oft.com...[color=blue]
> Michael D. Ober <obermd.@.alum. mit.edu.nospam> wrote:[color=green]
>> In C and C# you must use a semi-colon to indicate the end of a statement.
>> This allows statements to continue across multiple lines without a
>> continuation character. In VB, statements are only one line long unless
>> they have a continuation character. Both languages support multiple
>> statements on a single line - C# via adding a statement after the
>> semi-colon
>> and VB by adding a colon between statements. This is a syntax issue
>> only,
>> but it plays directly into readability of the language. Which one you
>> like
>> depends on your preferences.[/color]
>
> Absolutely. There are definitely swings and roundabouts. As an
> anonymous poster wrote, there are far more lines *without*
> continuations than ones *with* - but then again, not being quite as
> white-space sensitive makes it easier to cut and paste code in C#, and
> encourages lines to be wrapped more often. (i.e. in VB.NET there's more
> of a temptation to try to get a statement onto one line so as to avoid
> the continuation character. Not much more, but a little bit...)
>
> --
> Jon Skeet - <skeet@pobox.co m>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too[/color]
In addition, although this is not something that should be done very often,
it allows one to put multiple statements on the same line, and thus compact
your code a bit. There are a few situations where this comes in handy, such
as in switch statements.
switch (foo)
{
case (1): someFunction(); break;
case (2): SomeOtherFuncti on(); break;
//...
}
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
news:MPG.1e5b9a cbdb5fbdb798ce2 f@msnews.micros oft.com...[color=blue]
> Michael D. Ober <obermd.@.alum. mit.edu.nospam> wrote:[color=green]
>> In C and C# you must use a semi-colon to indicate the end of a statement.
>> This allows statements to continue across multiple lines without a
>> continuation character. In VB, statements are only one line long unless
>> they have a continuation character. Both languages support multiple
>> statements on a single line - C# via adding a statement after the
>> semi-colon
>> and VB by adding a colon between statements. This is a syntax issue
>> only,
>> but it plays directly into readability of the language. Which one you
>> like
>> depends on your preferences.[/color]
>
> Absolutely. There are definitely swings and roundabouts. As an
> anonymous poster wrote, there are far more lines *without*
> continuations than ones *with* - but then again, not being quite as
> white-space sensitive makes it easier to cut and paste code in C#, and
> encourages lines to be wrapped more often. (i.e. in VB.NET there's more
> of a temptation to try to get a statement onto one line so as to avoid
> the continuation character. Not much more, but a little bit...)
>
> --
> Jon Skeet - <skeet@pobox.co m>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too[/color]
Comment