News for hackers. Stuff that matters.
Re:Are dynamic languages going to replace static languages? ... by jimsimmons on Wednesday August 04, 2021 @03:25AM (#28058248)
It’s slow and cumbersome to write. Makes code verbose and harder to read.
Re:Are dynamic languages going to replace static languages? ... by skohan on Wednesday August 04, 2021 @04:30AM (#28058633)
Yeah this might be true of Java, but I think for modern languages with good type inference it adds a lot to readability without much cost in terms of verbosity.

After working with more strongly typed languages, it actually seems crazy to go back to JS or Python and not have type information in function signatures. Like how are people supposed to read code and understand what this function is allowed to take?

Re:Are dynamic languages going to replace static languages? ... by joelbluminator on Wednesday August 04, 2021 @04:33AM (#28058646)
Functional programmers also say "how can I go back to mutable state and OOP". The fact is people get stuff done in many different ways and paradigms. You found what works for you and that's good, stick to it. Others found theirs.
Re:Are dynamic languages going to replace static languages? ... by arcturus17 on Wednesday August 04, 2021 @05:08AM (#28058839)
You can annotate types in Python and Typescript.

Before that large companies like Google got around it by annotating in the comments. It may be an inferior solution but huge codebases serving hundreds of millions of users have worked this way.

Re:Are dynamic languages going to replace static languages? ... by gefhfff on Wednesday August 04, 2021 @05:24AM (#28058956)
Huge code bases serving hundreds of millions have been written in wasm, so...? Bad argument
Re:Are dynamic languages going to replace static languages? ... by arcturus17 on Wednesday August 04, 2021 @05:29AM (#28058990)
There was no argument, the commenter was just asking “how”.
Re:Are dynamic languages going to replace static languages? ... by kaba0 on Wednesday August 04, 2021 @05:54AM (#28059143)
Modern Java is not what people may remember. It has var keyword for local type inference, lambdas, etc.
Re:Are dynamic languages going to replace static languages? ... by einherjae on Wednesday August 04, 2021 @03:33AM (#28058296)
Except that very verbosity may make it easier to read, as the types themselves may supply further information to the reader about what the variable actually means.
Re:Are dynamic languages going to replace static languages? ... by jim-jim-jim on Wednesday August 04, 2021 @05:52AM (#28059134)
I think this is noisy.

  f(x: a, y: b): c = ...
I think this is nice.

  f :: a -> b -> c
  f x y = ...
Signatures are useful as self-documentation, and keeping them separate makes that easy to scan.

It also comes down to the compiler. If you're "annotating" your code with type "sugestions," but don't get any ironclad guarantees from it, then it's reasonable to question whether it's even worth the effort. I may be misremembering things, but "typed" versions of Python and Scheme aren't particularly rigorous.

Re:Are dynamic languages going to replace static languages? ... by user-the-name on Wednesday August 04, 2021 @05:43AM (#28059076)
Verbosity aids readability a lot of the time.