3 ms·
You seem to be intentionally taking that Clojure code out of context. The refactored of version of that code, which compares much more favorably with your C# 3.
by markerdmann 17y ago
You seem to be intentionally taking that Clojure code out of context. The refactored of version of that code, which compares much more favorably with your C# 3.0 version, was given as:
(reduce (sum-field :productioncost) 0
(filter doubleMargin?
(map attach-liquid-value assets)))
- snprbob86 17y agoOn the contrary, I think that the C# code the author presented was unfairly IN CONTEXT. It showed using statements, a namespace, the program entry point, and other boilerplate. While I agree that C# has a non-trivial class boilerplate and non-zero function boilerplate, the Clojure you quoted doesn't even show any function boilerplate (defn foo [args] body) I compared a C# 3 expression to a Clojure expression. And that bit of Clojure that you quoted uses helper functions which are not defined. The C# version of that is: (from asset in assets let liquidValue = GetLiquidValue(asset) where DoubleMargin(asset, liquidValue) select liquidValue).Sum() Clojure is a great language, but this article unfairly bashes C#, which is also a great language.