Comment by aeonflux
6 hours ago
I don't really understand where is this need to compress the logic into where small chunks comes from. In result we get single line of code which has multiple statement conditions, different paths, and it's not possible to grasp in one go.
Other practical example why ternary is bad: Many code-coverage solutions break on ternary because they don't correctly see that one of the branches was missed in tests.
Because you can deduplicate certain parts of the logic which make the whole thing less error prone, such as
If I ever want to change x, or refactor this code some other way, its a more brittle process over x=c?1:2
The ternary expression also takes up much less space so there is less of an emphasis on it, this can be a stylistic tool in a programmer's toolbox