3 ms·
Actually, I think an interesting exercise for evaluating a language could be determining "how much code change do small semantic changes require". For instance,
by jakear 7y ago
Actually, I think an interesting exercise for evaluating a language could be determining "how much code change do small semantic changes require". For instance, if we were to start with passing a generator (in the "generates a value" sense of the word, not the other one), and try to convert it to passing a counter, how would that look?
JS:
foo(x => () => x)
bar(x => () => x++)
Py:
foo(lambda x: lambda: x)
def countUpFromN(n):
def add():
nonlocal n
n += 1
return n-1
return add
bar(countUpFromN)
Fairly damning to python IMO. I'd be interested to see examples of where small changes in Python require large changes in JS.