On Wed, 27 Sep 2006 14:15:23 -0400, "Russell Campbell"
<[EMAIL PROTECTED]> said:
> Hey, maybe we can switch to discussing how JavaScript and C# (I think) do
> this:
> 
> IF (expr) {
>       Some code
> } else {
>       Some other code
> } 

> The { at the end of the IF statement and the } and the { on the ELSE line
> are totally unnecessary.

Yup, and this is perfectly OK in C#:

if (x == y)
    Console.WriteLine("Yes");
else
    Console.WriteLine("No");

You only need the braces for multiple lines, normally indented thus:

if (x == y)
    {
        Console.WriteLine("Yes");
        Console.WriteLine("Indeedy.");
    }
else
    {
        Console.WriteLine("No");
        Console.WriteLine("Siree");
    }



-- 
  Alan Bourke
  [EMAIL PROTECTED]

-- 
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to