Hacker News new | ask | show | jobs
by fiddlerwoaroof 1161 days ago
I tried Haskell for a while and switched to Common Lisp (although I still follow Haskell from a distance). My experience just doesn't match up with the claim that a project of any size written in an untyped inevitably descends into a dumpster fire. I've worked on largish systems in several dynamically-typed languages and several statically-typed and I personally haven't noticed any major difference in overall productivity suggesting that static types are better: they just have different friction points and different ways of working work better in each paradigm.
2 comments

This is exactly my experience as well. Code architecture, metaphors, tests, etc have had larger impacts on both initial development as well as long term maintenance and malleability.

Some times, some type systems actually make people jump through hoops to accommodate their design and then it can actually have a negative effect. Other times, the typing helps.

It’s kind of like really good grammar and punctuation. They can make a story you write better and clearer. But they far from guarantee it. You can write a very good story with subpar grammar/punctuation. And you can write a really lame story that is grammar perfect.

One thing that I haven’t seen much in the discussion, is any discussion about Elixir’s matching abilities. Does Rust have that as well? I love what Elixir matching does for my code.

(Edited spelling)

The issue isn't productivity. As far as just slamming out code untyped languages are undeniably faster.

The issue is working on projects once they've reached a certain size where you have no idea what the intent of the original author was and you maybe need to refactor, add-in major pieces, or change anything with the expectation that it continues to work.

I’m including maintenance costs in “productivity”. I’ve worked on large dynamically typed codebases and never experienced what you’re talking about.

I think it’s a question of understanding how to work and think without explicit types rather than something that makes statically typed codebases easier to maintain.

Untyped code bases with microservices are the best code bases out there by far.

They are exceptionally easy to refactor, add-in new parts, etc.

The keyword is microservices, you need to know how to do proper microservices if you are using untyped code.

I dunno. Something like spec, dialyzer, or "assertive" typing (in the case of Elixir) on the boundary works just fine for me.
Microservices just push the problem out of sight — now you need interoperable types between them, there are race conditions, IDEs don’t see inside the black box of other services so refactoring is harder, etc.

They can be the correct solution sometimes, but blindly applying them everywhere is just dumb.