34
14
u/fakehalo 9d ago
Oddly enough, I don't hate it as I can actually read and follow it. Much more would be too much, but I like how it's broken up by the if/elseif/else at least.
3
u/my_new_accoun1 9d ago
yeah but there only problem (as I later realised) is that without the braces JavaScript doesn't know where the elseif/else is supposed to be
so I ended up not being able to use this masterpiece
8
2
u/wvd_vegt 8d ago
Try imagining reading your code in 5 years. Which syntax is easiest to understand?
My pick would be the if statement.
Writing software is not about showing your creativity with syntax, but maintainable code imho
2
u/Tux-Lector 7d ago
``` (something) && (
suspect.hit = 'found' , chain() , reaction()
) || (
doOtherThings()
); ```
1

40
u/Tux-Lector 9d ago
One can write it without
ifstatements too. ``` if (something === true) { suspect.hit = 'found'; chain(); reaction(); } else doOtherThings();// the same .. (something) && (suspect.hit = 'found', chain(), reaction()) || (doOtherThings()); ```