3 ms·
Switching away from an implementation that everyone is familiar with is the opposite of making something more readable.
by charcircuit 1y ago
Switching away from an implementation that everyone is familiar with is the opposite of making something more readable.
- larodi 1y agoindeed, 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.
- ayhanfuat 1y agoAren’t both implementations fairly common? Precomputed / hardcoded set of values vs adjusting it inside the loop?
- anonzzzies 1y agoBut how many people need to read/write this code? There are tons of open source libraries, gateways, proxies etc etc.