337
submitted 11 months ago by 257m@lemmy.ml to c/programming@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] r1veRRR@feddit.de 57 points 11 months ago

Compiler checked typing is strictly superior to dynamic typing. Any criticism of it is either ignorance, only applicable to older languages or a temporarily missing feature from the current languages.

Using dynamic languages is understandable for a lot of language "external" reasons, just that I really feel like there's no good argument for it.

[-] SpaceCowboy@lemmy.ca 8 points 11 months ago

Yeah the error list is my friend. Typos, assigning something to the wrong thing or whatever is fixed without having to run the code to test it. Just check the error list and fix any dumb mistakes I made before even running the thing. And I can be confident in re-factoring, because renaming something is either going to work or give a compiler error, not some run-time error which might happen in production weeks later.

[-] hairyballs@programming.dev 2 points 11 months ago

It's much easier to work with streams of untyped data in a weakly typed language.

[-] spokenlollipop@lemmynsfw.com 2 points 11 months ago

Even when you're using a dynamically typed Lang you should be using all the appropriate scanners and linters, but so many projects just don't.

I joined a large project half way through and I ran pylint and stared as the errors (not just style stuff) poured out...

[-] flakusha@beehaw.org 1 points 11 months ago

Dynamic languages are good for prototyping, especially if a lot of libraries available

[-] darcy@sh.itjust.works 1 points 11 months ago

true but i dont think is really a hot take?

[-] kaba0@programming.dev 1 points 11 months ago

I do believe that static typing is at least a local optimum, but I am still not entirely convinced. Rich Hickey is a very convincing presenter and I can’t help but think that he is on to something — with Clojure the chosen direction is contract-typing, which is basically a set of pre- and post-conditions for your functions that are evaluated at runtime. Sure, it has a cost and in the extremes they are pretty much the same as dependent types, but I think it is an interesting direction — why should my function be overly strict in accepting a “record” of only these fields?

this post was submitted on 01 Sep 2023
337 points (96.2% liked)

Programming

16687 readers
245 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS