2 ms·
Way before the data science trend, I started using Python 1.2 because I could do quick, reasonably fast, and superbly readable scripting. I stuck around through
by rcarmo 3y ago
Way before the data science trend, I started using Python 1.2 because I could do quick, reasonably fast, and superbly readable scripting. I stuck around through 2.x because I could interop with C libraries via Cython and write very solid, readable and maintainable web services (I used to contribute to a Python SOAP library), and I once replaced a hideous amalgamation of PHP and Perl with a event-driven Python API service that was superbly efficient by comparison.
But the reason I stuck with it was quick turnaround and solid, maintainable code.
When I was at a local ISP/Yahoo-style portal in the 2010s, it was fashionable to run our own music and storage services. One of our teams implemented a Dropbox clone (called MEO Cloud) that was API-compatible (and had a Python client that I helped test).
At that time, we had a resident music streaming service that had a massive storage array on-premises, and we had a branded music streaming app to go with it. We wanted to implement a Shazam-like functionality, so I borrowed two big multicore Xeons, built an audio fingerprint indexer fot it based on a (now defunct) OSS library, and indexed the entire thing (some hundred million audio files) with Celery. It took me 3 days to write the first version, and two more to tweak things (fingerprinting was done in C++, and the only real constraint was datacenter network).
At that time we had a lousy experience with Rails and Ruby. I was using Basecamp and was interested in it (plus I wrote quite a bit of Ruby for Vagrant and Puppet), but the people we hired to do two or three Rails projects never managed to deliver anything usable or maintainable (since we were mostly a PHP/Java shop when it came to front-ends, reliability and scalability were paramount, and gems were hell to deploy and troubleshoot at the time).
I moved to Python 3 with minimal hassle (perhaps because I took great care in the dependencies I picked), adopted asyncio to great effect (I use my own asyncio code to batch writes to Azure storage these days), and all the while it has remained a very enjoyable, readable language (except when I come across poorly written OOP code that reads like Java fanfic).
My own coding style is closer to LISP/functional programming (I am actually refactoring a piece of code I wrote eight years ago in Hylang, the perennially under construction LISP-equivalent), and I love virtualenvs, the AST, the way I can use decorators to modify code behaviour, and, of course, the fact that today I can run and work in it everywhere (I have multiple interpreters on the iPad, for instance).
I could go on, but I've essentially been using Python as a mix of C/C++ glue, some fairly involved functional programming and a lot of multi-processing and concurrent code (I tend to push the interpreter to the limit when I can't use Cython). And I even wrote my own PasS on 1500 lines of it: https://github.com/piku https://github.com/piku (which I still use today).
From where I'm sitting, Python won because it is a great, maintainable glue language with some pretty much rock solid libraries (not just the standard library). Bottle and Django come to mind, although these days I'm more into aiohttp.