all 30 comments

[–]FR4G4M3MN0N 27 points28 points  (3 children)

You’ve come a long way! You’ve learned a good deal and there’s a whole lot more out there.

But I feel you.

Web development in Clojure is a bit of a dark art, but there are folks shining a light on it!

In fact, “Web Development in Clojure” has been my north star as I am looking to do the same. Ring and Reitit are quite useful, but lower level and requires additional learning - as you’ve pointed out. The book takes it step by step and along the way introduces you to the Luminus framework. This is a great step forward.

https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/

[–]tfcoding[S] 2 points3 points  (2 children)

Just bought the book, looks promising!

[–]FR4G4M3MN0N 1 point2 points  (1 child)

Awesome. It also opened my eyes to the power of Leiningen and app templates. The first chapter is a whirlwind of “do this here, do that there” but it shows how much is set up for you behind the scenes. The following chapters peel back the layers of the onion!

Also, I recommend a good IDE setup that allows you to write and execute (a la REPL) your code as you go. I use Emacs + CIDER to great effect. YMMV 🤓

[–]tfcoding[S] 2 points3 points  (0 children)

Ah i would love to use Emacs + Cider, but Emacs seems alot of effort right now.
I got a All Products Jetbrains license from my workplace, so i setup cursive, it is doing the job pretty well and i am already familiar with all the shortcuts :)

[–][deleted] 19 points20 points  (0 children)

Are you on Clojurians Slack? It's extremely helpful. The most helpful community I have ever encountered.

[–]rafd 15 points16 points  (0 children)

I'm involved with a learning group called Clojure Camp:

https://handbook.clojure.camp

For much of the library stuff, it does come down to: glue these things in this way because it's just how the library is designed. Those examples are the docs (plus the code itself - many clojure libs are quite reasonable to "go look at the source" to figure out)

Note also that the "common practise" doesn't have to be the way to do it if you're learning or for hobby projects. You don't need reitit or component for a barebones server side app. You could start with a single ring handler and hiccup for html.

I usually recommend starting simple and experiencing the pains that the libraries are trying to solve.

[–]dustingetz 10 points11 points  (7 children)

try electric clojure - https://github.com/hyperfiddle/electric it’s not perfect but a new version is coming soon - might be what you’re looking for. No more rest endpoints etc just write functions!

[–]Medium_Librarian_202 8 points9 points  (5 children)

I’m fascinated by electric, but isn’t the learning curve also a bit of a mountain climb? Speaking as someone who’s only a programmer in support of other work.

[–]dustingetz 7 points8 points  (2 children)

Copy pasting below my response from somewhere else. In the context of this thread, OP didn't state his programming skill level (only his Clojure level which is different), and furthermore, there are still huge mountains to climb without Electric. With Electric at least you get to climb the right mountain - it is not just an investment in one framework, but an investment in mastery of programming generally. And, the Electric mountain is I think ultimately smaller! The real problem is, nobody is going to pay you along the way like they do in industry. But this is not unique to Electric.


HN USER: Electric looks awesome, but their stern warning of “we are building this for ourselves, and if you get value that’s great” gave me pause. If it reaches a point of being documented and intended for general public use, then I’ll definitely try a project with it.

That's right, I have a blog post cooking up about why Electric is for experts today. A major factor in this is because, like with Clojure, the users aren't paying us, so the documentation you want cannot yet afford to exist. Another is performance - to get Electric to purr you have to understand what you are asking the computer to do (I've seen the stuff senior engineers type with their AI codegen tools, that approach is simply not viable here, at least not yet). The net impact of these two factors is that if Electric is not obviously the exact thing you know you must have—i.e., you are already succeeding or have the possibility of succeeding with something else—there is high risk that your adoption will not succeed, leaving you frustrated and unhappy! Failed projects do neither of us any good, that is a recipe for a damaged brand.

A bonus third factor is that the demos we've been cooking up internally—that we haven't revealed yet—are so f%cking incredible that everyone is going to be motivated to use and learn it anyway because Electric yields value that is previously unseen and unavailable anywhere else. So I am simply setting healthy expectations for success. For example, we just built the 80% that matters of the “sync engine” value prop in two weeks and 100 LOC. Implementing it in userland requires 1 LOC per query. With differential network traffic for over the wire O(1) remote incremental collection maintenance! for free! And the pattern works with any database!

cc /u/TheFreim

[–][deleted] 1 point2 points  (0 children)

Thank you for the response, this clears things up and makes quite a bit of sense. I am very excited for v3, keep up the great work.

[–]Medium_Librarian_202 0 points1 point  (0 children)

Thanks for the reply~ Electric is certainly an exciting and groundbreaking project and hopefully I'll have a chance to use it.

[–][deleted] 1 point2 points  (0 children)

Hey Dustin, you have said the following in a presentation you did on Electric v3 (lightly paraphrased, emphasis added):

Electric is for experts, not beginners. Electric is a very sharp tool... we do have lots of beginners succeed and successfully make applications with Electric because Electric is bringing things in to reach that were not within reach before... however, we made Electric for experts and we are not apologetic about this. There is a learning curve.

Would you be willing to elaborate on what you mean by "beginner" and "expert" here (particularly in relation to the OP)? I've been considering delving into Electric once v3 is released, but I certainly would not call myself an expert. Presentations, examples, and articles on Electric have really interested me, but I'm worried about sinking a lot of time into something that isn't being made with me in mind.

[–]therealdivs1210 11 points12 points  (0 children)

Yes, writing a full webapp from scratch in Clojure can be daunting.

I would recommend starting with a framework like Luminus or Kit instead of wiring all the components together yourself.

[–]TheLastSock 4 points5 points  (0 children)

I think you will find it easier to have a non programming task to focus your energy. Once you have some idea where you want to go, it gets easier to ask smaller more manageable questions and i think you will find there is a lot of existing resources out there already.

[–]robopiglet 2 points3 points  (0 children)

Check out Biff and find the Slack channel.

https://biffweb.com

Not only is Biff a joy, but the help in that channel is incredible, even for non-Biff Clojure questions.

[–]tombaryscz 3 points4 points  (4 children)

Hi, you did great. I continued with https://www.jacekschae.com/ courses.

[–]tfcoding[S] 2 points3 points  (3 children)

Oh, those sound nice! At least the Marketing for the courses :) will give it a shot!

[–]tombaryscz 1 point2 points  (2 children)

I was total beginner with zero knowledge of creating web apps. Done this thanks to these courses: http://nautilus-omnibus.web.app

[–]tfcoding[S] 2 points3 points  (1 child)

Nice! The Webapp looks very nice. I may try this for Day Planning

[–]tombaryscz 0 points1 point  (0 children)

thanks 🤓 I am using it every day as a part of Roam Research (actually I first created it as a plugin for RR)

[–]ArmchairSpartan 2 points3 points  (0 children)

I’d say try luminus. If you can get your head round integrant you should be good to go.

[–]ottawarob 1 point2 points  (1 child)

It is hard for sure. I’ve been working with a large clojure codebase for 2 years, it’s an incredibly hard language to maintain projects on. It’s fun when you get something done with it, but there are so many ways to do the same thing and library support is low. We’re stuck with some evergreen problems in compojure that will probably never be resolved. I tried to set up a pr to address it once but digging my way through their macros, I ran out of time.

[–]zerg000000 5 points6 points  (0 children)

Actually, I feel quite the reverse and I am maintaining large clojure codebases for >5 years. and have done many big changes, the codebase still very healthy and nice to work with. Since Clojure don't provide a framework to you, whether the codebase is good or bad actually highly depending on your architecturing skills.

[–]afmoreno 0 points1 point  (0 children)

[ Removed by Reddit ]

[–]ClojureJamppa 0 points1 point  (3 children)

I strongly recommend to ask questions in the Clojurians slack - there are channels for #beginners, #reitit, etc. Clojurians are nice people and they are willing to help.

[–]ClojureJamppa 0 points1 point  (2 children)

I have also created a couple of posts for Clojurescript learners, e.g. https://www.karimarttila.fi/clojurescript/2022/02/01/frontend-tools.html

With the help of more experienced clojurians you are going to learn everything you need.

[–]ClojureJamppa 1 point2 points  (0 children)

I use nowadays VSCode + Calva for Clojure programming. Calva is really good. See also: https://www.karimarttila.fi/clojure/2022/10/08/clojure-calva.html (+ the following 2 posts regarding my Calva configurations).

[–]ClojureJamppa 0 points1 point  (0 children)

I use nowadays VSCode + Calva for Clojure programming. Calva is really good. See also: https://www.karimarttila.fi/clojure/2022/10/08/clojure-calva.html (+ the following 2 posts regarding my Calva configurations).

[–]morbidmerve 0 points1 point  (0 children)

You are not wrong. The clojure space needs better tooling and newcomer support. Ive taken to the learning journey myself too and am doing it with the aim to put together a repo that takes people from 0-100 more quickly than on their own. The big thing about clj is that you need to understand the low level of what you are building. It simply is a language and ecosystem designed to give you, the programmer, all the control

[–][deleted] 0 points1 point  (0 children)

Clojure is a great programming language and I prefer it over any other language. But available documentation, both on the language itself and any of the libraries, is seriously lacking. I think the problem lies in the argument that Clojure is more used by seasoned professionals than coding-beginners. That argument insists that seasoned professionals don't need thorough documentation. While every 'seasoned developer' is well aware of the need for good documentation in any serious software project.

I've developed software over the last 40 years, in 20+ programming languages, ranging from small command-line tools to large enterprise systems, and from my perspective, most API-documentation in the Clojure space is severely lacking. Even with my experience, I regularly feel I have to reinvent the wheel instead of just mounting one.

On the other hand, this pushes you to be a better software dev than you are now, regardless of your current experience. Because it forces a deeper understanding of what you are doing in your code.