Hi Katherine, C# does not have the power of C++. C# is a managed language: it has basically the same "power" as VB (.NET). What C# shares with C++ is it is a "C" style language: that is a lot of the styling and grammar are similar. And C in the old days was renowned for obfuscated code competitions. The issue of "style" in "C" languages, has caused many wasted hours: so much so there's even tools such as style cop that are designed to help address the development process/maintenance. So yes there is a lot of freedom with the braces; hence there are third party tools designed to reign in those freedoms.
As to VB equating to malware: well I guess you don't know the history of app development. VB does have a rich history; today I still see programs written in VB6, including major commercial software in Australia (eg MYOB Retail Manager), lots of internal business applications etc. Macro language for Microsoft Office and Visual Studio has been VB (for Applications), and even Reporting services function have to be written in VB .NET : no C# (at least last time I looked). The only "malware" aspect might be the days of old when macros and client side scripts (.vbs) had to be in VBA or VBScript. Actually, come to think of it, Microsoft's AntiMalware product (defender?) actually came for ma third party company they bought, and it was originally all written in VB: It was re-written in C++, not C# Anyway, if you choose a C style language, then you choose those freedoms, and issues that come with it. Some people even go as far as to try to comment the braces so as what it is closing. At the end of the day if you need that, you really have to ask why choose that style of language ;) |-----Original Message----- |From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet- |boun...@ozdotnet.com] On Behalf Of Katherine Moss |Sent: Thursday, 14 February 2013 1:34 PM |To: ozDotNet |Subject: RE: does anyone know a good technique to keep track of your braces in |C#? | |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: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet- |boun...@ozdotnet.com] 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 | | | |