3 ms·
indeed, back in the day i'd love to write perl code such as this() and that() or otherr() and fail(); so this all seems very reasonable, and clear, and people
by larodi 1y ago
indeed, back in the day i'd love to write perl code such as
this() and that() or otherr() and fail();
so this all seems very reasonable, and clear, and people who read the code hated it. I've tried many times to do it in JS sadly it does not work:
a && b || do { console.log (err) }
but this all does not make it easier to read, but makes it only very likely to outsmart yourself.
some code is algorithmically more beautiful than other, more declarative perhaps. but going away from the common understanding of trivial stuff, does not always benefit the group or the project.
- spauldo 1y agoIt's down to what's idiomatic for the language. I'd argue that the Perl example is idiomatic Perl (just as the Lisp equivalent would be idiomatic Lisp), but that's certainly not idiomatic JavaScript.