r/Clojure • u/lordmyd • Jan 31 '21
Stop selling Clojure as just a learning experience.
After watching a number of videos promoting Clojure recently I was frustrated by the number of proponents who were resigned to the idea that after you've learned it you go back to your job where you use a more mainstream language and that Clojure's main value is as a learning experience. It's as if Clojure has been relegated to the second division, to use a football anaglogy. Maybe we need to catch ourselves when we find ourselves falling back to this and put more emphasis on improving Clojure adoption. Clojure makes compromises to remain practical so let's stop selling it as a "learning experience which will make you a better programmer". Clojure does not improve my Java - it makes me want to ditch it.
10
u/fingertoe11 Jan 31 '21
I think people will be better programmers for learning Clojure.
'Learn Clojure to get a job' isn't a selling point yet.. The job market for Clojure seems to be on the upswing, but you still have to hunt for jobs.. Unless you live in one of dozen or so places, it's hard to find non-remote jobs.. But the more people that know and love Clojure, the faster that sales pitch will become a realistic option..
It is incredibly practical for solving problems -- It ought to be sold as a first class option for greenfield development, prototyping, etc.. But unless you have already learned it that is a not easy pitch either..
2
u/lordmyd Jan 31 '21
They will be better Clojure/functional programmers but I don't buy the idea that this has any kind of crossover when they inevitably have to return to the world of mainstream OOP. If anything, they'll probably just end-up hating their job more.
4
u/fingertoe11 Jan 31 '21
I disagree... Many languages are racing to support functional programming paradigms.. Certainly in the JavaScript world, you are seeing a lot more functional patterns emerge. You can use immutability and pure functions in most languages.
But yes, bad legacy code will become much more annoying..
1
u/bubuli_breeder Jan 31 '21
“they’ll probably just end up hating their job more.” is this comment for real? if you end up hating your job “more” because of its choice of programming language, there’s a bit of self-reflection (pun lol) that you need to do.
2
u/lordmyd Jan 31 '21
Not really. There are plenty of <mainstream language> developers who churn-out OOP because they have to in order to make a living. Many of them hate the ceremony that OOP imposes on them and learning Clojure could easily exacerbate that given that they probably won't be able to use Clojure to earn a living.
1
u/bubuli_breeder Jan 31 '21
i don't quite understand how one can be hamstrung for not using a particular preferred programming language. Java has survived this long not just because it's "safe" and "widely-adopted" otherwise COBOL would still be one of the dominant languages today (yes, I am THAT old)...it has survived and proliferated because it's a solid programming language and evolves with the times despite its faults. I like Clojure and I enjoy writing apps in Clojure but I also like Java and I would never paint Java (or any OOP language) in such a negative light.
3
u/retief1 Jan 31 '21
IMO, fp principles can actually apply just fine to oo languages. For one thing, plenty of "oo" languages support fp just fine -- see python/js/... . The lack of persistent data structures hurts some stuff, but you can still do a lot of things pretty easily. And even if you are in something like java, the basic principles of "purely functional functions and immutable objects" still has value. A factory method that returns an immutable object is still reasonably oo-esque, but it also avoids most/all state issues.
3
u/bubuli_breeder Jan 31 '21
this kind of posts irks me a little. it really makes Clojure aficionados come across as elitists. it’s a form of gatekeeping.
4
u/lordmyd Jan 31 '21
I'm not suggesting Clojure aficionados are elitist. More that in the community we often fall back to this "learning experience" position apologetically because Clojure adoption is so low.
1
u/bubuli_breeder Jan 31 '21
there are some other reasons why adoption is low in Clojure and syntax just happens to be one of them. for me, though...adoption is not as fast as i would like but syntax is the least of my concern; the main reason is that interoperability with Clojure from an existing Java app is a bitch...and you got to hand it Kotlin...they did that part right from the get go so adoption is pretty quick.
3
u/lordmyd Jan 31 '21
Yes, full marks to Kotlin's adoption strategy. With Arrow it's a fairly full-featured FP language. Support from Google and Jetbrains didn't hurt either.
5
u/gingenhagen Feb 01 '21
Clojure does not improve my Java - it makes me want to ditch it.
I think this is a pretty limiting view and would argue pretty heavily against it. I tend to believe that every language that you learn teaches you something, some skill, some viewpoint, that you want to be able to carry into any job or codebase, to help you solve your problems better.
Clojure improving your java is what lets you market clojure to your team. People are like, oh how is your code so much better than everyone else's, where'd you get such better ideas for how to approach this problem. And when the answer enough times is clojure, then maybe they'll listen when you make an argument about how this newest service you need to write can uniquely benefit from clojure in a way that can justify changing to a ployglot codebase.
3
u/Kah0ona Feb 01 '21 edited Feb 01 '21
I really concur with the sentiment in this post. For me: I just flee that situation.
I always wanted to have the full say about what tools I want to work with.
One of the reasons why I've never wanted a 'job', unless it coincides with my preference of tools. I took a freelance job at a big corp once, for the sole reason they used clojure.
Other than that, Until recently I was a freelancer. Or rather, independent/self-employed, meaning I just behaved more like a one-man software development agency, where clients hire 'us' to develop, say, a tool or a web-app, and who are not necessarily in the Software business themselves.
Then often times they don't even ask what language it 's written in, or just trust you. And then,.. if you deliver on time and budget with good quality (and you can, because... clojure ;-)),... no one bats an eyelid, NOR SHOULD THEY!
And now I'm founded a SaaS startup, running it full time (bootstrapped, but growing).
So I hope that in the future it will grow and I can add another 'drop to the ocean', ie. create clojure jobs. But for me it doesn't really matter, as my work + happiness from my work is effectively self-directed towards how I'd like it :-) Having said that, i'd love it to be able to say 'i've got a clojure job, any takers?', one day!
0
Jan 31 '21
[deleted]
9
u/lordmyd Jan 31 '21
If management are not adopting Clojure how will you ever be in a position to use it? I'm not saying there aren't any Clojure companies but they're a drop in the ocean.
6
u/frogking Jan 31 '21
I have to learn the language on my own terms first, then I can uggest it to management.
.. or find a job where clojure is a requirement. I learned clojure at 1.1, many years ago. I’ve never used it professionally, but that’s my own fault. I went in a different direction with my career. I’ve been offered several jobs over the years, where clojure is the key component. But I never wanted to move.
5
Jan 31 '21
[removed] — view removed comment
-1
u/lordmyd Jan 31 '21
Writing Clojure for yourself kind of emphasises my original point and, to be fair, anyone can adopt a map/reduce approach without ever having set eyes on Clojure.
0
Jan 31 '21
[deleted]
5
u/lordmyd Jan 31 '21
How will Clojure's liberating expressiveness help you solve problems in Java where you have to wear an OOP straightjacket, where code is not data and where the nearest thing to a lambda is a Single Abstract Method? Clojure is the very opposite of most mainstream languages, so much so that Rich Hickey once spoke at Ruby Conf where he basically told everyone "You're doing it wrong".
10
u/bubuli_breeder Jan 31 '21
to characterize Java as language “where you have to wear an OOP straightjacket” is a bit disingenuous and it means you don’t really see how Java has evolved into more than an OOP language since Java 8.
to me learning Clojure made me a better Java developer.
1
u/lordmyd Jan 31 '21
Everything still has to be defined within a class or interface in Java. That's quite a straightjacket. When Java gets real, top level functions (not SAMs) and you no longer have to escape regex metacharacters we can talk about progress.
6
u/bubuli_breeder Jan 31 '21
calling it a straightjacket is a bit melodramatic no? that’s the nature of the language. yeah it’s verbose, but the intent to become functional and immutable is already there.
1
u/klikklakvege Feb 01 '21
You still need a pile of boilerplate for whatever you want to do. In clojure you can do anything in exactly one function call
1
u/dpb1857 Feb 04 '21
You might enjoy this classic if you haven't seen it: Execution in the Kingdom of Nouns http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html
1
2
u/againstmethod Feb 01 '21
If you can’t see an algorithmic technique in one language and emulate or implement it in another, that prob speaks to your limitations, not those of the tools you use.
I find this argument to be nonsense.
2
u/pavelklavik Feb 01 '21
You can emulate things, it just won't be idiomatic in the other language and it will be annoying to write. For instance, I love high order transformations in Clojure. But when I was coding C++, it was just easier and more readable to write a for cycle. So learning Clojure makes you hate writing in other languages because everything just feels like: "Why am I losing my time here?"
1
u/againstmethod Feb 01 '21
How did you lose time?
It’s not any meaningful amount of additional code to use a for over a range in cpp.
And with the ranges syntax added in cpp20 the cpp will actually be simpler, especially for composed transformations and filtrations.
1
u/pavelklavik Feb 01 '21
By losing time, I mean that I was seeing everywhere that I could solve all the problems much easier if I could use Clojure instead of C++. The same thing was mentioned by Rich in one of his talks.
In general, once you get used to a better tool, it is really hard to work without it. For instance, I got so used to hot code reloading in Figwheel/Shadow-cljs for Reagent apps, that I had to develop my own library Volcano for hot code reloading of static web. When I was coding C++ 20 years ago, I had no problem to restart the app after each code change and manipulate it back into the state I needed. And Clojure makes a lot of things way better (transparent data over objects, REPL driven development, ...).
Haven't used cpp20 since I was forced to use cpp11 (as the entire Google). I looked at Lambdas there with all the types, etc., and they seemed like a lot of extra work which would make the code less readable. Totally uncomparable to ease of
(->> (range 10) (map inc) (filter odd?) (reduce +))The key problem with other languages is that one has to put too much focus on unimportant stuff like types, passing references vs. consts, building objects, ... I don't want to lose my time with these things, I want to put as much focus on the problems I am trying to solve. The feeling is that in Clojure, I am solving my problems 90% of time, with the rest being spent on the browser, JS libraries, etc. In C++, I only could spend 10% of my time solving the real problems. That's almost 10x advantage.
1
u/againstmethod Feb 01 '21
Well, if you bother to look at the ranges stuff you will see it's in point-free style. With the proper definitions and using directives i could write that snippet in as clean, or cleaner, a fashion.
And i love types. They help me find bugs before i run into them in production and provides a concrete indication to other developers what my intentions were. And the ability to control memory allows me to write code that will be much more efficient than can be expressed cleanly in clojure. I'd be willing to bet in math-heavy apps i can probably get 2x over you easily if i deny you the ability to drop down to native libs.
And if you were spending 90% of your time worrying about types instead of algorithms, then you are writing trivial programs. Or you simply didn't take the time to learn how to use your tools. I write c++ code all day, and my time is dominated by design/algorithmic details.
1
u/pavelklavik Feb 02 '21
Well, maybe I don't know enough C++, or you don't know enough Clojure and its advantages. I don't think we will get anywhere in this argument :). Plus I never said that 90% of my time was spent with types, just on problems artifically created by C++ language and libraries written for it, mostly by Google. In Google, you mostly use protobufs for types anyway which are decent (especially if I could use them as Clojure maps).
I don't want to solve type problems and don't want to spend my time with any language. I want to solve business problems which help my customers. And with Clojure, I can do it at least 10x faster than with anything else I ever tried. If you enjoy types and writing C++, why are you here discussing Clojure?
1
u/againstmethod Feb 02 '21
I didn't realize i had to drink the koolaid to participate.
1
u/pavelklavik Feb 02 '21
Of course you didn't, don't understand this as I am telling you you should not discuss here. I am just curious why.
→ More replies (0)1
u/backtickbot Feb 01 '21
1
u/halgari Feb 02 '21
Java is probably the most extreme example here though, almost every other language will allow you to apply clojure-seque programming methods. C# for example, now has immutable records, pervasive async, first class functions, and runtime code generation. Python can do much of the same. Java kind of stands alone as the pure OOP language, and that’s why languages like Kotlin are gaining traction.
1
u/radioactiveoctopi Feb 23 '21
For me it helped with my ability to cut problems down into chunks opposed to long imperative thoughts.
0
Feb 01 '21
[deleted]
2
u/robopiglet Feb 07 '21 edited Feb 07 '21
Totally agree. Immutability is a hard slogan, along with the idea of 'decomplection'. The truth is that those problems, so exciting to Clojurists, are far down the list of concerns for companies. For most companies, getting affordable devs and simply getting code deployed, complected or with mutable elements or not, is the problem. Clojure has, a bit, over emphasized certain problems and so the solutions are not really selling points.
1
u/radioactiveoctopi Feb 23 '21
I’m beginning to understand why long term Common Lisp developers have a ‘so what’ attitude now. The dev world is becoming gimmicky. I’m imaging med students grinning over what specialized tools they have in their medical bag. People with get rich quick mindsets and no respect for the actual craft are in charge.
6
Jan 31 '21
[removed] — view removed comment
2
u/robopiglet Feb 07 '21
I don't think the community is hostile to newcomers. The Slack channel is a great place for folks to get help. I do agree, however, that there is a real shortage of jobs for junior devs.
1
u/servingwater Feb 01 '21
So sorry to hear that, that is exactly the thing I worry about. On the other hand I have also read many anecdotes that shops would hire devs and even be willing to give new Clojure devs a chance if they have prior XP in dev work.
5
Jan 31 '21
[removed] — view removed comment
4
u/met0xff Feb 01 '21
In some sense it's probably both. On one hand it seems everyone wants a "full-stack" dev now - not only web dev but also, say, a data scientist who can do everything from math to spark to writing Cuda kernels and putting dashboards online. On the other hand that full stack should be exactly their stack :). But many developers do the same by identifying and marketing themselves as Java developer or whatever. I still avoid this as much as possible. I don't want my professional identity tied to some specific technology.
3
Jan 31 '21
[removed] — view removed comment
2
u/jayceedenton Jan 31 '21
A lot of good points that I agree with, however I wanted to comment on this last one:
Stop worrying about the adoption of Clojure. It doesn't matter how many people use Clojure as long as it makes them happy. Just try to be kind, respectful, humble, and honest. Because most of us are.
I'd love to stop worrying about adoption, but when you find yourself looking for a job in a city and there is just one Clojure role (if you're lucky), it's serious. Trends like https://trends.google.com/trends/explore?date=today%205-y&q=clojure are also serious. This means that by encouraging a team to adopt Clojure, you're placing them in a precarious position where they may find it difficult to secure their next role and find that their years of Clojure experience don't count for much in the market. Yes, what Clojure teaches you will make you a better programmer, but often the market wants experience in an ecosystem too. There isn't a big enough market that wants programmers with experience in the Clojure ecosystem, and it's a crying shame.
As a fan of Clojure, I'd love to know that when I need to get a new job I don't have to work fully remotely just to continue to working with the language.
I know I'm painting a bit of a bleak picture, but adoption is important. It means activity, life, vibrance in the community, innovation and also security. At this point, I'd really love to see Nubank apply some good old-fashioned marketing dollars to the problem. More Clojure conferences, Clojure swag, Clojure news, Clojure partnerships. All that jazz.
2
u/SimonGray Feb 01 '21 edited Feb 01 '21
It's a good thing we have those meaningful graphs from Google Trends that allow us to confirm that Javascript is dying too. Clearly the future of programming is Brainfuck. 😉
I agree that adoption is important, but Google Trends is not a reliable indicator of popularity.
1
u/pavelklavik Feb 01 '21
This is a quite good indicator of Clojure popularity: https://subredditstats.com/r/clojure.
1
12
u/noworriesillfixit Jan 31 '21
"Makes me want to ditch it". Chances are, unless you are in charge, that you will not ditch it at work (even if you are in charge, businesses have customers, risks, obligations...., they don't just abandon one thing for another "ooooh, new shiny" thing. So, why don't you go and ditch it (at work) and tell us how that went. You know, lead by example. Cheers.