Fork me on GitHub

When listening to some colleagues at work, who have learnt Clojure at this job, I realize that the way I have tried to guide people to the REPL without going via the prompt, also risks creating confusion. They say stuff like “I don’t use the REPL much”/“I don’t know how to use the REPL” and then when I see them work, they are REPL-ing like bosses. Ask them to test something out using lein repland they get stressed up. That’s that scary REPL right there! Of course this could be because in their intro to Clojure they have been introduced via the prompt, but anyway. The things you need to understand after proper introduction is probably something like: • The REPL is not the prompt • The REPL is almost the same thing as your application • Your editor is connected to the REPL/app • There is a nice little prompt where you also can reach the REPL/app, good for some use cases. WDYT? (Did it even make sense?)

💯 3

Yeah, I totally agree. I think that calling it REPL-driven development is confusing people. It's technically right, your editor is connected and is repl-ing, but that doesn't matter if people are confused.


If your editor isn't connected and you aren't sending forms with a keystroke, you're missing out on the most powerful flow.


@U0ETXRFEW hard agree. I show both, and talk about the IDE : REPL :: client : server model, but I emphasize drilling good habits of IDE-integrated interactive development. That is one of my key goals when teaching newcomers,

;; - Drill some Clojure basics, required for the sections that follow
;; ... ... ...
;; - Start using an interactive development workflow right away ...
Structural editing is the other thing that is super important to show right from the beginning. Newcomers fear the parens because they don't get to actually see the purpose and the value. I realized this after teaching a few iterations of my workshop. Now I demo it in the beginning so people at least know how code gets developed. Frequently, it blows their minds. It's a bit much to layer on as a requirement, though. Application of concepts, thinking models, and interactive problem-solving habits are way more important, and so I designed the material to emphasize those. After a bit of that practice, I remind people to go practice the slurping and barfing --- mess around with code as if it's a Tetris game. :D

❤️ 3
👍 2
Jakub Holý (HolyJak)17:09:46

It's understandable that they identify REPL with the prompt. It's like the terminals, python "repl" fns similar stuff they are used to. Understanding that repl is essentially a connection to your live application that allows you to inspect and change it - while it's running - that's difficult because it's so new.


Yeah, many languages with shells have adopted the term "REPL", and so I find it harder to explain the semantic differences to newcomers. IMHO, the true import of having the R,E,P,L as separate and distinct components becomes clear only after realizing the superpower of having a socket REPL available in production, or when we want to modify the behaviour of one of those for some custom purpose, or when we discover a choice of REPLs with different feature sets. So I just briefly explain in client-server terms, which is closer to reality, and which lets newcomers still think in terms of a familiar model.


Like, I get them the start a REPL at the terminal, and point out the localhost:port part in the welcome message, which we can "connect" to from the IDE.

Jakub Holý (HolyJak)07:10:36

FYI I have made aimed at allowing people to experience what I call "interactive development" - which is "REPL-driven development" but I prefer the former term, since I find it less mysterious. (BTW the aim of the workshop is not to teach Clojure, though it obviously uses it.) It is based on Calva, connected to the running app.

Jakub Holý (HolyJak)07:10:38

@U051MHSEK I have looked at your clojure workshop, nice job! What I believed worked well for me when introducing Clojure syntax is this, I thought perhaps it could be of interest to you.

🙌 3

> I have looked at your clojure workshop, nice job! Thanks! Your slides are beautifully typeset! I think that intro will work well for the right audience. Mine tends to be Java/OO programmers. I discovered people with that background find it surprisingly hard to absorb a composite unit like (conj [] :first 2 {:name "Ava"}). There's a lot going on there. Even small things such as an alien-sounding name like "conj" trip people up. Plus the absence of commas etc. is disorienting to programmers habituated to putting syntax everywhere. Their mind tends to latch on to the alien-ness, which makes progress harder and confusion easier. So I chose to break everything down to the smallest parts, and lead people up a path of gradually composing things together into bigger things. Basically, reduce as much friction as possible in each step, and follow a plan that levels up core concepts really fast.

👍 3
Jakub Holý (HolyJak)09:10:02

Interesting. I will watch out for that the next time I try this on some Java folks.

Jakub Holý (HolyJak)09:10:40

Though the slides are intended for live presentation, so I can check with the audience that they follow and explain anything they do not, they are not intended to be just read.

👍 3

> Interesting. I will watch out for that the next time I try this on some Java folks. I try to watch the eyes of my class... if I see them glaze over, I know I've got an explanation problem 😅

😂 3

The only other things I’ve seen that comes close to the “REPL/Interactive Programming” experience of Clojure, is 1) Erlang/OTP (and Elixir, by extension), where there is loads of tooling to interact with running systems, hot code reloading, etc. and 2) R, but specifically within the RStudio IDE, where the editor is seemingly connected to some kind of underlying application. And I agree that the term “Interactive Programming” is more descriptive than “REPL” in the context of Clojure. I also have some prior experience with Ruby and Python. When I frist heard Clojurians speak about “REPL,” I thought to myself: “So… what’s new about that? Many other languages have that.” But I understand more now.

🙏 2