REPL Driven Programming in Python

As many of you know, I’ve long been fascinated with interactive or exploratory programming—what some call REPL driven programming. It’s the idea that you write a bit of code and try it immediately by executing it to see what happens. You keep adding to the code and soon you have a function and then a program. The very best example of it that I know of is Kris Jenkins’ video on building a Spotify client for Emacs. If you haven’t seen this video, I urge you to take a look; you won’t be sorry.

When I think of interactive programming, I usually think of it in terms of a Lisp-based language such as Scheme, Common Lisp, or Elisp. There’s no reason, though, that you can’t bring the method to bear on any language that supports a REPL. David Vujic has an interesting post on applying the method to Python programming.

He starts by explaining what he doesn’t mean by REPL driven programming and moves on to what he does mean. The TL;DR is that he’s not talking about typing in a Python expression from the shell; he’s talking about interactive use from within an editor. If that doesn’t make sense to you, take a look at Jenkins’ video to see it in action with Elisp and Emacs. He spends the rest of the post explaining his setup and workflow. If you’d like to try out interactive programming but don’t know any of the Lisps, perhaps Vujic’s post will help you get started.

This entry was posted in General and tagged . Bookmark the permalink.