Please correct me if I am wrong on this. You're telling me that braces are
free for the programmer to place them where they want in C#? I know that in
most of the demos I have from books, there are always braces in particular
places every time with no fail. Is this a C# convention, or is this a standard
that Wily is using? For instance:
Namespace Demo
{
Static void main(string [] args)
}
{
Console.WriteLine("this is a demo");
Console.ReadKey();
}
}
}
Or something like that. I'm not sure since I don't have the file open in front
of me, but are you saying that is just a chosen way of writing it and that
people are relatively free with braces? And about other languages. I chose C#
because it offers the power of C++ without the complexity. And I plan to learn
F# as well one of these days, though isn't that more of a math language for
calculation programs and such like that? But thanks to Roslyn, I can learn
easier with C# interactive. And I don't use VB for moral reasons. No offense
to those on this list who love it, but isn't it kind of the malware author's
language?
From: [email protected] [mailto:[email protected]] On
Behalf Of David Richards
Sent: Wednesday, February 13, 2013 7:50 PM
To: ozDotNet
Subject: Re: does anyone know a good technique to keep track of your braces in
C#?
I'd also add that braces, parentheses, or anything that comes in pairs, should
be inserted at the same time. ie, immediately type your opening and closing
braces and then move your insertion point in between them. If you're putting
existing code in new braces, you still try to do this as a single operation.
either be careful to put them in the correct place at that time, checking to
make sure they are, or have them inserted for you. eg, select the code, CTRL +
K + X, select Visual C#, then select what you want, such as "if".
I do all of this and the only time I've ever had mismatched braces is by
accidentally deleting one.
David
"If we can hit that bullseye, the rest of the dominoes
will fall like a house of cards... checkmate!"
-Zapp Brannigan, Futurama