3 ms·
Curious, if you were aiming at writing in a functional programming style, why didn't you try Clojure?
by Scarbutt 10y ago
Curious, if you were aiming at writing in a functional programming style, why didn't you try Clojure?
- yawz 10y agoIf I may jump in, here, for my 2 cents, I've never developed anything commercial with Closure, but I learned it, have played with it and have quite enjoyed it. Having never done any Lisp(-based language) programming before it didn't come... naturally. My guess is that the parent commentator didn't include it for that reason.
- tormeh 10y agoIt doesn't have compile-time type checking. When many people say functional code they really mean code that can be and is strictly type checked at compile time. Clojure is functional, but it's not what most people want when they say "functional".
- mlmlmasd 10y agoType-checking doesn't really have any bearing on weather a language is functional. Functional languages can be statically or dynamically typed.
- Sammi 10y agoIt's one of the big differences between the lisp and ml types of functional languages I would say. Other than the parentheses that is of course :) I've never been comfortable doing big projects - multiple files, more than a few hundred lines of code - in a dynamically typed language. It's the same reason were seeing the big uptake of typescript. Statically typed languages give us so many superpowers when we need to do refactoring or any changes at all to an existing codebase. Just changing a function name in a dynamically typed language can be hell. Rearranging the parameter order is even worse, cause you have such trouble finding all of the function uses and where you need to update. With statically typed languages you get editor support for simple stuff like this and it becomes automatic and a push of a button almost.
- mlmlmasd 10y agoStatic typing is great. My point is that whether a language is statically or dynamically typed has no bearing on whether it is functional.
- kybernetikos 10y ago"It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures." —Alan Perlis Functional style in my opinion is about creating functions that operate on standardized data structures. Class based type systems actively discourage functional style, even when the language gives you a functional veneer over your OO code. Haskell avoids this problem by using algebraic data types instead of class style types. Clojure avoids this problem by using dynamic typing. I definitely do not associate 'functional' with static typing.