Indenting in BPM code

I feel like I’m losing my mind, but is there no consistency in the auto-indenting within the BPM code block node? I swear that some and tabs and some are spaces. If we could get drop lines in here, I’d would be so happy

Both tabs & spaces? I haven’t noticed this but wouldn’t be surprised if you’re correct.

I’m reminded of a scene from the show Silicon Valley, tabs vs. spaces discussed in more detail here…

I know on some of my more obsessive days I am guilty of wasting time cleaning up indentation.

2 Likes

Best show on TV now.

1 Like

Said no Python programmer ever…

1 Like

While on the topic of indenting…
Does an open brace belong at the end of the line like

if(value){

Or by itself and indented like

if(value)
   {

And where does the closing brace belong? Even with start of the line that created the block

if(value){
   // do stuff
}

Or indented with the lines of the block?

if(value){
   // do stuff
   }

If(value){
…// Do stuff
}

Or

If(value)
{
…// Do stuff
…// My personal preference
}

If there is only a single statement this is also acceptable…

If(value){ /* Do Stuff */ }

1 Like

If you have visual studio, the code can be format using Format Document.

But make sure you set the Tab and Indent size correctly in the Options, also, I normally use Insert spaces rather than tab.

1 Like
If (is it readable == true)
    move on
else
  if (is it a turd == true)
      Don't bother, you can't polish a turd
  else
      Take the rest of the day to make sure the next person can understand, what in your mind, appears to be a blazing piece of technical genius, using your favorite code beautifier.
1 Like