Ask HN: Why use any other languages when Python can do the job?

5 points by tianyi-wang ↗ HN
Hi all,

Python is becoming one of the most popular languages. And with all the backing from big corporations, it will only get faster and more ecosystem. Even when performance matters, the worst case is to write a small bit of your application in Go/Rust/C.

If you are creating a new product today, why would you not choose Python?

11 comments

[ 3.2 ms ] story [ 149 ms ] thread
As a long-time Python coder (2010): dreadful packaging, no threads.
Literally interpreting your question: If you know python, and it can do the job, then there's no reason not to chose it.

However, there are many cases where it can't do the job, and in those cases, the question is obviously, because it can't do the job.

I won't entertain you with a list (and following nitpicky discussion on why I'm wrong about every single item on it) of cases where it won't do the job.

Python it's not suitable for every use case and the context is crucial here.

E.g.: I'm developing a software (python + django) that need a component to run on multiple OS (mostly linux but also windows and some unix) that I can't directly control. I'm learning golang for this specific purpose because doing this in python is just insane.

I need to add a bit more context here since the replies are not quite what I was thinking.

We all say choose the tools best for the job or those that work for you. But the fact is that different tools can do the same job and can work for you. Like I want to build a simple API backend, I can code in Python, Elixir, Go, Rust, Clojure Typescript, OCaml and F#. What should I do then?

My point here is for general-purpose applications, and you know a few programming languages pretty well, it seems choosing Python is the more sensible.

Which is kinda sad, really.

Consider what works. Then pick what’s most fun and move on from there. If you can complete your work with any of the languages, all are the sensible in a vacuum.

Are you trying to grow a team? Still arguable to choose whatever you are best at because you can grow that team.

for scripting, yes...for big codebases, meh

the elephant in the room: semantic spaces...was an issue on day one...will be an issue the rest of its time

>> why would you not choose Python?

No type safety.

GIL (yes, they are working on it).

Slow execution.

Terrible packaging and deployment: should you use pip, pipenv, poetry, conda, setuptools, hatch, micropipenv, PDM, pip-tools, ActiveState platform, homebrew, or your Linux / BSD distro's package manager? "One way to do it"? Nope, it's TIMTOWTDI.

When writing anything new, I have been mainly choosing Rust and Go:

Rust when performance is critical, type safety is important, work is low-level, or the project is expected to be big or long-lasting.

Go for easy, cross-platform "scripting": standard library does most of what is needed. Super-fast build. Easy deployment with just a binary. Can even embed files if needed.

The packing is not really a problem for me. I've been doing Python long enough to know how to navigate that.

I am not denying any other languages have better toolings. But you cannot beat the ecosystem. Every project you interact with, they'd have a Python SDK, but others may not be guaranteed.

And I am thinking more about developing Sass products. There are performance-sensitive bit, but there is also big part of your application that is not.

And I would say most products can be developed in many languages, and they will perform just fine.

So Python's ecosystem saves you time and money to write your own lib because certain things you want to use do not have an SDK in your chosen language.

If Python works best for you and your project's needs, by all means use it.

All tools have advantages and disadvantages which make them better suited for some types of work and less well suited for others.

You could swap Python here for Ruby, JavaScript or 12 other languages based on your personal preference. For most of what most of us are building rock solid libraries exist to do the task at hand. It's okay if you like Python, but many of us don't. :)