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 The only possible exception I've seen is ocaml, but it uses strict dynamic typing unlike every other language I've seen.

@wolf480pl @fool you don't declare the type, it detects it.

So you can declare a method to take a generic type and it will type check it against each call to that method.

@RandomDamage @wolf480pl lots of statically typed languages have type inference

@fool @wolf480pl ocaml is the only one I have experience with that has type inference and strict typing

@RandomDamage @fool
The reason OCaml is still a statically typed language is that it can give you errors at compile time.

A language with strong dynamic typing would instead throw an exception at runtime when you pass a wrong type.

@RandomDamage @fool
In static typing you can detect a type error at compile time.

This is true for OCaml, C, Java, etc.

@wolf480pl @fool right, but with ocaml it checks for type errors even when you have a generic method.

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)

Follow

@wolf480pl @fool [OK, I may have been sloppy in usage there. In my defense I'm 3 shots of rum into a Sunday evening]

· · Web · 0 · 0 · 2
Sign in to participate in the conversation
Mastodon for Tech Folks

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!