4 ms·
Very true. One of my first forays into Haskell came during the Google Code Jam, after seeing how short and elegant Reid Barton's solutions where. I solved the
by rfurmani 14y ago
Very true. One of my first forays into Haskell came during the Google Code Jam, after seeing how short and elegant Reid Barton's solutions where. I solved the problems, but the programs were horribly slow, so I checked how Reid got around it: oh, he doesn't just map things and use the standard style, he needs some special constructs from the libraries.. it looks mathematically equivalent, but it looks plausible that the old way ends up holding onto too much data in memory. I eventually stopped when I realised that it would always take more time than hammering it out in C++, even if the final product in Haskell is shorter and more elegant. In fact, outside of writing APIs and frameworks, the desire for elegance seems debilitating. This also reminds me of how when I was most seriously practicing for Topcoder I could consistently produce shorter solutions than tomek (the top ranked guy far and away at that time) he would finish more quickly, since once he types it in it's done.
For the record I'm now using Python (and some R) but I think I'd like Go.