Published on InterSystems Developer Community (https://community.intersystems.com)

Home > For and If with one line: to brace or not to brace

Discussion
Evgeny Shvarov · Jan 24, 2018

For and If with one line: to brace or not to brace

Hi Community!

Coding guidelines discussion. Consider you have For with one command in the cycle. Here are the options:

One

For i=1:1:1000 set ^Test(i)=""

Two

For i=1:1:1000 {
 set ^Test(i)=""
}

Same for the "If":

if a set b=a

or

if a {
 set b=a
}

Your choice? Or maybe even other options? 

#Code Snippet #Coding Guidelines #ObjectScript #Caché #InterSystems IRIS

Source URL:https://community.intersystems.com/post/and-if-one-line-brace-or-not-brace