On Thu, Feb 14, 2013 at 10:37 AM, Katherine Moss <katherine.m...@gordon.edu>wrote:
> Hello all, > Does anyone know any methods I could use when practicing programming in C# > (I'm kind of just learning, so it can get annoying sometimes), to keep my > braces straight? I will be writing something simple, and then before I > know it, I'll have fifty errors show up all because of one brace not closed > or two braces in the wrong place. Very annoying when fifty errors come up > because of a single problem. And not only in keeping track of braces, I'm > also confused as to what goes in between braces since C# gets layered > sometimes in terms of code blocks. Books demonstrate examples well, > however, they do not do a very good job telling you where braces go to > begin with and why. Responses would be great on this. Thanks. > > If you're in a team, they are going to have a standard on this some do function( parm ) { code } others something like function ( parm ) { code } And variations. None are right or wrong, but you'd be advised not to make up your own in a workplace :) Visual Studio isn't too bad these days with doing auto-layout of braces, and there's utilities that you can apply to code to make it comply with the layout you want. -- Meski http://courteous.ly/aAOZcv "Going to Starbucks for coffee is like going to prison for sex. Sure, you'll get it, but it's going to be rough" - Adam Hills