<story><title>The Future of Clojure</title><url>https://www.thoughtworks.com/podcasts/future-clojure</url></story><parent_chain><item><author>bIAW7hAhDO</author><text>Honest question: Why is clojure so much better than the rest?</text></item><item><author>jakebasile</author><text>I&amp;#x27;ve said it before, and I&amp;#x27;ll say it again. I will continue to write Clojure for a living as long as I am able to find a job willing to pay me to do so. I have never encountered a more pleasant environment to do my work. I think Clojure isn&amp;#x27;t going to &amp;quot;go away&amp;quot; any time soon as long as there are other people like me still around.&lt;p&gt;I do think that Clojure shops (like all software shops) need to dial back the torture interviews &amp;#x2F; homework &amp;#x2F; tests, but that&amp;#x27;s really a bigger thing that just Clojure. I think more could be done to market Clojure to the non-believers, but I don&amp;#x27;t have specific ideas on how that could be done.&lt;p&gt;You can take my parentheses from my cold, unemployed hands.</text></item></parent_chain><comment><author>sankyo</author><text>Everything is a function, functions are first class.&lt;p&gt;REPL based development gives you instant feedback. lets you write a function in your editor and then run it, change it, run it again. If your idea of REPL is python or ruby, then you are not getting the entire picture. &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;questions&amp;#x2F;5671214&amp;#x2F;is-lisp-the-only-language-with-repl&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;questions&amp;#x2F;5671214&amp;#x2F;is-lisp-the-only...&lt;/a&gt;&lt;p&gt;Immutable by default. This helps with debugging and solves thread safety. Feel free to pass around references without worry.&lt;p&gt;Java interop - you can use all the jars&lt;p&gt;&amp;quot;isomorphic&amp;quot; - write clojurescript for the browser, Clojure for the server</text></comment>
<story><title>The Future of Clojure</title><url>https://www.thoughtworks.com/podcasts/future-clojure</url></story><parent_chain><item><author>bIAW7hAhDO</author><text>Honest question: Why is clojure so much better than the rest?</text></item><item><author>jakebasile</author><text>I&amp;#x27;ve said it before, and I&amp;#x27;ll say it again. I will continue to write Clojure for a living as long as I am able to find a job willing to pay me to do so. I have never encountered a more pleasant environment to do my work. I think Clojure isn&amp;#x27;t going to &amp;quot;go away&amp;quot; any time soon as long as there are other people like me still around.&lt;p&gt;I do think that Clojure shops (like all software shops) need to dial back the torture interviews &amp;#x2F; homework &amp;#x2F; tests, but that&amp;#x27;s really a bigger thing that just Clojure. I think more could be done to market Clojure to the non-believers, but I don&amp;#x27;t have specific ideas on how that could be done.&lt;p&gt;You can take my parentheses from my cold, unemployed hands.</text></item></parent_chain><comment><author>mbil</author><text>Compared to other languages, I&amp;#x27;ve found Clojure makes it much easier to iteratively turn an idea into code.&lt;p&gt;Say you&amp;#x27;re writing a pure function...&lt;p&gt;You start with just data and a sense of how the output might look. Let&amp;#x27;s say I have APIs providing me with a user record and a list of transactions, and I want to get that person&amp;#x27;s balance...&lt;p&gt;Maybe you start with some canned data&lt;p&gt;&lt;pre&gt;&lt;code&gt;        (let [person {:name            &amp;quot;Matt&amp;quot;
                      :id              12345
                      :current_balance 100.10}
              txns   [{:person_id 12345 :amt 10}
                      {:person_id 44444 :amt 0.5}
                      {:person_id 55555 :amt 10}
                      {:person_id 12345 :amt 11}
                      {:person_id 12345 :amt -5}
                      {:person_id 66666 :amt 3}]]
          (-&amp;gt;&amp;gt; txns
              count)
          )
        =&amp;gt; 6
&lt;/code&gt;&lt;/pre&gt;
and maybe you want to filter the transactions to just that user&lt;p&gt;&lt;pre&gt;&lt;code&gt;        (let [person {:name            &amp;quot;Matt&amp;quot;
                      :id              12345
                      :current_balance 100.10}
              txns   [{:person_id 12345 :amt 10}
                      {:person_id 44444 :amt 0.5}
                      {:person_id 55555 :amt 10}
                      {:person_id 12345 :amt 11}
                      {:person_id 12345 :amt -5}
                      {:person_id 66666 :amt 3}]]

          (-&amp;gt;&amp;gt; txns
              (filter #(= (:id person)
                          (:person_id %)))
              count)
          )
        =&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt;
then you want to extract the amount for each of those&lt;p&gt;&lt;pre&gt;&lt;code&gt;        (let [person {:name            &amp;quot;Matt&amp;quot;
                      :id              12345
                      :current_balance 100.10}
              txns   [{:person_id 12345 :amt 10}
                      {:person_id 44444 :amt 0.5}
                      {:person_id 55555 :amt 10}
                      {:person_id 12345 :amt 11}
                      {:person_id 12345 :amt -5}
                      {:person_id 66666 :amt 3}]]

          (-&amp;gt;&amp;gt; txns
              (filter #(= (:id person)
                          (:person_id %)))
              (map :amt))
          )
        =&amp;gt; (10 11 -5)
&lt;/code&gt;&lt;/pre&gt;
and sum those amounts&lt;p&gt;&lt;pre&gt;&lt;code&gt;        (let [person {:name            &amp;quot;Matt&amp;quot;
                      :id              12345
                      :current_balance 100.10}
              txns   [{:person_id 12345 :amt 10}
                      {:person_id 44444 :amt 0.5}
                      {:person_id 55555 :amt 10}
                      {:person_id 12345 :amt 11}
                      {:person_id 12345 :amt -5}
                      {:person_id 66666 :amt 3}]]
          (-&amp;gt;&amp;gt; txns
              (filter #(= (:id person)
                          (:person_id %)))
              (map :amt)
              (apply +))
          )
        =&amp;gt; 16
&lt;/code&gt;&lt;/pre&gt;
and add that to the existing balance&lt;p&gt;&lt;pre&gt;&lt;code&gt;        (let [person     {:name            &amp;quot;Matt&amp;quot;
                          :id              12345
                          :current_balance 100.10}
              txns       [{:person_id 12345 :amt 10}
                          {:person_id 44444 :amt 0.5}
                          {:person_id 55555 :amt 10}
                          {:person_id 12345 :amt 11}
                          {:person_id 12345 :amt -5}
                          {:person_id 66666 :amt 3}]
              bal-change (-&amp;gt;&amp;gt; txns
                              (filter #(= (:id person)
                                          (:person_id %)))
                              (map :amt)
                              (apply +))]
          (+ bal-change (:current_balance person))
          )
        =&amp;gt; 116.1
&lt;/code&gt;&lt;/pre&gt;
the function is done!&lt;p&gt;&lt;pre&gt;&lt;code&gt;        (defn update-person-balance [{:keys [id current_balance]} txns]
          (let [bal-change (-&amp;gt;&amp;gt; txns
                                (filter #(= id
                                            (:person_id %)))
                                (map :amt)
                                (apply +))]
            (+ bal-change current_balance)))
&lt;/code&gt;&lt;/pre&gt;
I posted here as a series of snippets, but this would have been a single block of code, refined and evaluated and refined and evaluated, over and over, in a REPL-integrated editor. It feels like sketching a portrait or sculpting clay.&lt;p&gt;&amp;quot;But I can do that in any ol&amp;#x27; REPL!&amp;quot; you might say. Try Clojure -- really try it, with an nREPL connected to your running application and to your editor, capturing inputs, playing them back, writing evaluation output as comments -- and then tell me you want to go back to your old REPL. A notebook environment is similar, though clumsier IMO.&lt;p&gt;Come for the REPL-driven-development, stay for the immutability, the Java library ecosystem, the lisp syntax, the concurrency support, etc. I know going on and on about how great Clojure development is is basically a meme at this point, but that&amp;#x27;s because it&amp;#x27;s really great!</text></comment>