16 comments

[ 3.0 ms ] story [ 45.3 ms ] thread
Even though I like using “superior” languages, Python is the right tool for many jobs
Every time I consider switching to something else (eg rust) I remember that real world hacky tasks will take 10x as long.

eg working with Reddit api has a prebuilt python tool that can do a lot out of the box

I only use Python when it’s something quick and dirty. It’s very rare that I use Python for anything production. I think it’s a neat language overall. All the work I did to learn ML was in Python, and so it’s been immensely valuable to me. But yeah — I don’t use it in production (and I haven’t done any ML in production).

I think maybe a couple years ago I had to ship some Python code because I needed to connect together some tasks into a workflow and Airflow seemed to let me get everything up, write tests, and instrument metrics to a monitoring solution I was using.

Last year I ended up doing a bunch of stuff with Spark. I hated dynamic typing in Python and my team agreed to go with Scala. Couldn’t be happier.

For example, Python was helpful for a script I wrote and left running on my MacBook to tell me when the PS5 dropped on Target. Ended up waking at 1AM PST to my phone ringing, opening up the Target app, and ordering the PS5. Picked it up the next morning.

May not be the best out there, but it's incredibly productive, and easy to read (IMO).

Because it's so damn productive, going back to more rigorous languages just doesn't feel as fun, I guess? Writing lengthy boilerplate just sucks out all enjoyment of coding, even though it might benefit your project in the long run.

How to I become productive in python?

My most productive language is C# because of visual studio + intellisense / strong static typing /LINQ.

I’m trying to do some ML stuff just now and it seems so slow. Maybe it’s because I’m trying to learn the python syntax as I go. Any tips?

I agree. I will not like to give a proof-of-concept in C++. It is definitely possible but again, why to waste time. And it may differ, case by case. Some may like Python, others may like some other programming language. Python has a wealth of libraries easy to setup and easy to code. This is an advantage when you what something done in short amount of time.
I really just wonder what goes on in someones mind, when they sit in front of their computer, and instead of doing any of the million things that is possible to do on the internet, they decide to write another pointless language comparison article.
They're trying to determine their own ignorance. It's a useful thing to do not not necessarily a useful thing to publish. Personal branding is one reason to publish this.
I wouldn't say Python is great either, but some of his criticisms are pretty poor.

Having multiple ways to do something (interpolating strings) isn't a bad thing. Usually the newish f strings are the easiest to use, but explicitly assigning variables via the format() function makes things more readable.Perl always had more than one way to do things.

Yes, nested list comprehensions are not readable, then don't use them. I have that as a personal rule.

I agree with him on Python ternary operator. Most languages have "condition", "success", "failure" in that order. This has "success", "condition", "failure" which feels wrong and always takes me longer to parse in my head than it should.

> Having multiple ways to do something (interpolating strings) isn't a bad thing.

It is when the motto of the language says "There should be one-- and preferably only one --obvious way to do it." and that is applied whenever possible.

String formatting is indeed a mess, but that's a hind sight thing. Swift has a super nice system precisely because they are new and looked carefully at everyone else (I'm looking at you D who added string interpolation after swift but in a way that has all the problems of python).

But make no mistake: f-strings are NOT the same as .format()! One is compile time, the other is runtime. You can't localize f-strings.

https://xkcd.com/1987/ This is the main reason I use Golang, apart from speed, clearer syntax and utf-8 baked into the core instead of an after thought. Programming is hard enough, I don't need a rotten toolchain.
Is it Stroustrup who divided languages into those that people complain about and those that nobody uses?
Lack of interfaces and the GIL are my biggest complaints about Python.
As they say, good is the enemy of the great.

Here is a new released book for people coming to D from Python, "D, the Best Programming Language, for Former Python Developers"[1].

[1]https://leanpub.com/dforpython

Just reading this guy I can easily guess where he come from. Something like a newbie that started with typescript and frameworks and consider himself knowledgeable.

Sure python is not perfect, so I expected to see a few valid points for a rant.

But instead, I was surprised to see these really really poor arguments. For exemple, this guy does not look like to have read a basic tutorial, lesson of python that would have told him the difference between lists and iterator things like generators.

I guess he will have hard time to understand the difference between computing a list in full in one go full in memory and iterators that can be efficient and only require having a few items in memory.

In my opinion, where he is very wrong is that the proof that python is a great language is its incredibly big user base size that mostly didn't come from 'hype' (unlike other recent languages), but from world of mouth and convenience!