3 ms·
> I'm starting to think that every thread about FP is pretty much identical on HN Spot on. Where is Haskell actually used? No I meant apart from Facebook and
by mrkeen 6y ago
> I'm starting to think that every thread about FP is pretty much identical on HN
Spot on.
Where is Haskell actually used? No I meant apart from Facebook and Uber and Klarna.
> Just go and get hyped when the next minor FP feature gets integrated into your favourite language
We already have immutability in Java - why, the designers themselves made Strings immutable [1]
We said goodbye to nulls in Java [2] but in case you really don't like nulls you can also say goodbye to them by switching from Java to Kotlin, which doesn't have them [3] but also does [4].
If you want to cut down on some boilerplate (without moving to Kotlin), you can try type inference in Java [5]:
> For example, consider the following variable declaration:
Map<String, List<String>> myMap = new HashMap<String, List<String>>();
> You can substitute the parameterized type of the constructor with an empty set of type parameters (<>):
Map<String, List<String>> myMap = new HashMap<>();
Go got rid of Generics which made programming so much simpler. I can't wait for its new Generics feature though.
But if you really need that functional stuff - the best thing writing Java code is that it runs on the JVM, so you can code in Scala instead. And if that argument doesn't make you want to code in Java I don't know what will.
[1] https://javarevisited.blogspot.com/2010/10/why-string-is-immutable-or-final-in-java.html https://javarevisited.blogspot.com/2010/10/why-string-is-imm...
[2] https://programmer.help/blogs/finally-i-m-happy-to-say-goodbye-to-null-say.html https://programmer.help/blogs/finally-i-m-happy-to-say-goodb...
[3] https://medium.com/kayvan-kaseb/say-bye-to-nullpointerexception-in-kotlin-c8f0bae2c773 https://medium.com/kayvan-kaseb/say-bye-to-nullpointerexcept...
[4] https://stackoverflow.com/questions/50427490/nullable-type-still-throw-nullpointer-exception-at-kotlin https://stackoverflow.com/questions/50427490/nullable-type-s...
[5] https://docs.oracle.com/javase/tutorial/java/generics/genTypeInference.html https://docs.oracle.com/javase/tutorial/java/generics/genTyp...
- li4ick 6y agoI use Haskell because it actually delivers on the promise of software reusability. In his book, John Ousterhout wrote a wonderful phrase: "increments of software development should be abstractions, not features.". I completely agree. Even though the JVM ecosystem is great, I dislike the languages that run on it, Clojure being an exception. To filter out OOP, it fundamentally abstracts the wrong thing. Modules should abstract functionality, not data. And that's why I don't want anything to do with Java.
- codygman 6y ago> Go got rid of Generics which made programming so much simpler. I can't wait for its new Generics feature though. What? If getting rid of generics made programming so much simpler why can you not wait for its new Generics feature?