You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AFunctionCall(soFarSoGood ?? throw ACustomException($"With a long {Formatted.Explanation}. Which is still fine, but"), hereGoes ?? (anHonestToGoodness ? ternaryOnTheSameLine : throw WithAnotherCustomException($"And another {Long.Formatted} message. On the same line.");
Both the length and the complexity of the expression hurt the readability of the code.
I try to keep the lines below 120 characters, so they fit into a GitHub Files Changed screen.
I also try to keep the code readable, so the example above needs to be refactored into several ifs. That refactor needs to be tested or checked thoroughly, so it's not a quick fix.
That's why I create this ticket, so we can comment the places in the code that require attention in this regard. The places which we could not refactor at the moment.
The text was updated successfully, but these errors were encountered:
The idea was to make this part of code more readable. For this, the
following steps were taken:
1. Split booleans into one equality or expression per boolean.
2. Explain with local names what the booleans check.
3. Put on-select actions as a local function too.
4. Align parameters Google-style.
I also added blank lines around some code blocks.
QA: tested on a pY project that the corresponding window selects and
deselects things as usual.
This ticket is a part of #256.
It doesn't fix it, but it works towards addressing it.
Sometimes I encounter something like
Both the length and the complexity of the expression hurt the readability of the code.
I try to keep the lines below 120 characters, so they fit into a GitHub Files Changed screen.
I also try to keep the code readable, so the example above needs to be refactored into several
if
s. That refactor needs to be tested or checked thoroughly, so it's not a quick fix.That's why I create this ticket, so we can comment the places in the code that require attention in this regard. The places which we could not refactor at the moment.
The text was updated successfully, but these errors were encountered: