Most apps, except simple POCs, tend to have a complex expression in one or the other way. Either its a complex decision or an attribute beeing filled conditionally.
Always when having complex expressions its hard to determine which parts are in parentheses and what parts are "logically connected".
It would be a great imrpovement to be able to write comments inside the expression. This would not only enable us to write a summary in an annotation explaining the logic next to the activity, but to also structure the expression itself better.
This would heavily raise the maintainability of expressions since the developer can easily tell different "logic" parts apart and add a new condition where required.
Since the same idea is already in consideration for XPATHs, please also take this under consideration since it would help a lot developers.
Example Expression:
thanks for the comment. The shown expressions is meant to fill a bool attribute. I could in theory split it to multiple bool variables first and in the "Change object" activity compare the variables to each other to be able to determine the end result, but this bloats the code in a different way since you then have multiple actions just to fill a single bool attribute.
Also im not sure how this reflects in apps performance giving my code only performs one big bool statement and writes it back to the object, the alternative performs many small statements, writes the values to varaiables and performs another bool statement comparing the varaibles and writing that result to the object
Also your logic seems hard to implement when it comes to a statement which uses a lot of parenthesis but inside the individual parenthesis its still a big bool statement. This can be easily divided by comments, but not so easily distributed to individual variables.
In these cases, would you not rather model out the decisions into multiple ones? By the time it is complex enough to need a comment, it likely also becomes too difficult to debug properly.