This probably sounds generic and vague, but I'll ask it anyway - You're kind of OK-ish clj/cljs programmer. You've read a couple of books, watched a few talks, you've implemented a few small-to-medium size things. But you don't feel like you're particularly proficient. You don't think your code is idiomatic. And you don't see an obvious path for significant improvement. What would take you further along? What would you do to step up your craft? Any resources specifically for this? Or any ideas? I'm mostly using cljs now, but anything for clj or cljs would be great.
Have you read & understood src/clj/clojure/core.clj in the Clojure repo? Understanding how Clojure was largely written in Clojure was a big step for me. Many good examples of the core Clojure principles are also there. If you are fluent in Java, tracking down the underlying support code can be interesting &, if it's to your taste, even fun! Might sound daunting, but there's no need to grasp everything at once. Just keep nibbling at it. With enough diligence, it'll make more & more sense.
> Many good examples of the core Clojure principles are also there. Plenty of not-so-good ones as well though. Not necessarily something detrimental to programs, but rather something non-idiomatic or at least questionable. Some of the code was written way before some of the current Clojure features became available.
Thanks jdjohnston! Holds true for CLJS too?
To write code in an idiomatic manner, you have to internalize the existing idioms. So either someone else who has already done so should be involved where they can review your code and direct your changes, or you yourself have to find idiomatic code that does something somewhat similar to what you've implemented so that you can compare things carefully and rewrite your own code. Needless to say, the former is much more efficient. But it does require another person.
Thanks p-himik. I agree the former is more efficient, but it's not straightforward how to get another person involved. How would you go about the latter though? How would you search for an idiomatic code that does X, whatever X is at the moment?
> but it's not straightforward how to get another person involved
Oh but it is! I haven't used it myself but I have heard enough good things to recommend it myself: https://clojure.camp/
Apart from that, you can ask people to review your code here and in #code-reviews.
Of course, it would be harder to find a person who would review your whole project, so splitting it into multiple somewhat independent things that you can share separate would help. And it by itself has a good chance of making things better overall.
> How would you search for an idiomatic code that does X, whatever X is at the moment?
There's certainly no idiomatic:yes filter on GitHub. :) So you can't really do that. And arguably, even Clojure itself in many places is written with non-idiomatic code.
Honestly, I would suggest not caring about it that much so that it makes you want to go hunt for idiomatic code. I'd just read someone else's code in projects that are of interest to me, implicitly learn some patterns, and ask others when I stumble across something interesting or something that doesn't sit right with me.
Thanks! I'll check them out. You're right, I might be obsessing too much about it hehe. You probably can't force it anyway.
Work with other Clojure programmers. See meetups, confs, etcβ¦
Have you any public repos looking for help?
Thanks st. I don't have public repos right now. But as you and p-himik said, working with other clojure programmers seems to be the best way
> ... But you don't feel like you're particularly proficient ... Apart from practicing decomposing systems in a functional way there is also the interactivity aspect of Clojure that is worth practicing imo. Do you feel you can work with your projects in an interactive way, or do you find yourself constantly restarting your repl? If the later, I would put some efforts on figuring out how to modify those projects so you can work with them more "the Clojue way".
jpmonettas, I hang around inside the REPL sometimes, I'll have to see how well I am using it.
That's quite important and which takes effort to develop IME, but totally worth it. On one side there is learning the tooling, which very rarely has to do with typing something at the repl, much more about evaluating from your editor. It is also not only about adding/replacing code but also poking at the running system in different ways. Enabling this on bigger systems doesn't comes out of the box, it requires some effort specially around stateful components (like web servers, database connections, sockets, UIs, etc), for which there are various strategies like https://github.com/stuartsierra/component . There is also https://clojure.org/guides/repl/introductionon repl stuff.
Thanks a lot! I had gotten to a point where I interact with XTDB and postgresql via hugsql from within Emacs. I probably have a lot of room for improvement, specially on the cljs side. I will check out the links. Thanks!
One funny thing I did is, I looked for some clojure expert prompts and I compared myself against what the LLM was expected to be, and I found myself lacking hehe. Data oriented programming, SICP, ... A bit intimidating
You are welcome. There is a series of videos on a youtube channel called https://www.youtube.com/@smyr-clj that was all about this. I participated in https://www.youtube.com/watch?v=2nH59edD5Uos if you are interested. There is also https://www.youtube.com/watch?v=gIoadGfm5T8 where Sean Corfield covers a bunch of this stuff.
Awesome jpmonettas! I'll go through all of them.
https://pragprog.com/titles/vmclojeco/clojure-applied/ is also a good resource of using clojure for real applications. It is a bit dated, but still worth a read IMHO.
@alexmiller are there any plans for an update of Clojure Applied?
Thanks Ludger! Looks like it's written by the author of Programming Clojure, which I enjoyed
Ben and I have talked about it, but no active plans. I have been working on a new edition of Programming Clojure which should hopefully emerge later this year.
I was in the same position, poor lonesome Clojure programmer some months ago. Was lucky enough to end up working with other Clojure programmers, and it is amazing. My gut feeling is that Clojure is one of the best weapon for a solo developer, and Clojure popularity will increase when itβll be known that Clojure teams are a working thing.
How did you get to work with clojure programmers, st? In my case, I don't see a way of me getting involved in other projects since I'm completely occupied at the moment. Maybe making some of my own work public might be a good start?
my only advice is either bide your time and, later, find projects to join in on, or to just keep an eye on #jobs and #remote-jobs π
If time allows, you could work on a clojure open source project with other clojure programmers. Involvement could be small for a start, but you will read and write clojure code and talk about designs with more experienced clojure programmers.
Thanks, OSS involvement makes sense
+1 for clojure camp. I used to meet people regularly and it definitely has contributed immensely to my growth as a developer.