Hacker News new | ask | show | jobs
by shadowmint 2734 days ago
> Interactive REPL based workflow (think of programming in Clojure like playing a difficult video game based on trial and error with emulator save states vs without).

What?

I'm not sure I understand what that's even trying to say?

Is it trying to say, think of programming as playing a difficult computer game, and using a REPL like having save states?

...because it sounds like you are saying programming in Clojure is like playing a difficult video game based on trial and error, which is a really rubbish endorsement.

> To touch on the video game analogy - imagine playing one of the old Mega Man games, Dark Souls, or Battletoads. Now, imagine that instead of getting feedback (a death) that results in a hard restart at the beginning, you instead just get taken back one action / event that caused an error (a single failed function call in REPL). That's like loading a save state, and if you like easy mode, you'll love the Clojure REPL.

?

mmm... but if your analogy is 'this is like doing something really hard, but you can timestep back to save state so it's not so bad', then you're still basically saying writing Clojure is really hard.

I don't think that's really a fair thing to say about Clojure, it's just a terrible analogy.

Expressing things in Clojure is what it excels at; if you want an anology the REPL is more like a minecraft sandbox that you just continually keep building in, rather, than planning out your structure on paper before you start playing.

3 comments

It's saying programming is really hard, but Clojure gives you save states.
Well most of the people write code in small chunks that yields to the following workflow:

- write code

- compile & run, see if it works

Just keep repeating this until you achieved what you want.

In REPL this is exactly the same you just have a much faster way of trying out a concept.

I think this is pretty simple to conceptualise.

Obviously, but that's not the point I was making.

...but how does that (what you wrote) == "think of programming in Clojure like playing a difficult video game based on trial and error with emulator save states"?

- each iteration in the repl is a state that you can preserve ("save")

- playing the vide game is trying out new states

I guess this is what OP was thinking about.

I've had this same thought while working with immutable data structures. Maybe the author is referring to that.
As I understand the analogy: the (difficulty of the) video game is the problem domain.

Clojure + REPL is save states / time travel

(could be clearer though)