←back to thread

517 points bkolobara | 3 comments | | HN request time: 0.001s | source
Show context
koakuma-chan ◴[] No.45041723[source]
I encourage every one to at least stop writing code in Python.
replies(5): >>45041794 #>>45041941 #>>45042073 #>>45043031 #>>45049992 #
veber-alex ◴[] No.45041941[source]
Here is some actual useful advice:

Use a type checker! Pyright can get you like 80% of Rust's type safety.

replies(7): >>45042031 #>>45042063 #>>45042147 #>>45042269 #>>45043223 #>>45047269 #>>45050186 #
koakuma-chan ◴[] No.45042031[source]
I don't agree that Python can be saved by a type checker. The language itself is flawed irreversibly, as well as its ecosystem. It's a big big mess. Can't build reliable software in Python.
replies(5): >>45042142 #>>45042151 #>>45042254 #>>45042267 #>>45047827 #
ninetyninenine ◴[] No.45042267[source]
It can't be 100% saved, but like the OP said it's 80% saved.

It's not true you can't build reliable software in python. People have. There's proof of it everywhere. Tons of examples of reliable software written in python which is not the safest language.

I think the real thing here is more of a skill issue. You don't know how to build reliable software in a language that doesn't have full type coverage. That's just your lack of ability.

I'm not trying to be insulting here. Just stating the logic:

   A. You claim python can't build reliable software.
   B. Reliable Software for python actually exists, therefore your claim is incorrect
   C. You therefore must not have experience with building any software with python and must have your hand held and be baby-sitted by rusts type checker.
Just spitting facts.
replies(1): >>45042484 #
koakuma-chan ◴[] No.45042484[source]
If you know some secret behind building reliable software in a programming language without types, with nulls, and with runtime exceptions, I'm all ears. I admit that a blanket statement "can't build reliable software" is going overboard, but the intention was to be dramatic, not factually correct. You can probably build reliable software in Python if you write everything from scratch, but I wouldn't want to do that to myself. I would rather use a programming language that has a type system, etc, and a better cultured ecosystem.
replies(1): >>45043515 #
ninetyninenine ◴[] No.45043515[source]
I prefer types too.

But I can build reliable software without types as well. Many people can. This isn’t secret stuff that only I can do. There are thousands and thousands of reliable software built on Python, ruby and JavaScript.

replies(1): >>45047838 #
1. mixmastamyk ◴[] No.45047838[source]
Indeed, I write very reliable Python every day. A lot faster than the Rust straitjacket too.

We had sentry installed so I know exactly how many exceptions were happening, rare to zero. Lots of tests/constraints on the database as well.

That said I like a nice tight straitjacket at other times. Just not every day. ;-).

P.S. Python doesn’t have the billion-dollar-mistake with nulls. You have to purposely set a variable to None.

replies(1): >>45049395 #
2. ironlenny ◴[] No.45049395[source]
OP was needlessly combative. But, if I have to write a program that is correct (i.e. does what I want it do to), I'm going to write it in Rust. Not because you cannot write correct programs in Python. But because it's easier to prove it's correct in Rust.

As a solo dev, I find that I start off in Python, but at a certain project size I find it too unwieldy to manage (i.e. make changes without breaking things) and that's when I implement part or all of the project in Rust.

replies(1): >>45054170 #
3. mixmastamyk ◴[] No.45054170[source]
> have to write a program that is correct

Yes, exactly. It doesn’t happen that often, but it does.

And folks have forgotten, not sure why, but Python was always billed as a prototyping language in the “olden tymes.” Or even “executable pseudocode.” At those it excels.