Wednesday, August 5, 2015

What language has decorators, generators, comprehensions, modules, but isn't Python?

Question: What language has decorators, generators, comprehensions, modules, but isn't Python?

Answer: JavaScript of course! Specifically - the latest version of JavaScript - ECMAScript2015.


I've listened to a number of Python folks speaking recently and one of their most common refrains is "I hate JavaScript".  Python folks tend to be happy avoiding the browser end of development. And until recently, I was with them. I found JavaScript to be inconsistent, confusing, underpowered and frustrating.


But the latest version of JavaScript - ECMAScript2015 - is a game changer.  If you're a Python programmer you'll find that JavaScript and Python are starting to have alot more in common.


I've been programming recently with React.js in ECMAScript2015 and instead of burning in the ninth level of JavaScript hell, I've found that it's consistent, powerful and makes sense.  Sure there's a few concepts that are new but there's also a sense that JavaScript is becoming more Python-like.  In some ways it feels a bit like programming in Python.  I recommend it.


And yes you CAN use it today - it works in all modern browsers because things have changed - these days, ECMAScript2015 is transpiled/compiled into JavaScript, so no more fidgety worries about which browser supports what - write it, compile it, run it.


If you can live with all those damn annoying and pointless brackets, and a good IDE like PyCharm or Visual Studio will go a long way to sorting that out.


If you're adventurous enough to go further, this might help you get started:  


No comments:

Post a Comment