by wredue · 2y ago · 0 comments
Now their garbage keeps crashing with stack overflows, and they complain when files are bigger than a few hundred lines.
We accidentally pushed a 10,000 line file once and it brought the entire bus to a crawl for an hour. TEN THOUSAND LINES.
One day, these twerps pushing this stupidity of “copy everything always cause ‘it’s easier to reason about dawg’” are gonna get theirs.
> One day, these twerps pushing this stupidity of “copy everything always cause ‘it’s easier to reason about dawg’” are gonna get theirs.
Making defensive copies is literally item 39 of Effective Java by Josh Bloch.
The Haskell way is to not bother with that shit, because you don't have to.
You need to be careful about stack overflows when you use manual recursion, but in most cases (even in Haskell) you don't write explicitly recursive functions, you call higher-order functions like map, reduce, etc. instead that are written so they don't run into those problems (those are implemented with tail recursion in Haskell, which is eliminated, but in Java, I assume they're implemented with iteration).
I have no love for Haskell or functional programming, but the problem here isn't FP per se, it's that they tried to jam it into Java.
Don't fight the language or framework. If you are using Java, write idiomatic OOP code. If you want to write FP on the JVM, then start writing Clojure or Scala. If the business won't let you write Clojure or Scala, then do it on your own time and/or change jobs.
Looks like your FP zealots didnt learn how to compromise on that point or how to work with constness in general.