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=aor
if a {
set b=a
}
Your choice? Or maybe even other options?
Comments
Strange. Our production servers are Caché 2018 on AIX but still showing only 16,384 KB.
Must have preserved the existing setting on upgrades rather than use the new value.
Fresh local Caché install on Windows install shows 256MB though.
Cache for UNIX (IBM AIX for System Power System-64) 2018.1.2 (Build 309_5) Wed Jun 12 2019 20:08:03 EDT
%SYS>w $zs
16384
The article is considered as InterSystems Data Platform Best Practice.
Which part of it?
There's like 5 different suggestions contradicting each other.
None of them. The best practices is "Do what you want"... hehe
Now seriously. I think the best practices is use according to the explication of each comment. Use brace to delimit the scope, not use if you have one line and precondition, etc..
The conversation is helpful.
Ok, this is fair - we can remove the Best Practice tag for this.
The idea was that this is important conversation if you consider internal guidelines on this for your organization and can take one approach from the best practices of experienced developers.
I think it is a "Best practice", but the information is scattered throughout the conversation.
Why not create a last comment with a brief of the conversation, with pros and cons?
It could be more clear.
Regards