News for hackers. Stuff that matters.
Re:Java record pattern matching in JDK 19 by hztar on Saturday May 14, 2022 @01:52PM (#31380516)
you sound like a Cobol developer I once knew.. RIP
Re:Java record pattern matching in JDK 19 by quilombodigital on Saturday May 14, 2022 @02:00PM (#31380582)
This is true.... Old guys know nothing... for years we told the javascript guys the mess they were doing, and voila, all dynamic languages suddenly started to convert into statically-typed, and at the end, they have this webassembly, that runs in a schizophrenia-type VM wannabe. Congrats. You lost 10 years of your life because you didnt listen to us when we said that we have learned something from Self and Smalltalk.
Re:Java record pattern matching in JDK 19 by Skinney on Saturday May 14, 2022 @03:50PM (#31381669)
> and voila, all dynamic languages suddenly started to convert into statically-typed

This is... just wrong.

Plenty of people are using JS without any sort of typing whatsoever. Other dynamic languages, like Clojure, Gradle, Elixir, Pharao (a smalltalk), just to mention a few, are still going strong.

> they have this webassembly, that runs in a schizophrenia-type VM wannabe

wasm is mostly being used as a target for C(++), Rust and even C# programs that want to run in the browser. It's there to expand the reach of the browser. Most JS projects don't touch the stuff.

Re:Java record pattern matching in JDK 19 by bigDinosaur on Saturday May 14, 2022 @10:15PM (#31384675)
Typescript is absolutely coming to dominate the field IME. Obviously I have no true idea about the relative use % everywhere but I haven't worked at a place in the last few years that wasn't at least trying to use it. There's enough legacy JS out there to provide work for people who hate static types for many years though.
Re:Java record pattern matching in JDK 19 by igouy on Sunday May 15, 2022 @12:59PM (#31388886)
Re:Java record pattern matching in JDK 19 by kaba0 on Sunday May 15, 2022 @02:31AM (#31385670)
Just a small correction, you likely meant to write s/Gradle/Groovy.
Re:Java record pattern matching in JDK 19 by jstimpfle on Saturday May 14, 2022 @04:00PM (#31381765)
> wasm is mostly being used as a target for C(++)

because... JS isn't good enough?

Re:Java record pattern matching in JDK 19 by samus on Sunday May 15, 2022 @03:04AM (#31385788)
Why should JS be used as a compilation target for C/C++?
Re:Java record pattern matching in JDK 19 by wiseowise on Saturday May 14, 2022 @03:50PM (#31381678)
> This is true.... Old guys know nothing... for years we told the Java guys the mess they were doing, and voila, all OOP languages suddenly started to move to functional paradigm. Congrats. You lost 10 years of your life because you didnt listen to us when we said that we have learned something from ML and Scheme.
Re:Java record pattern matching in JDK 19 by quilombodigital on Saturday May 14, 2022 @06:12PM (#31383148)
good point... but I was not talking about OOP, I was talking about dynamic typing versus static typing. :)
Re:Java record pattern matching in JDK 19 by CipherThrowaway on Sunday May 15, 2022 @06:40AM (#31386678)
Your problem isn't that you're old. It's that you don't understand how little you know in this space and this renders you too arrogant to learn anything new. New to you, that is, because the concept of pattern matching is actually many decades old. You encounter it in undergraduate PLT coursework, famous comp sci textbooks like SICP, and virtually any language outside the imperative/OO lineage.

Thinking you have an I-told-you-so moment with static typing and dynamic languages only shows you don't understand the details and tradeoffs in the design space. For example TypeScript's approach to static typing is very different to Java's and these differences reflect consideration of the problems being solved, JavaScript's specific use cases, its history and the path dependence of its design. Because these details are invisible to you the whole thing is simplified in your mind to "everyone is switching to static typing just like I said they should!" In fact this type of prognostication was never useful or meaningful. The hard part wasn't deciding to build static typing onto JavaScript. The hard part was determining specifically what that should look like, how it would fit nicely with the language and then doing the work of building it and driving adoption.

TypeScript is successful not because it is static typing but because it is a form of static typing that's exceptionally well suited to JavaScript and its use cases. If people like you had their way it would have been a failed attempt to bolt a Java style type system onto JavaScript, worsening the design debt in a language and ecosystem that is already loaded with it. This already happened on a smaller scale with classes in ES6 which were driven by Java devs writing JavaScript and wanting something familiar instead of trying to understand the language.

You might be right that adding pattern matching to Java isn't a great idea but at the moment your disagreement is based in ignorance. You've been given ample explanations of pattern matching in this thread. Put down the ego and take some time to learn on your own.