3 ms·
I wouldn't mind seeing Python become the default scripting language for browsers over Javascript. Not that IronPython has to be the implementation. Python has
by afhof 16y ago
I wouldn't mind seeing Python become the default scripting language for browsers over Javascript. Not that IronPython has to be the implementation. Python has a huge library and an easy learning curve.
- postfuturist 16y agoI love Python, I really do, but JavaScript happens to be slightly better as a browser language because it is a little freer with the anonymous functions. Most JavaScript programmers use this all the time, without even thinking. Here's a jQuery example: $.ajax({ url: 'ajax/test.html', success: function(data) { $('.result').html(data); alert('Load was performed.'); } }); The equivalent Python would be this (assuming you ported jQuery): def successcb(data): Q('.result').html(data) alert('Load was performed Q.ajax(url='ajax/test.html', success = successcb) OK, that's not too bad, I guess. Named parameters are nice. Having to define the success callback separately is not so great. Edit, HN broke the formatting.