Hacker News new | ask | show | jobs
by reddit_clone 394 days ago
Exactly. I start in the repl, but when it becomes a few expressions deep, I transfer it to the editor and turn it into a proper defun. Start 'sending' the defun to the repl and test it out in repl. Rince repeat.
1 comments

> I start in the repl [...] I transfer it to the editor

That's exactly the kind of misunderstanding parent was talking about :)

Why start somewhere else than your editor, if it's already hooked up to the REPL? When I launch my REPL, I don't think it even accepts stdin, because there is no reason it has to.

There is no hard and fast rule (for me).

It is easy to start creating objects in the repl (say if you are testing an API) and work with those created objects in the repl, one step at a time. You are able to observe the behaviour of the objects every step of the way. This gives you a much better idea when you are writing the functions (usually copy-pasting from repl) in the editor.

I am sure it can be done from the editor itself. (say using the 'comment' block in clojure). It is just matter of preference.