[Courses] Re: pesky brackets

Xp0nential Xp0nential Xp0nential at root-core.com
Thu Jan 24 23:28:40 EST 2002


>  2. keep functions fairly short, so you can see where they start and end.
depends on what you mean by short. 
+ thats not always possible


one important way to also detect missing brackets is compilation errors and debugging. They help a lot once you get used to reading them correctly.

regards,
Xp0nential

--- Dreaming Kat <dreamingkat at ivillage.com> wrote:
>
>Adding to the list of ways to avoid missing an end bracket (hope ppl don't mind me sniping like this w/o credit)
>
>  1. indent code consistently.
>  2. keep functions fairly short, so you can see where they start and end.
>  3. Use an editor that does syntax-sensitive auto-indent.
>  4. especially when 2 & 3 aren't possible, comment each closing bracket.  
>
>I do this all the time for anything more than about 6 lines long and for the end of all functions.  Especially when coupled with proper indenting and using a lots of  white-space approach, it helps alot.  if nothing else, you get in the habit of looking back up to where the bracket opened to figure out a good comment.  :)  
>
>a further note on emacs, it will highlight the corresponding open bracket when you type a closing bracket.  if the opening bracket is not on the screen, it will display the line in the status bar if your in X.
>
>"Unexpected end of file" has so far proven to be a missing closing bracket every single time I've seen it, but missing brackets will cause other problems too (similar problems to forgetting those semi-colons).   :)
>
>-- marykat
>
>_________________________________________________________________
>iVillage.com: Solutions for Your Life 
>Check out the most exciting women's community on the Web   
>http://www.ivillage.com
>_______________________________________________
>Courses mailing list
>Courses at linuxchix.org
>http://www.linuxchix.org/mailman/listinfo/courses

_____________________________________________________________
[Root-Core Network] - [www.root-core.org] - Free E-mail



More information about the Courses mailing list