The truth about Lisp (2006)
When I started using Clojure, the first two weeks were mess. I was trying to fit everything in procedural way of thinking and boy was it a mess. I felt really miserable and maybe that is how it felt when I first started to walk. And then suddenly everything clicked and the world was beautiful.<p>Clojure has a steep learning curve when you start. After about a year and a half there is another much steeper curve and if you cross it, I have heard it feels like you have super powers. I am probably 4&#x2F;10 on Clojure and 9.5&#x2F;10 on Java. However I take around 10% of time to get better results with Clojure vs Java.<p>I can try taking a shot at listing why I love Clojure however for me it is as difficult as explaining why I love someone:<p>1. Computers are functional. You give them a massive subroutine and they execute it. All procedural languages have built semantics to make it supposedly easy for humans to write code but end up with a lot of hacks. Only you start writing functional you feel finally connected to the computer.<p>2. Immutable structures: With most languages it&#x27;s difficult to have assumptions about how your code will work. You pass your data to a function, can they change the data due to a bug or bad design. Do you create a copy before sending it to them? All those issues go away. It&#x27;s better to understand expectations and stupid errors go out of the way.<p>3. Reusable code: because it&#x27;s functional and without side effects it&#x27;s much more easier to create reusable code as a part of standard library. You have functions like butLast (give me all elements of an array except last), even?, rest (return all elements of array except first). Imagine how much less boiler plate would it be. Check out some of the functions here: <a href="http:&#x2F;&#x2F;clojure.org&#x2F;api&#x2F;cheatsheet" rel="nofollow">http:&#x2F;&#x2F;clojure.org&#x2F;api&#x2F;cheatsheet</a><p>4. Encourages you to write smaller chunks of functions, not 2000 line long functions. Improves code reusability and testing.<p>5. Doesn&#x27;t allow bad design practices - circular dependency.<p>6. Because the language is built on a very few core constructs, you or anyone else can enhance the language. I have seen situations where someone had a proposal to extend the language, they just releases it as a library. If people like it and use it, it would get included as a part of core framework.<p>7. The quality of available talent - Because there is a steep learning curve almost everyone Clojure programmer that you meet is likely to be very smart.<p>8. Has inbuilt support for magical stuff like macros, STM. You can Google it to find out more.<p>9. Imagine all the java libraries that were very complicated to use and with their confusing java docs. Clojure community has built a lot of super easy to use wrappers on top of it and you could easily write one too.<p>10. In other languages if I see a library on github which hasn&#x27;t been updated for years, it feels like it has been abandoned and I would not consider using it. With Clojure, because of functional and no side effects - a code which works now is likely to keep on working with it&#x27;s current contract. It is not uncommon to see libraries which were built by some of the rockstars in the community within a day and not updated for years but still they work great.<p>11. Because of being functional and no side effects, code hot replace actually works. Many other languages have attempted it, but it always comes with a bit of caveats. With Clojure it just works. My developer code flow was that I would use an IDE and which I am writing code, it would hot replace the code in VM, find the tests which depends on the changed code and run just them. So I can see the code I am breaking while I am writing code. This is unbelievable. When we had an issue, I used this to connect to a REPL (a commandline for VM) - hot swapped a code to add logging, figured out the issue, fixed the code locally, copied the function to replace the code on running server, fixed the code and pushed it again (I wouldn&#x27;t recommend people do this, but explains the power at your fingertips).<p>This list could go on and on. In my current job, I am building a big team where any set of people could come together and build a startup. Like Google&#x27;s Area 120, but started more than an year before that. Unfortunately I am not encouraging people to use Clojure here, because it would set them back by months. I really love my current job, however I keep getting impulses of quitting everything and just code Clojure full time.<p>I hope people can see that I am smitten. Give it a try and I promise you wouldn&#x27;t regret.<p>edited: for readability