LabWindows/CVI User Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Preferred Source Code Editor Bracket Styles

The CVI Team would like to get an idea what the most commonly used source code editor bracket styles are. These options are currently available through Options >> Editor Preferences >> Bracket Styles. Please leave a comment on this page describing your preferred bracket styles. For example, the code snippet below is using Flush, Left for both Function Brackets and Statement Brackets:

void main ()

{

     if (v > 0)

     {

         printf ("hello\n");

     }

}

Jonathan N.
National Instruments
Comments
ebalci
Active Participant
Active Participant
on

I use the Flush, Left for all bracket styles.

This is the one given as example in Jonathan's post above.

Cheers

S. Eren BALCI
IMESTEK
Mohan
Active Participant
Active Participant
on

My recommendation for default style in CVI: Flush Left for both function and statement brackets.

Personal preference: Uneven Left for both function and statement brackets.

wwilliams
Member
Member
on

Flush, Left (function and statement brackeks).

User002
Not applicable
on

Flush Left for both function and statement brackets

Tim_R
Member
Member
on

Flush Right (function and statement brackets).

Rgulbrandson
Member
Member
on

I use the FLUSH,LEFT for both statements & function blocks.

mjl
Member
Member
on

I also agree on the flush left.  Personally I add a comment to every set so I can easily tell if one has been deleted or moved by mistake.  I know you can use the balance option, but that will just tell you if you have the correct number of brackets, not if they were actually meant to match. IE

if (bGood)

{ // bgood

     

} // bgood

GarryO
Member
Member
on

I use flush, left for both function brackets and statement brackets.

40tude
NI Employee (retired)
on

Uneven left (function and statement brackets).

Regards, Philippe

Regards, Philippe proud to be using LabWindows since version 1.2
// --------------------------------------------------------------------------------------------
vix
Active Participant
Active Participant
on
  • Flush, Left for function brackets
  • Uneven, Left for statement brackets
Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
ebalci
Active Participant
Active Participant
on

It would be great if CVI had a utility to automatically re-format the code with a single key combination according to our style of choice.

(Does it have that already?)

S. Eren BALCI
IMESTEK
JP_V
Member
Member
on

Flush, Left (function and statement brackeks).

User002
Not applicable
on

Hi Eren,

this utility is missing but has been suggested in the LabWindows/CVI Idea Exchange: http://forums.ni.com/t5/LabWindows-CVI-Idea-Exchange/Auto-Indent-Code/idi-p/1777850 and is under consideration

dcl9000
Member
Member
on

Flush, Left (function and statement brackeks).

acm573
Member
Member
on

Hola:

Mi estilo de preferencia es el Flush, Left para todo el código. En lo personal por la claridad que brinda al leer el código.

blakney
Member
Member
on

I use Flush, Left for functions and Flush, Right for statements. However, I think Flush, Left for both is a fine default.

RobertoBozzolo
Proven Zealot
Proven Zealot
on

I am using Flush left for function definitions and Uneven left for statements: it permits me to easily detect where every single statement ends up even with several levels of nesting.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
carlox
Member
Member
on

I use "Flush, Left" for function brackets and "Uneven, Left" for statements brackets.

Carlo A.
Megaris




ASIC_LabRat
Member
Member
on

Hi John

I guess I am the odd one out...

Flush Left on main...

Flush RIGHT on statements... I also comment the closing brackets

void main ()
{
     if (v > 0)
         {
         printf ("hello\n");
         } // end if v > 0 begin else

     else

          {

          ...

          }// end else v <= 0
} // end main

is NI looking at making some mods to the editor... I definitely like the look and feel of the NotePad++ program if anyone has tried it in the C language style.

  notpadplus.jpg

The interactive brackets highlights are nice as well as the alignment bars...

Reg

Chipb

Contributors