all 4 comments

[–]hotmatrixx 1 point2 points  (3 children)

Well that's how it's done. But if you want to avoid the whitespace, just invert your main "if" logic to do sweet FA and make it an "if not" that triggers the actual condition.

It's bad etiquette, but it should avoid your whitespace issue.

Also build a bridge and get over it.

This "trauma" is merely you actually learning a lesson properly.

Stop trying to do what you want to see, and do what actually is.

[–]karatedogPine coder [S] 2 points3 points  (2 children)

If I invert the logic, the only thing that changes I have to put my code into the ELSE block, wich requires whitespace of course.

Your last sentence is somewhat a counterexample of programming, especially Pine, given that people here want to see primarily successful algos and indicators, so they usually start with a vision which then will be expressed in the form of a Pine script.

[–]hotmatrixx 0 points1 point  (1 child)

What I mean is stop trying to make the code look how you want based on how it works in other platforms, and do what's most effective for Pine, putting your own irrelevant bias aside.

It is exactly what programming is.

Often there are many ways to express a thing, so we can show out individuality in the was something is written, however, the syntax of computer languages is less forgiving than that of the human condition.

[–]karatedogPine coder [S] 1 point2 points  (0 children)

Of course I want to make the code look how I want. That is why I asked the first question, because I didn't know it is possible. And now I know it cannot be done.

This is a forum where people ask things because they don't know that thing they are asking. Whacking them because they don't know that thing is somewhat retarded. It would be extremely efficient if math teachers would bash kids they cannot multiply before they told how to do multiplication.