5 ms·
I find the language percentage information (~ Java 57%, Scala 37%, Haskell 5%)[1] a bit scary (and admittedly hilarious), given that I have only serious experie
by egeozcan 10y ago
I find the language percentage information (~ Java 57%, Scala 37%, Haskell 5%)[1] a bit scary (and admittedly hilarious), given that I have only serious experience with Java among the three.
[1]: http://i.imgur.com/zRwFzSC.png http://i.imgur.com/zRwFzSC.png
- supster 10y agoThat is super interesting; I would love to see how Clojure compares.
- deleted 10y ago[deleted]
- stepvhen 10y agoWell the 99-problems were originally in Prolog, and many have to do with list manipulation, something that Haskell has built in. Additionally, Haskell will benefit from its lazy, functional nature, which makes dynamic programming, searching, and even some data structures a little cleaner. I haven't worked with Java in quite a while, but I imagine that it still requires a lot of boilerplate and set up for trivial things in other languages. I'm sure if C were also included it would be the most verbose.
- spullara 10y agoJava does still include some boilerplate for setting up classes — though that may go away in 10 when they add scripting. However, it is a lot more terse than in 7: package com.shekhargulati.ninetynine_problems._02_arithmetic; import java.util.stream.LongStream; /** * (**) Determine whether a given integer number is prime. */ public class P31 { public static boolean isPrime(long number) { return !LongStream.rangeClosed(2, Math.round(Math.sqrt(number))).anyMatch(n -> number % n == 0); } }
- joe_fro 10y agoI was curious about this and took a look at the repositories. If you look at the Java repository and the Scala repository there seem to be a lot of additional folders as compared to the Haskell problem set. I'm sure Haskell would still come out ahead, but it's not clear that you can get an accurate picture from just looking at the amount of code as reported by github.
- lgas 10y agoThe github numbers are correct: $ find ./java8 -name \*.java | xargs wc -c | tail -1 123903 total $ find ./scala -name \*.scala | xargs wc -c | tail -1 80516 total $ find ./haskell -name \*.hs | xargs wc -c | tail -1 11234 total
- deleted 10y ago[deleted]