static typing is better but I'm not gonna tell anyone they're wrong for choosing dynamic typing. if they appreciated being told when they're making a mistake they wouldn't be using a dynamically typed language in the first place
@fool Yeah, exactly! Let me discover on my own that it's a mistake at 3 am when everything is burning just like god intended it.
@fool The only possible exception I've seen is ocaml, but it uses strict dynamic typing unlike every other language I've seen.
It checks *at compile time* whether a call to a class is type consistent.
Without declaring any of the classes involved in any of the variables.
Because it can (as could any other dynamically typed language that cared to)
What I've been saying is, if the inferred type is what you want, you don't need the type declaration, but you may still want it as a form of documentation.
It checks them because it can, and because it was designed so that it can.
Not every language could, if it cared to.
Haskell, Zig, and Rust AFAIK don't need type declarations most of the time either.
Also, the modern so called "C++" has grown an `auto` keyword which in many cases can be used for type inference as well...
Scala and Kotlin have type inference to some extent as well, from what I've read.
But yeah, for me too OCaml was the first language where I saw type inference at work.
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!