Comment

Comment by captainmuon

Funny, I'd say I like functional programming... and yet I disliked all the functional and/or lisp-like languages that are the bees knees these days... Scala, Scheme, Clojure, Haskell, F#, ... All of them have neat sides, but I'm not really productive in any of them.

There are things like too-clever type systems that get into your way, instead of catching errors. Constness can be silly in C++ if you are not careful, but that's nothing against the situation in e.g. Haskell.

Then there is type inference, which really scares me. When I write (in pseudocode):

fun add(a, b) { return a + b; }

the meaning can change depending on how this is called at a different place in my code (e.g. with strings or ints as arguments). On the one hand, this confuses me - if there is a conflict, it can be incredibly hard to debug. On the other hand, the compiler can get confused. If I call add(get_number(x), get_number(y)), I know that a and b are going to be ints, but the compiler might be unable to infer this, depending on how complex get_number is. Type inference is magic, and IMHO often not worth the saved keystrokes. I'd rather have my language use a Variant type when no type is specified (and sure, when it can infer the type, use it as an optimization).

parent captainmuon 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton