4 ms·
As they say, "the determined Real Programmer can write FORTRAN programs in any language.". ADTs and pattern matching go hand in hand, and they - along with imm
by haspok 3y ago
As they say, "the determined Real Programmer can write FORTRAN programs in any language.".
ADTs and pattern matching go hand in hand, and they - along with immutable structures - are the cornerstones of functional programming. They provide you very strong compile-time guarantees in a very elegant and readable form. I like to write code this way, and out of 10k LoC I would estimate at least half is ADTs and pattern matching for me. Maybe more.
Too bad that although Java's ADTs are coming along nicely, pattern matching is in it's infancy (due to limitations inherent in Java). This is the single language feature I miss the most from Java and Kotlin from Scala.