r/Clojure • • Oct 11 '19

Love Letter To Clojure

https://itrevolution.com/love-letter-to-clojure-part-1/
103 Upvotes

25 comments sorted by

21

u/yogthos Oct 11 '19

very important point:

There’s something very different about the way I code now, and I attribute it to Clojure and what it’s taught me. I will make the maybe astonishing claim that 90% of the errors I used to make have simply disappeared—as in, an entire category of errors I used to make have been eliminated.

10

u/agumonkey Oct 11 '19

like a disturbance in the force macro

16

u/lambda_pie Oct 11 '19

For nearly three years, I’ve been gushing to whoever would listen about how great Clojure is.

Haha, same here. Three years. I can even remember how I hated Clojure the first time I tried it. Now I love Clojure and hate all other languages.

8

u/mart187 Oct 11 '19

This is an interesting piece for self reflection. When I think about how I/we write Scala I always have the feeling that it isn't right. Two languages gave me the it feels right feeling so far: Elm and Clojure. I have the feeling that Elixir might be similar as well... If only the job marked was better for those.

7

u/Eno6ohng Oct 11 '19

Awesome essay, thanks for sharing!

6

u/scooter_de Oct 11 '19

Interesting. I'm a bit older than the author. I can relate to many of his points.

3

u/met0xff Oct 12 '19

Makes me shift my decision between Clojure and Rust a bit more to the Clojure side again :), although I would suspect there will be many more career opportunities for Rust in future as really many companies are taking it up internally.

The statements about Python: Looping over indices in Python is something you rarely do, you'd probably do "in", use slices, list comprehensions or use all the numpy or pandas features to transform data. Can't remember the last off-by-one error I had. Similarly, explorative programming with ipython/jupyter/spyder or the PyCharm data science mode takes you a long way running stuff, inspecting matrices, changing them, continuing etc.

2

u/Sunscratch Oct 12 '19

I don’t understand how you can choose between 2 absolutely different languages. Rust is non GC statically typed systems programming language. Clojure runs on JVM, and has dynamic typing. I understand when Clojure I compared to other JVM langs like Groovy, Kotlin, Scala - they can be used with same env for almost same kind of things. Or you’re looking for a hobby language?

3

u/met0xff Oct 12 '19 edited Oct 12 '19

Yeah for hobby and potential future investment. I currently have a combination of Python and C++ as main languages. In general I'd rather aim to replace C++ with Rust instead of Python with, say, Julia or a JVM language. But in reality I can't really introduce yet another language for my professional work anyway, so I guess it would stay a hobby... I've played a bit with both but saw I'd have to invest more time to really get them.

I had the easiest time with Elixir but that doesn't fit at all in my skillset (mathy stuff, Audio, deep learning and also lower level C and C++ code).

In fact I don't see a large fit for Clojure either ;), except perhaps for data transformation or accessing Spark etc.

Everything I use at the moment is either a python framework, a C or C++ library or CUDA. With actual C++ usage time becoming less and less (as you can gradually implement most stuff in for example tensorflow or torchscript and then export the graph for the C++ runtime instead of writing everything by yourself)

1

u/pinkyabuse Oct 12 '19

Some similarities:

  • Both languages have multiple articles written about how the author is in love with the language.

  • Both languages have decent support for web development.

  • Both languages value immutability.

  • As of June 2019, both languages hover in the same area of the Red Monk programming languages rankings .

2

u/Sunscratch Oct 12 '19

Yes, but if we are talking about language as the the tool for “get the job done” I would never choose between those two. For me it would be the choice between jvm based langs (or C#, or Elixir) for high level business logic, and for example, Rust/C++ for some high performance stuff. And picking language for hobby, I would go with something completely different with what I use at work, Clojure and Rust feet’s good here, both have very interesting concepts.

3

u/met0xff Oct 12 '19 edited Oct 12 '19

Me neither, as mentioned above I use C++ and Python at work. But it's rather unlikely that I can replace one of them anytime soon. But I would rather bet on Rust becoming a viable alternative to C++ than Clojure to Python. Mostly because my C++ use cases don't need much library support while the python ecosystem got a lot of mature libraries for machine learning related stuff.

Well, and probably also because there are many more pain points with C++ (even after 2 decades of C++ I still don't feel really confident with it)

2

u/Eno6ohng Oct 12 '19

I think clojure and rust are somewhat interesting to compare, since they take the opposite routes in most of their design decisions. There're some similarities of course (the main one being both are solid practical well-designed languages for engineers), but in most of the stuff they are polar opposites... and opposites do tend to complement each other well ;)

3

u/met0xff Oct 12 '19

Yes I suspect both together would be an interesting alternative to my current Python + C++ combination. Theoretically at least ;).

1

u/bpringe Oct 12 '19

I think this aha moment prepared me for the discovery of Rich Hickey and Clojure…

I had the same experience. I learned React before learning Clojure, and the aha moments from React helped me to more quickly pick up on the tenets of Clojure.

1

u/kinleyd Oct 13 '19

Great write up - title says it all for me as I've loved Clojure for a long time now!

1

u/__eastwood Oct 17 '19

overflow: scroll on the code blocks would make things a lot easier to read (chrome osx)

13

u/[deleted] Oct 11 '19

[removed] — view removed comment

9

u/SimonGray Oct 11 '19

Same. Feels like he's almost describing the exact journey I had.

6

u/agumonkey Oct 11 '19

de-complecting

this is probably the only term I never liked

I envy anybody never having to learn java and enjoying clojure right away

3

u/SimonGray Oct 11 '19

I like complect, even if it's a bit clunky to use.

To me it's just a fancier word for spaghetti code, but it's more flexible. You can use it as a verb like "this is complecting that" to describe some entangled process that is making other things harder to understand and which could possibly lead to problems down the chain of data transformations.

1

u/agumonkey Oct 11 '19

I understand but of all the things Hickey coined this one never stuck on my wall.

Anyway, to all clojurists :)

2

u/JavaSuck Oct 12 '19

this is probably the only term I never liked

...How about "simplecting" then? :)

2

u/agumonkey Oct 12 '19

not simple enough :p

3

u/the2bears Oct 11 '19

Same here. A very similar experience from my own. Years of toiling in Java, then discovering Clojure and learning that I still loved programming and software.