3 ms·
Short answer: for an experienced JS developer, choose Python over JS if your application falls into Python’s areas of excellence (data science/ML, system automa
by 0xcebe 8y ago
Short answer: for an experienced JS developer, choose Python over JS if your application falls into Python’s areas of excellence (data science/ML, system automation, graphic pipelines, gaming engines) and if you have the time to learn it (Python is generally easier to learn than JS). For other applications like web development, it’s likely not worth switching to Python for an experienced JS developer. Raw curiosity and experimentation is always a good reason, Python is the 3rd most loved language by developers according to StackOverflow.
——
Long answer
From experience the python ecosystem is great when it comes to analyzing data, data science, machine learning.
Previously the alternatives for data science were R/Matlab/Octave which are languages designed by/for mathematicians primarily - while python is a general-purpose language. These languages tend to perform slower than Python. A more recent alternative is Julia, https://en.wikipedia.org/wiki/Julia_(programming_language) https://en.wikipedia.org/wiki/Julia_(programming_language). Another interesting example is this online community offering live backtesting of algorithmic trading strategies written in Python is Quantopian: https://www.quantopian.com/algorithms/ https://www.quantopian.com/algorithms/
Some notable libraries which build on each other are scipy (http://www.scipy.org http://www.scipy.org), numpy (http://www.numpy.org http://www.numpy.org), pandas (http://pandas.pydata.org http://pandas.pydata.org), scikit-learn (https://scikit-learn.org https://scikit-learn.org), google's tensorflow. Tools like iPython/Jupyter (https://ipython.org https://ipython.org) act somewhat like an IDE in the data analyst's workflow. It
Other popular use cases for python: system programming and automation as an alternative to shell/perl scripts because the python interpreter ships with most linux distributions by default while other scripting language do not. This use case is especially popular at Google where Python's creator and "benevolent dictator for life" Guido van Rossum had been working for 7 years. Examples of such applications built in python include Ansible, Docker-compose.
Yet another application where Python is popular is gaming engines (Pygame, Panda3D). Python is also the de-facto language for graphic pipelines and interoperability between 3D applications in the media and entertainment industry. It is supported directly in the Unreal Engine and Maya.
According to this Quora page, a Google Engineer uses python for build/test/deployment automation, some monitoring and service configuration tasks, Tensorflow configuration and results analysis. Other answers mention python used in much of the Youtube codebase.
https://www.quora.com/What-is-Python-used-for-at-Google https://www.quora.com/What-is-Python-used-for-at-Google
Python is also a good option to write a REST API server really quickly using the flask-restful library.
https://codeburst.io/this-is-how-easy-it-is-to-create-a-rest-api-8a25122ab1f3 https://codeburst.io/this-is-how-easy-it-is-to-create-a-rest...
Further reading
https://github.com/vinta/awesome-python https://github.com/vinta/awesome-python
https://stxnext.com/blog/2018/10/16/python-vs-nodejs-comparison/ https://stxnext.com/blog/2018/10/16/python-vs-nodejs-compari...
https://insights.stackoverflow.com/survey/2018/#most-loved-dreaded-and-wanted https://insights.stackoverflow.com/survey/2018/#most-loved-d...
https://hackernoon.com/could-pythons-popularity-outperform-javascript-in-the-next-five-years-abed4e307224 https://hackernoon.com/could-pythons-popularity-outperform-j...
https://www.quora.com/What-are-advantages-and-disadvantages-of-Python https://www.quora.com/What-are-advantages-and-disadvantages-...
- vikingcaffiene 8y agoThank you very much for taking the time to answer in such detail. It does confirm my suspicion that most of my use cases are already adequately covered by JS/TS/Node and that there's not some killer hidden feature that I am missing. The links you sent in particular answered a lot of questions for me. Seems like one of the biggest draws (for me at least) is that python is slower to change over time. That cannot be understated and is my biggest frustration with the JavaScript world. That is, the unending need to learn the new "Obviously Best Way" to do things every 12 months or so. It gets exhausting. I'm naturally curious so I'll keep learning python. Can't hurt right?
- vanous 8y agoNot an expert but would recommend you to look at pyenv with virtualenv from the start. This allows you to use python3 version of your choice in virtual environment based say per project etc. Obviously, this landscape has been changing rapidly lately and other people might recommend different tools, but for manual (or automated) server deployment I like this - I can test new versions of libraries and python (3.7.2 ;) and switch between them super easily without affecting/breaking each other.
- vikingcaffiene 8y agoYeah I installed pyenv first thing. Made things a lot easier.