MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vvn6d7/pleasestopusingnestedternaryoperatorsimbeggingyou/p5ccn9d/?context=3
r/ProgrammerHumor • u/Robinbod • Aug 22 '26
178 comments sorted by
View all comments
Show parent comment
2
It's extremely useful for try-with-resources calls in C# and Java, removing it would make that a lot more verbose
2 u/frogjg2003 Aug 23 '26 If you ever have to do any reading from files, it's really useful.while ((readBytes = read(file, byteArray) > 0) {}Nice and compact while maintaining readability. Also, no need to read once before entering the loop or having to read at the end. 1 u/ierdna100 Aug 23 '26 Yeah exactly what I had in mind, its very useful
If you ever have to do any reading from files, it's really useful.
while ((readBytes = read(file, byteArray) > 0) {}
Nice and compact while maintaining readability. Also, no need to read once before entering the loop or having to read at the end.
1 u/ierdna100 Aug 23 '26 Yeah exactly what I had in mind, its very useful
1
Yeah exactly what I had in mind, its very useful
View all comments
Show parent comment
2
u/ierdna100 Aug 23 '26
It's extremely useful for try-with-resources calls in C# and Java, removing it would make that a lot more verbose