I think, especially in programming language communities, that there tends to be a preference towards making a static language for their compile time guarantees, and this is a pretty concrete counterargument as to why people find dynamic languages “easier to program in”

  • philluminati@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    11 months ago

    Very long and a little bit of tricky read but certainly interesting observations. As a Scala developer I actually see the problem with static vs dynamic code all the time. A desire to force everything into the static type system so errors are found early is commemerable, but even in places it doesn’t necessarily make sense. A common example is taking user input and shoving it in a cats NonEmptyList. A type which exists soley so that calling .head won’t cause an exception. Apparently using .headOption is a deal breaker. The other place is the desire to serialise classes into json structures automatically. This is again commendable and makes programming much easier in some constraints, but it then remanifests as a problem when you realise that internal types and external types need to diverge in some way. At runtime it’s easy to change mappings between two arbitrary structures and you can inspect the data, but trying to do it via the limited language exposed by a macro is painful.

    • bitcrafter@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      I agree with your second point but not the first, because presumably the code processing user input has a better idea of what to do if the input is invalid because it is an empty list then some other random part of your program that requires a non-empty list but finds out that it has been given an empty list instead.