Why REPLing beats IDEing

I’ve always preferred a working technique based on a REPL (read-eval-print loop) over a technique based on an IDE (Integrated Development Environment). A friend of mine explained why in one sentence: “With a REPL, you test, then code; with an IDE, you code, then test.” My assessment of TDD (Test-Driven Development), all the rage in commercial development shops, is that it is an attempt to shoe-horn the REPL style of working into world where you don’t have a REPL, just an IDE, perhaps with a Unit-Testing Framework. Here is what I mean by all this:

Let’s say you have a REPL. This is an ENVIRONMENT or TOOL where you can type little bits of code and see the result immediately. My favorite one, nowadays, is LinqPad for C# and F# programming. But NodeJs is accessible through the console, Racket has one, most common programming languages come with one. A console interface (as opposed to a REPL embedded in a GUI) is usually preferable. That keeps your hands off the mouse [LIKE! — mouse is slow, imprecise, causes shifts of attention — mental page faults — as opposed to keeping your eyes and mind focused on a linear task represented clearly in the console!] But I’ll take a REPL in a GUI (like LinqPad) over an IDE any day.

Now you want to write some code, say a linq expression. You try it out on a Miniature Data Set [LIKE! — that makes your testing cycle time seconds instead of minutes, keeping your attention on the task at hand!] You go new [] {1,2,3}.Select(x => x*x); Boom, you see the result, you know your query is correct, and you PASTE it back into Visual Studio with total confidence. You don’t need to write a unit test because you proved it correct in LinqPad before pasting it in. Your entire cycle time is SECONDS as opposed to minutes. Tens of times faster.

It’s all about psychometry — keeping your mind focused on linear tasks rather than backtracking, digressing, forking, page-faulting, & joining.


~ by rebcabin on June 22, 2012.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: