JavaScript vs. Python in 2017
hackernoon.com
hackernoon.com
Perhaps this can be partly credited to JS's decision to go with a more minimal standard library, meaning it didn't end up with the Python 2/3 situation as standards evolved.
I don't think that it's Python's large standard library that was the issue since that was immediately compatible with Python 3, rather it was the large ecosystem (in fact particularly a small number of popular packages) which held things back by not porting soon enough.
JS won't experience a directly similar thing because it started with default Unicode strings support (because it had to, and also because JS is slightly younger than Python and had that advantage).
This is also my biggest complaint about global npm registry: lack of namespacing.
> write JavaScript code that uses async/await and type annotations, switch to my terminal, run node example.js
How about:
node --harmony To the best of my knowledge, the Python community does
not have an equivalent, popular mechanism for
experimenting with DSLs within Python.
I think this is because modern javascript practice already includes a compiler pipeline to handle modules, polyfills, etc so one more step doesn't really matter. In contrast, since Python already works out of the box, even one extra step incurs a large step. (Linters and such don't count because I can run my unlinted code as is; I can't run my custom DSL without preprocessing it).OK, so you went shopping for a statically typed language and somehow ended up with Python (which only _just_ started having annotations in 3.6)? Why not pick any of the multitudes of languages that actually do have static type-checking?
This is incorrect.
Python gained syntactic support for annotations of functions and methods in 3.0. It was anticipated that this feature would be used to annotate types of arguments and return values, but nothing about it required using it for this purpose (and in fact, nothing requires using it for that purpose today).
Python 3.5 added the 'typing' module to the standard library (and it was also released standalone on the Python Package Index, allowing it to be installed on older versions of Python). This module provides a standardized way to describe types, and an ecosystem of tools has popped up which make use of the typing module's approach to perform static-style type checking of Python source code.
Python 3.6 added syntax for annotating variables, and for declaring variables without assigning a value to them. Prior to this, type-checking tools used type-declaring comments to read the types of variables.
Also, note that the annotations -- which are correctly termed "type hints" when used to describe types -- result in no enforcement whatsoever on the part of the Python runtime, which does not assign any special meaning to annotations, and aside from exposing them via an introspectable attribute will not do anything with them either prior to or during execution. To use them for type-checking purposes, you must install and run a third-party tool which reads the annotations and compares them to actual usage in the code.
Since this is not the case (and would be difficult/impossible to implement given that Python code can import new modules at any time, and also change the import paths), it's worth pointing out.
https://jobsquery.it/stats/language/group
JavaScript is mentioned in 17% of all tech job offers VS 10% for Python.
However in terms of average salary - Python is the winner. Average salary for Python openings is $117k annually VS $96k for Javascript.
(same stats page https://jobsquery.it/stats/language/group )
That's weird, my edit/refresh experience didn't disappear, even after adding Babel/typescript.
In fact, maybe you could say it's more advanced and powerful after adding live reloading?