by Capricorn2481 · 3y ago · 0 comments
- The debugger sucks
- There are other tools for debugging like Portal and Flowstorm, but they involve already knowing what the problem was so you can instrument the function and call it with the same arguments
- Java stack traces make the above very hard to do.
- You're a second class citizen if you don't use emacs. Half of Clojure devs are using the EMACS according to a community survey. Calva, the VSCode extension, does lots of automatic setup to make the REPL work, and when it doesn't work, you have no way to fix it. I have to restart the REPL a lot, which I'm told is the opposite experience I should be having. It took me days to set up a project just so my REPL would switch from Clojure to Clojurescript when I evaluate in different files, and everybody I asked about this didn't understand why I would need it because they were all using emacs.
- Complaining about Javascript and React and then having your whole ecosystem wrap around Javascript and React is really obnoxious. Reagent is falling behind in React versions and it's missing out on performance enhancements. If you need to do niche React things, it's a pain in the ass.
- This might just be me, but I used Citrus with Rum and I found it to be the most over abstracted thing I've ever seen in my life. I know it was inspired by re-frame, so maybe re-frame is the same. But it's like Redux X10 in terms of verbosity.
- Call me crazy, but the Java interop is worse than other guest languages because there's huge impedance mismatch between functional and OOP.
- There are very popular broken libraries. People say "It's okay if a library hasn't been updated in 6 years, because Clojure is so stable!." This is a total myth, there have been several flat out broken libraries being recommended in tutorials.
- While people are working on frameworks (Biff, Fulcro), there are no "best choices" for a lot of problems yet and it leads to frustration just trying to make a simple crud app.
The community hasn't been unfriendly or unhelpful, but sometimes it feels like I'm speaking to aliens.
Personally am slowly transitioning away from Clojure. The language is great, but the tooling is not. I care a lot more about tooling these days than the language.
> - The debugger sucks
In my experience, Cursive/IntelliJ is the most mature editor setup for Clojure. It includes a step-by-step debugger but I don't really use it. Not because it doesn't work, but because there are other ways of debugging that also work, as explained below.
> - There are other tools for debugging like Portal and Flowstorm, but they involve already knowing what the problem was so you can instrument the function and call it with the same arguments > - Java stack traces make the above very hard to do.
If I don't know where the problem is, I'll look at the Java stack trace and start adding `tap>` calls to see the flow of data. Since Clojure programs are data-oriented, inspecting the state that's flowing through the function arguments is usually all that's needed. It's a bit different process, though. Can you elaborate on your issues with the Java stack traces?
Here's a relevant comment from Alex Miller: https://www.reddit.com/r/Clojure/comments/80al23/how_do_i_do...
> - You're a second class citizen if you don't use emacs. [...]
This doesn't really ring true for me even if a lot of docs are written for emacs. At work people use vim, emacs, VSCode, and IntelliJ. As I alluded to earlier, I think IntelliJ is the one that "just works". If you haven't tried it, I recommend giving it a shot. Personally, I've never been a fan of the "Clojure for the Brave and True" book because learning Clojure and emacs at the same time is a BAD IDEA, and it gives a false impression that emacs is somehow necessary when it isn't.
> - Complaining about Javascript and React and then having your whole ecosystem wrap around Javascript and React is really obnoxious. Reagent is falling behind in React versions and it's missing out on performance enhancements. If you need to do niche React things, it's a pain in the ass.
Reagent works with React 18, function components, Suspense, React.lazy, hydrateRoot, etc... Honest question: what do you feel like you're missing out on right now by using Reagent? IMO, concerns about Reagent's performance are overblown. I don't think most apps suffer from this issue, they suffer from complexity. The Reagent/Re-frame API is the same as it was when I built my first app with it six years ago and the core model is still solid. One critical thing I do think is missing is SSR integration. I recently started a library to work on this: https://github.com/rads/rain
Here are some thoughts from the creator of Helix (successor to Reagent): https://www.reddit.com/r/Clojure/comments/11uluj4/comment/jc...
> - This might just be me, but I used Citrus with Rum and I found it to be the most over abstracted thing I've ever seen in my life. I know it was inspired by re-frame, so maybe re-frame is the same. But it's like Redux X10 in terms of verbosity.
I haven't used Citrus with Rum, but I think Reagent/Re-frame is worth checking out. You're probably going to have a better experience because it's a more mature stack. If you find Re-frame too much, the Reagent ratoms still work and are as simple as it gets for state management.
> - Call me crazy, but the Java/Script interop is worse than other guest languages because there's huge impedance mismatch between functional and OOP.
> - There are very popular broken libraries. People say "It's okay if a library hasn't been updated in 6 years, because Clojure is so stable!." This is a total myth, there have been several flat out broken libraries being recommended in tutorials.
Can you share what libraries you're talking about and/or what issues you ran into?
> - While people are working on frameworks (Biff, Fulcro), there are no "best choices" for a lot of problems yet and it leads to frustration just trying to make a simple crud app.
In my opinion, Biff is the future for server-side apps. It works really well out-of-the-box and the pieces are there to improve it over time. After using om.next and getting burned by it, I haven't had much interest in Fulcro.
> The community hasn't been unfriendly or unhelpful, but sometimes it feels like I'm speaking to aliens.
I'd recommend the Clojurians Slack for support. Hit me up there (@rads) if you decide to give Clojure another shot and want some help working through some of the issues you mentioned.
> If I don't know where the problem is, I'll look at the Java stack trace and start adding `tap>` calls to see the flow of data. Since Clojure programs are data-oriented, inspecting the state that's flowing through the function arguments is usually all that's needed. It's a bit different process, though. Can you elaborate on your issues with the Java stack traces?
This, to me, is the equivalent of placing console.logs everywhere and running the request. Which isn't a terrible thing. Yes, I know Clojure is immutable and I can eval the function in a comment with `tap>`, and run it over and over again without affecting my system. But if I'm just using my site and all of a sudden something happens unexpectedly, I have no idea what function is the problem and what arguments were passed to it. It's often a nil that got passed 5 functions down. I have tried setting it up in a way that I can easily find where the problem is, and I have failed. So in reality, the debugging experience for webapps doesn't feel unlike what it would be for using react and a random backend.
> This doesn't really ring true for me even if a lot of docs are written for emacs. At work people use vim, emacs, VSCode, and IntelliJ. As I alluded to earlier, I think IntelliJ is the one that "just works". If you haven't tried it, I recommend giving it a shot
I'll have to try IDEA. Not pumped about the subscription. My personal experience with Calva, just asking multiple times over multiple weeks for help with a fullstack setup, is that people don't use it and don't care to use it. I got several "I don't use Calva" and "just use emacs" from prominent people in the community.
> Reagent works with React 18, function components, Suspense, React.lazy, hydrateRoot, etc... Honest question: what do you feel like you're missing out on right now by using Reagent?
I got my wires crossed on this one and was confusing it with something else, I apologize.
> Can you share what libraries you're talking about and/or what issues you ran into?
In general, the claim that a library doesn't need to be updated as it wraps around another library is dubious to me. But on my end, Secretary is a very popular client side routing library that was recommended in a lot of places. I wrote a lot of code for it before finding out a key piece of it was broken and nobody seemed to care.
> In my opinion, Biff is the future for server-side apps. It works really well out-of-the-box and the pieces are there to improve it over time. After using om.next and getting burned by it, I haven't had much interest in Fulcro.
I'm interested in Biff, but after trying it a bit, it seemed like I would benefit from it more if I had a grasp on fullstack Clojure development first.
In general, the Clojure slack has been a mixed bag. People are very helpful and nice, but sometimes it seems like I'm asking something simple like "What should I be using for client side routing" and nobody has an answer.
For me, there are many ways to approach the problem of "I'm just using my site and all of a sudden something happens unexpectedly" which are not necessarily specific to Clojure. That said, one unique feature of Clojure is that you can literally inspect data and change the code as its running in production, which is not possible in most other languages. Once you're connected to a prod REPL, you can redefine functions to include `tap>` if you want.
> I'll have to try IDEA. Not pumped about the subscription. My personal experience with Calva, just asking multiple times over multiple weeks for help with a fullstack setup, is that people don't use it and don't care to use it. I got several "I don't use Calva" and "just use emacs" from prominent people in the community.
I know that some people on the core Clojure team use IntelliJ for development. I feel your pain about the subscription cost.
> I got my wires crossed on this one and was confusing it with something else, I apologize.
All good, thanks for clarifying.
> In general, the claim that a library doesn't need to be updated as it wraps around another library is dubious to me. But on my end, Secretary is a very popular client side routing library that was recommended in a lot of places. I wrote a lot of code for it before finding out a key piece of it was broken and nobody seemed to care.
I think stability as a cultural value is the most important thing about this, but yeah, it's more of a goal than a rule. I'd suggest using reitit these days. It's well-maintained in 2023 and we use it in production for our Ring apps with no issues. It has a CLJS namespace (`reitit.frontend.easy`) which would replace secretary for you. Plus you get the benefit of routes-as-data and the same interface for both server and browser. I think the chance of this library falling by the wayside any time soon is unlikely.
> I'm interested in Biff, but after trying it a bit, it seemed like I would benefit from it more if I had a grasp on fullstack Clojure development first.
If you need help with Biff, post on the #biff channel. I think people (including myself) would appreciate the fresh perspective. If you don't want to use a framework, try creating a Ring app from scratch with Reitit and Hiccup. Use HTMX to start if you want interactivity. If you can do that first, you'll have a solid foundation to build a full-stack Reagent/Re-frame app on top it because you won't have to change routing libraries or templating languages.
> In general, the Clojure slack has been a mixed bag. People are very helpful and nice, but sometimes it seems like I'm asking something simple like "What should I be using for client side routing" and nobody has an answer.
Just use Reitit. I think you'll see it becoming more common as time goes on.
I think the vibe I have gotten working for so long in Clojure is that you're basically screwed unless you are already in a work place using it.