Code style: separate parts of If
statement
#541
Labels
refactor
Does not change functionality, but makes the code better organized or more readable
wolfram language
Requires Wolfram Language implementation
The problem
The issue with
If
in Wolfram Language is that it's very easy to miss the difference between a compound expression and an "else". That is, compareto
Possible solution
To make these cases more readable, the following style is suggested:
The idea behind this indentation is that the comma takes the part of an
else if
in a language like C++:A similar style should be used in other functions where compound expressions are expected. For example,
Catch
:Additional context
This should eventually make its way into linter #247. In the meantime, we need to update the existing code itself and the contributing guidelines.
The text was updated successfully, but these errors were encountered: