Hacker News new | ask | show | jobs
by rdnetto 3436 days ago
> Static typing helps a lot to catch basic type errors but it is surely not the "Messiah" of code safety.

I'd argue that type safety is only one benefit of strong types - the others being better documentation[1] and a design which is clearer and easier to reason about.[2] You can get both in a dynamically typed language, but they're much less common since the compiler doesn't require them.

[1] I've lost count of how many times I've looked at some function in Python or Javascript and had no idea what kind of values I was supposed to provide.

[2] My go-to example of this is how in Persistent (a Haskell ORM), values which have been inserted into the database (entities) and which have not have different types, since the non-inserted values don't know what their primary key is yet. This makes it much easier to reason about where the values are coming from and what needs to be done with them.

> Stack works only because it is an isolated repository where the maintainers have to take a lot of attention to make sure that new code doesn't break other code.

In practice, the only breakage checked for is compilation errors. The onus is still on library authors to declare compatibility bounds in their cabal files, which is why [PVP](http://pvp.haskell.org/) is still a thing.

I'm also not sure how accurate it is to call it isolated - it's pretty much at the centre of the ecosystem at this point.

1 comments

> I'm also not sure how accurate it is to call it isolated

It's entirely inaccurate to call it isolated - you can trivially pull in other packages from hackage.