← Back to context

Comment by foxygen

13 hours ago

Why?

Without agreeing (or disagreeing) with their larger point, dynamic types become more of liability as a project gets larger

Like "schemaless" database applications, there's always types/schema somewhere: the choice is if they'll be explicitly defined at the place of construction, or implicitly spread out across all the places data happens to flow in your application. And the more places there are, the more spread out they'll be.

Static typing is also really nice for game dev since proper unit tests are harder (but not impossible) compared to your average CRUD app.

  • The other side of the argument is that dynamic typing is great for prototyping and can allow for more compact code.

    The discussion is exhausting because many people don't understand the difference between weak typing and dynamic typing. You basically never want weak typing but dynamic typing has legit uses. Yes JS is both weakly and dynamically typed and that sucks but Common Lisp shows you can have very strong typing and dynamic types.

    Lots of very complex software has been writing in dynamically typed languages. The whole Erlang/Elixir world is dynamically typed though Elixir is getting gradual typing.

    There is a good reason gradual typing is getting popular, you get the best of both world. You can prototype quickly and then add types and make everything more solid later.

    (Which also why you want to always use a statically typed language in the corporate world because there is never a "later" and the bigger the team the more important it is to have the lang enforcing discipline. But not every programming is corporate.)

    People that are dogmatic about static typing show their immaturity. The older I get the more I realize that there is no right or wrong way to program, everything it tradeoffs and "it depends".

    • Exactly which part of my comment seems dogmatic?

      You literally start your comment by reaffirming my point (prototyping, like when you tend to have a smaller code base?)

      Feels like you replied to a comment you imagined based on past interactions, not anything I actually wrote.

      1 reply →

  • > dynamic types become more of liability as a project gets larger

    Why?

    • > there's always types/schema somewhere: the choice is if they'll be explicitly defined at the place of construction, or implicitly spread out across all the places data happens to flow in your application.

      > And the more places there are, the more spread out they'll be.

      3 replies →