Live data from Hacker News

Ask HN: Which Python type checker should I use?

news.ycombinator.com

81–83 of 83 posts

Re: Ask HN: Which Python type checker should I use?

#81

Earlier quoted context omitted.

> pyflakes and a few tests find a great majority (not all) of errors devs actually have. No they don't. First of all people are really bad at writing tests. Secondly, writing tests sucks; I would much rather write static type annotations than tedious type checking tests: you know when to stop and you get the other benefits of static types like making the code easier to read and navigate. Every piece of code I've adde…

I’ve rescued two very large Python projects bordering on disaster, and have improved many more. In both cases the main problems were architecture-related, they were written at the wrong level of abstraction, then in the wrong language. Those need to be fixed first if you value your time. Typing errors were not a top-ten concern: https://news.ycombinator.com/item?id=39161025 I.e. there are bugs, there are always bugs.…

> Typing errors were not a top-ten concern

You're looking at a bridge made of wet cardboard and saying you shouldn't use FEA when designing bridges because the real problems are the fact that it's made of cardboard and it's wet.

> Also you don’t write tests just for types.

Not just. But you do have to write those tests as well if you don't use static typing. I have seen them written. Static typing reduces the number of tests you need to write. This is very very very well known.

> Black/white adolescent appeals to the one-true-way are not compelling and why you did not convince, then or now.

No, it's because you view static types as an admission that you might make mistakes and you don't want to admit that to yourself. You literally equated making typing mistakes with punching yourself in the face.

Re: Ask HN: Which Python type checker should I use?

#82

Earlier quoted context omitted.

Given no other context, it's not very helpful

Agree. It also seems a direct contravention of the guidance "Please don't post shallow dismissals.... A good critical comment teaches us something. " https://news.ycombinator.com/newsguidelines.html

I didn't know about the guideline, so thank you, even if I disagree with it. A shallow dismissal is anyway a signal you can ignore, but meaningful, especially when people flock and say the opposite. Maybe people don't have definite ideas about things, and just want to say "no" because they feel like, and that's freedom, imho. Anyway I don't use types or type checking, I think that they are the crippling reason why I switched to Python in the first place. There are plenty of typed languages or IDEs that do completion nowadays (which I don't use), but the freedom to completely rearrange the architecture of a program that comes from very loose coupling is not easily traded for compilation time warnings. We've been doing tests because typing blocked us from development, and we just wanted to be able to screw things if we wanted. The company I work for, Odoo, big opensource ERP, also doesn't have types at all. If I wanted types, or a fast language, or "precise interfaces" I would definately rewrite. When I developed in C#, most of the coding time was spent on typing, interfaces, adapters, factories.

Re: Ask HN: Which Python type checker should I use?

#83

Earlier quoted context omitted.

I’ve rescued two very large Python projects bordering on disaster, and have improved many more. In both cases the main problems were architecture-related, they were written at the wrong level of abstraction, then in the wrong language. Those need to be fixed first if you value your time. Typing errors were not a top-ten concern: https://news.ycombinator.com/item?id=39161025 I.e. there are bugs, there are always bugs.…

> Typing errors were not a top-ten concern You're looking at a bridge made of wet cardboard and saying you shouldn't use FEA when designing bridges because the real problems are the fact that it's made of cardboard and it's wet. > Also you don’t write tests just for types. Not just . But you do have to write those tests as well if you don't use static typing. I have seen them written. Static typing reduces the number…

Jokes aside, a decent IDE will find errors like you mentioned. Don’t need to add types either, the static analysis will find it.

Turns out the trivial errors you’ve having trouble with are not a substantial problem with the right tools. As mentioned in my first reply.

Post reply on HN