POV-Ray : Newsgroups : povray.newusers : Good ways to keep curly braces straight : Re: Good ways to keep curly braces straight Server Time
15 May 2024 03:36:24 EDT (-0400)
  Re: Good ways to keep curly braces straight  
From: Cousin Ricky
Date: 11 Mar 2014 13:10:00
Message: <web.531f423cc3f8948a85de7b680@news.povray.org>
Bald Eagle <cre### [at] netscapenet> wrote:
> ... and the subject was intended to read just like THAT!   :D
>
> Anyway,
> I have a small (~500 line) file that I keep having issues with after
> editing, where I either have an extra, or a missing curly brace.
>
> I'd like some tips and tricks on organizing and visually keeping track
> of my SDL code, and maybe even some clever thingsd embedded in the code
> to help locate where the offending error resides.

Should you go the Kate route, a syntax highlighting file is located at

   http://news.povray.org/4f4092fb%40news.povray.org

so you don't have to download the Unix version of POV-Ray.  Kate highlights not
only curly braces, but square brackets and (most helpful to me) parentheses.

One thing I do that requires no software is that I use a non-customary formating
style.  Customarily, the opening brace is placed on the same line as the
keyword, for example:

   object {
      MyObject
      translate MyLocation
   }

This confuses me to no end.  I prefer:

   object
   {  MyObject
      translate MyLocation
   }

This helps me keep better track of the braces and the blocks they enclose.  I
once read in a C/C++ style guide that thou shalt use the One True Brace Style.
Right.  If a brace style confuses me, it defeats its own purpose.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.