r/Clojure • u/erez-r • Jul 31 '21
6 years of professional clojure
I've been working with clojure professionally for the last 6 years and I've written a blog post concluding my thoughts of clojure as a programming language and the challenges of building an engineering team based on clojure as its main tool
would be more than happy to receive feedback and alternate opinions
https://engineering.nanit.com/6-years-of-professional-clojure-2b61cb6c1983
2
u/NoBrainSkull Jul 31 '21
Great post ! Thanks for sharing your experience with us. Do you have any public git repository of a typical closure project ? I'm curious about how you integrate outside world information into your pure functions.
2
u/erez-r Jul 31 '21
Unfortunately there is no public git repo I can share with you, but if you can be more specific with your question I'll gladly share our knowledge
1
u/NoBrainSkull Aug 01 '21
Like if your app receive an http query requesting some computed data you need to fetch from a database. Both query handling and database fetching are impure whereas every other step should be pure, right ?
To pass you http query arguments (a simple dictionary) to the first pure function of your pipeline, do you need to validate what keys and values are in your dictionary? How do you handle malformed queries ?
Do you also need to validate data coming from the database in the same regard?
What about controlling logic ? Since calling an impure function make the caller impure, how much do you manage to keep pure ?
I have the feeling I see the huge advantage of having mostly pure functions in a code base but I miss the practical techniques to achieve it on a daily basis.
Hope that's not to much question :D !
2
u/erez-r Aug 01 '21
we use http://clojurevalidations.info/ for request validation
we don't really validate data coming in from the database - I can't think of a good reason to do so
impurity is a part of the world and you have to handle it somewhere in your code. if your controller needs to read data from an external source there's no way to avoid it. I think that clojure minimizes impurity in the code base by relying on immutable values (so changing state is rare) and leaving it only for the cases that it is unavoidable like reading from a socket or a database.
11
Jul 31 '21
Recruiting and building engineering teams of Clojure engineers is
challenging compared to other programming languages due to the lack of
its popularity and the absence of a large pool of experienced engineers
I often wonder about comments like these, I'm a clojure programmer, quite a long time.. but often times I run into clojure jobs not wanting to pay what I make doing C#, which I'll admit is quite a bit.. but it's not like we aren't out there..
8
u/jacksonbenete Jul 31 '21
What bothers me is the absence of experienced engineers and the absence of companies willing to give non-experienced engineers experience, so they can solve their own demand.
2
3
u/gleenn Jul 31 '21
Excellent article. I do think the hiring problem is an interesting one. I recently started managing a new hire who has been learning Clojure and they seem to love it. I agree with other commenters here that likely a difficulty in hiring is probably industry-wide and somewhat language-agnostic.
15
u/jayceedenton Jul 31 '21
I think one thing to bear in mind is that over the last few years, demand for software engineers has continued to outpace supply. This is affecting most parts of the industry, no matter what the language or technology stack. There's a risk here that everyone using interesting and effective new languages or tools immediately blames these for their difficult hiring. Believe me, Java shops are struggling to find good people to hire too.
Another factor to consider is that sometimes using Clojure, Scala, Haskell, Kotlin, etc marks your team out in a crowded space and sends good signals to the engineers you want to attract. It shows that you've taken some real, demonstrable steps to examine the way you work and choose 'better' tools. When there's a lot of competition to hire, signals like this will really help.
One great thing I've found about Clojure is that it is so accessible, and (IMO) reveals its benefits so quickly. New joiners can learn Clojure quickly, and most who pick it up end up loving it. I've worked in organisations using Scala where a small proportion of engineers really loved the pure, typed FP; but newcomers had a steep learning curve to get past, then around half of those effectively tolerated it from then on, rather than enjoying it.