<story><title>Metabase: Why we picked Clojure</title><url>https://medium.com/@metabase/why-we-picked-clojure-448bf759dc83#.w1uqkz6sp</url></story><parent_chain><item><author>yeukhon</author><text>You are referring to higher-order function I assume. I don&amp;#x27;t think that is a property of FPL.&lt;p&gt;I am definitely not dismissing FPL, I am just arguging about the actual examples given were not strong enough to dismiss Java being hard to read.</text></item><item><author>ane</author><text>Your Python example &lt;i&gt;is&lt;/i&gt; functional programming! You&amp;#x27;re doing exactly the same thing as in Clojure, just not in a Lisp syntax.&lt;p&gt;Therefore, in your question, you could substitute Clojure with functional programming, and the examples in which FP allows you to express thoughts you wouldn&amp;#x27;t know how to express in for, while and so on -- are plentiful.&lt;p&gt;I may not be answering your question, but there&amp;#x27;s a reason for that: the functional programming aspect isn&amp;#x27;t Clojure&amp;#x27;s main selling point. It&amp;#x27;s the &lt;i&gt;other&lt;/i&gt; ideas. Software transactional memory, immutability, its emphasis on state and identity, the protocol system, transients, concurrency, transducers, the list goes on.</text></item><item><author>yeukhon</author><text>But what is even?&lt;p&gt;I am sure functional programming has its natural appealing in areas like recursion, but this example doesn&amp;#x27;t seem too convincing for winning readability, I can always write this in python&lt;p&gt;filter(even, range(0, 101)))&lt;p&gt;where even is a function I wrote.&lt;p&gt;Please give an example for &amp;quot;Clojure allows me to express thoughts that I wouldn&amp;#x27;t know how to express in for, while, if, variables and objects.&amp;quot; if you can.</text></item><item><author>j-pb</author><text>Clojure allows me to express thoughts that I wouldn&amp;#x27;t know how to express in for, while, if, variables and objects.&lt;p&gt;And on readability, what do you prefer?&lt;p&gt;&lt;pre&gt;&lt;code&gt;  List&amp;lt;Integer&amp;gt; even = new List()
  for(int i = 0; i &amp;lt; 100; i++){
    if((i%2)==0){
      even.add(i);
    }
  }
  return even;
&lt;/code&gt;&lt;/pre&gt;
vs.&lt;p&gt;&lt;pre&gt;&lt;code&gt;  (filter even? (range 0 100))&lt;/code&gt;&lt;/pre&gt;</text></item><item><author>kisstheblade</author><text>&amp;quot; However, we had a strong aversion to using Java itself, so the real short list was Scala or Clojure.&amp;quot;&lt;p&gt;Sadly they couldn&amp;#x27;t articulate any actual problems with Java...&lt;p&gt;I find it weird that so many developers focus on the &amp;quot;writability&amp;quot; of the language. I mean  stuff that java gets criticized for, like verbosity etc. Which I don&amp;#x27;t even find so bad especially since the newer jdk versions.&lt;p&gt;But in my opinion the _readability_ of the result is the most important factor. I rather read copy&amp;#x2F;pasted code than some smart clojure onliner which nobody dares to touch or really understands.&lt;p&gt;You only write the program once, but you have to read it over and over again when maintaining it and developing new features, and java&amp;#x27;s maybe a little verbose syntax really helps here, and also the fact that there really is only one way to do a thing (unlike eg. perl).&lt;p&gt;The tooling, documentation, frameworks, libraries and runtimes are all top notch with java. All other languages seem to have problems in one (or more) of these areas.</text></item></parent_chain><comment><author>yogthos</author><text>The big difference is that Clojure defaults to immutable data structures. While you can chain functions together in Java and Python, you still have to manually keep track of all the references.&lt;p&gt;The main benefit of modern functional languages is in their use of revisioned data structures. This has same benefits as garbage collection.&lt;p&gt;Without GC you have to manually track where you allocate and deallocate things, and this is highly error prone. With GC the runtime does this for you, and you can focus on other things.&lt;p&gt;Same thing applies with mutable and immutable data. With mutable data structures all the changes are done in place, and you have to keep track of everywhere it&amp;#x27;s used to update it predictably. With immutable data structures you&amp;#x27;re &amp;quot;copying&amp;quot; the data any time you make a change, and the runtime keeps track of the references for you.</text></comment>
<story><title>Metabase: Why we picked Clojure</title><url>https://medium.com/@metabase/why-we-picked-clojure-448bf759dc83#.w1uqkz6sp</url></story><parent_chain><item><author>yeukhon</author><text>You are referring to higher-order function I assume. I don&amp;#x27;t think that is a property of FPL.&lt;p&gt;I am definitely not dismissing FPL, I am just arguging about the actual examples given were not strong enough to dismiss Java being hard to read.</text></item><item><author>ane</author><text>Your Python example &lt;i&gt;is&lt;/i&gt; functional programming! You&amp;#x27;re doing exactly the same thing as in Clojure, just not in a Lisp syntax.&lt;p&gt;Therefore, in your question, you could substitute Clojure with functional programming, and the examples in which FP allows you to express thoughts you wouldn&amp;#x27;t know how to express in for, while and so on -- are plentiful.&lt;p&gt;I may not be answering your question, but there&amp;#x27;s a reason for that: the functional programming aspect isn&amp;#x27;t Clojure&amp;#x27;s main selling point. It&amp;#x27;s the &lt;i&gt;other&lt;/i&gt; ideas. Software transactional memory, immutability, its emphasis on state and identity, the protocol system, transients, concurrency, transducers, the list goes on.</text></item><item><author>yeukhon</author><text>But what is even?&lt;p&gt;I am sure functional programming has its natural appealing in areas like recursion, but this example doesn&amp;#x27;t seem too convincing for winning readability, I can always write this in python&lt;p&gt;filter(even, range(0, 101)))&lt;p&gt;where even is a function I wrote.&lt;p&gt;Please give an example for &amp;quot;Clojure allows me to express thoughts that I wouldn&amp;#x27;t know how to express in for, while, if, variables and objects.&amp;quot; if you can.</text></item><item><author>j-pb</author><text>Clojure allows me to express thoughts that I wouldn&amp;#x27;t know how to express in for, while, if, variables and objects.&lt;p&gt;And on readability, what do you prefer?&lt;p&gt;&lt;pre&gt;&lt;code&gt;  List&amp;lt;Integer&amp;gt; even = new List()
  for(int i = 0; i &amp;lt; 100; i++){
    if((i%2)==0){
      even.add(i);
    }
  }
  return even;
&lt;/code&gt;&lt;/pre&gt;
vs.&lt;p&gt;&lt;pre&gt;&lt;code&gt;  (filter even? (range 0 100))&lt;/code&gt;&lt;/pre&gt;</text></item><item><author>kisstheblade</author><text>&amp;quot; However, we had a strong aversion to using Java itself, so the real short list was Scala or Clojure.&amp;quot;&lt;p&gt;Sadly they couldn&amp;#x27;t articulate any actual problems with Java...&lt;p&gt;I find it weird that so many developers focus on the &amp;quot;writability&amp;quot; of the language. I mean  stuff that java gets criticized for, like verbosity etc. Which I don&amp;#x27;t even find so bad especially since the newer jdk versions.&lt;p&gt;But in my opinion the _readability_ of the result is the most important factor. I rather read copy&amp;#x2F;pasted code than some smart clojure onliner which nobody dares to touch or really understands.&lt;p&gt;You only write the program once, but you have to read it over and over again when maintaining it and developing new features, and java&amp;#x27;s maybe a little verbose syntax really helps here, and also the fact that there really is only one way to do a thing (unlike eg. perl).&lt;p&gt;The tooling, documentation, frameworks, libraries and runtimes are all top notch with java. All other languages seem to have problems in one (or more) of these areas.</text></item></parent_chain><comment><author>j-pb</author><text>Higher order functions are _the_ defining property of FPL.
Even though a lot of FPL people might want you to believe it&amp;#x27;s types.&lt;p&gt;Lambda calculus (the theoretical foundation for all functional languages) was initially untyped.</text></comment>