Hacker News new | past | comments | ask | show | jobs | submit login

I started writing in Python this January, after spending years in Java, C, C++ ad PHP. (In academia, Pascal.)

I would say quite explicitly that Python is a lot better than C, at least as long as you value pure concentration on the business logic of whatever you are implementing. Its libraries are helpful, huge and well documented.

I am overjoyed by the fact that I don't have to a) either reinvent the wheel myself (e.g. writing a JSON parser from scratch) or b) rely on some OSS library with a bus factor of 1, whenever I just need to store or read data etc.




The Python honeymoon period lasts a long time. For me it lasted until the monolith I was working on had grown to ~500k lines of code. At that scale the smallest changes would cause (seemingly) unrelated breakage, despite many thousands of tests saying all was good. Python’s “anything is anything” philosophy made me miss the predictability of C and Java. Granted, that was before type annotations had taken off so maybe things are better nowadays.


In that case, blessed is me, because my Python projects are small-ish mutually independent modules ("probes") that only communicate using a specific JSON-based protocol over HTTPS.


Type annotations... help. They're not great, but they're better than nothing.


PyCharm handles them really well and I am happy that I started with Python 3.11.


I should elaborate that when I write "better than nothing", I'm someone with a background in strongly-typed programming languages (OCaml, Haskell, Rust) and even more strongly-typed programming languages (Idris, Coq, Twelf).

It's unlikely that Python type annotations will ever be able to achieve something comparable to what many of these languages had during the 90s. They're useful, but if you need strong static safety guarantees, Python is the wrong tool for the task.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: