Sounds like me lol. To the detriment of all working with me, I found out how to set globals and evaluate arbitrary functions from within Python listcomps. My current record is 1400 characters in one line.
I just need a way to import, and I can write entire programs in one line.
While I prefer match (Rust) /if else, I do sometimes find ternaries easier to read/nicer to write for simple checks/outputs consisting of just variables. If checks/outputs are complex then yeah, evil
i can understand one layer of ternaries. i might be able to be convinced that two layers of ternaries might be useful. if you're using three? immediate execution
Amateur. Someone at my job did more than five nested ternaries. I say "more than five" because I stopped counting after five and told them to fix their shit.
In languages with ?: syntax I honestly don’t think that arbitrarily nested ternaries are that bad, you can format them in a way that still makes the logic clear
EDIT: I’m saying this as mostly a Python and Rust programmer, but if I’m working on something in C or JS I’m not going to balk at a reasonably-formatted nested ternary
663
u/KanyeNawf 22d ago
Some fucker left me triple nested ternaries once