4 ms·
Or you could just use a statically typed language and get a much better experience.
by scuff3d 1y ago
Or you could just use a statically typed language and get a much better experience.
- fnord77 1y agoA entire class of bugs, wiped out by a thing called a "compiler". Gigahours of downtime and bug fixing globally prevented by a modest extra step up front. Great stuff.
- scuff3d 1y agoI had someone say to me they preferred strict type checking in a Python linter over a statically typed language because they "don't like a build step"... Dudes it's literally just worse compilation with extra steps.
- __MatrixMan__ 1y agoI'm in favor of partitioning the set of reasons it can fail to compile into separate checks with separate tools. Taming the zoo of tooling is extra work, but smaller more focused tools are easier to work with once you understand their relationship to their neighbors. There's a world of difference between: > I've been using a different type checker and I like it, you should try it And > I'd like to switch our project to a different compiler The former makes for more nimble ecosystem.
- scuff3d 1y agoYes, if you are stuck with Python something is certainly better than nothing. But we shouldn't be writing large production apps in it in the first place.
- __MatrixMan__ 1y agoShould we be writing large apps at all?
- scuff3d 1y agoI don't know how to respond to this. Yes, large software projects do in fact exist...
- deleted 1y ago[deleted]
- ashu1461 1y agoSometimes that is not an option, consider the bias which python gets due to all the LLM libraries being python first.
- krzat 1y agoYeah, I thought lack of typing in python was intentional to support this another paradigm of programming for geniuses who don't need hand holding. Turns out they just didn't know any better?
- scuff3d 1y agoHow would a static type system have anything to do with handholding?
- chpatrick 1y agoWould you? Why? Python has a great experience for a bunch of tasks and with typing you get the developer experience and reliability as well.
- pansa2 1y ago> Why? Python’s 3 traditional weak spots, which almost all statically-typed languages do better: performance, parallelism and deployment.
- chpatrick 1y agoNone of those things are to do with typing. Python is slow because it's interpreted, bad at parallelism because of the GIL (which is going away), and bad at deployment because of the messy ecosystem and build tools (although it's pretty good with Nix). Conversely other languages aren't good at those because of static typing. It is a great choice though for many problems where performance isn't critical (or you can hand the hard work off to a non-Python library like Numpy or Torch). Typing just makes it even better.
- scuff3d 1y agoNo you don't. You get the illusion of static types without the actual upsides. For any even medium sized project or anything where you work with other developers a statically typed language is always going to be better. We slapped a bunch of crap on Python to make it tolerable, but nothing more.
- chpatrick 1y agoI disagree and I've been using Haskell professionally for ten years so I know what I'm talking about when it comes to types. Typed Python isn't perfect but it's totally workable with medium sized projects and gives you access to a great ecosystem.
- scuff3d 1y agoEveryone knows Haskell is only used for white papers :p Yeah it's workable, and better than nothing. But it's not better than having an actual static type system. 1. It's optional. Even if you get your team on board you are inevitably going to have to work with libraries that don't use type hints 2. It's inconsistent, which makes sense given that it's tacked onto a language never intended for it. 3. I have seen some truly goofy shit written to make the linter happy in more complex situations. I honestly think everything that's been done to try to make Python more sane outside outside scripting or small projects (and the same applies to JS and TS) are a net negative. Yes it has made those specific ecosystems better and more useful, but it's removed the incentive to move to better technology/languages actually made to do the job.