6 ms·
> Personally I prefer gradual type systems that need less up front wrestling so that the coding process is more productive, more time can be spent on tuning the
by apgwoz 3y ago
> Personally I prefer gradual type systems that need less up front wrestling so that the coding process is more productive, more time can be spent on tuning the design rather than “finally I made it work” acceptance of compiler driven design.
If your style is to hack hack hack until it’s right, yeah, types are challenging. If your style is to think first about types, you can also create guardrails in your code that naturally create the correct thing.
Static vs Dynamic vs Gradual… it’s really more a question of “how does my brain like to get to a solution and keep it functioning” and I find that fascinating.
- deprecative 3y agoI think there's a line or maybe some Venn Diagram meme about hack back hackers and "I'll refactor this later". Not trying to start anything with either type. We're all guilty of these platitudes and well intentioned lies.
- MaxBarraclough 3y ago> it’s really more a question of “how does my brain like to get to a solution and keep it functioning” and I find that fascinating Sure, but this is largely a matter of training and experience. Plenty of fans of dynamically typed languages just haven't learnt how to make effective use of decent static type systems.
- Exoristos 3y agoAnd plenty of them wouldn't want to learn it, so I think OP's observation still holds.
- auggierose 3y agoStatic type systems are premature optimization, and come with all of its problems. So a more fluid solution is a great thing, if done right. TypeScript comes to mind, although it has other problems, in particular mutable data structures by default.
- clhodapp 3y agoWhy do you say that static type systems are a "premature optimization"? On its face, that seems like a (very spicy) opinion that's been stated as fact.
- auggierose 3y agoIt is a fact, that is why I state it as one. You are basically trying to write a correctness proof before you actually have a good idea of what it is you are trying to build. I've done this plenty of times myself, and it is a good way to waste time and tell yourself you are productive. Yes, I am also looking at all the "let's rewrite stuff in Rust" projects. Especially problematic is that the type system doesn't necessarily reflect the correctness you care about, but just some properties the language cares especially about. You are spending your time trying to shoehorn your solution into somebody else's idea of correctness, who doesn't really know anything about your program at hand. That's why I like TypeScript, its type system is expressive enough for many simple correctness checks I actually care about, while at the same time not getting (too much, and with the above caveats) in the way of how I think about what I build. It is especially clear to me that static type systems are dinosaurs of the past. The future is on-the-fly checking of arbitrary logical properties of your program, which can always contain what static type systems used to be for as a subset.
- naasking 3y ago> Especially problematic is that the type system doesn't necessarily reflect the correctness you care about, but just some properties the language cares especially about. You're neglecting that these guardrails guide you towards solutions that can be naturally expressed and checked by the language. That's a feature, not a bug. > The future is on-the-fly checking of arbitrary logical properties of your program, which can always contain what static type systems used to be for as a subset. Yeah, except for logical consistency or soundness, but who cares about that?
- auggierose 3y ago
- samatman 3y agoI've been getting a lot of mileage out of Julia recently, and would counter that plenty of fans of statically typed languages just haven't learned to use an effectively-typed dynamic language. It's great, give it a shot sometime.
- samatman 3y agoHere, lemme help those of you who would rather use your reflexes than your frontal cortex https://docs.julialang.org/en/v1/manual/types/ https://docs.julialang.org/en/v1/manual/types/ It's possible to get the advantages of a dynamic runtime and the advantages of a powerful type system, Julia is proof of that.