3 ms·
What are people’s thoughts on how using vs not using a REPL help or hinder one’s thinking as a programmer. Specifically I mean if you have no REPL and maybe a l
by khalilravanna 6y ago
What are people’s thoughts on how using vs not using a REPL help or hinder one’s thinking as a programmer. Specifically I mean if you have no REPL and maybe a long compile time you’re forced to put a little more thinking and planning in up front if you don’t want to waste your time. You might be more meticulous in catching bugs. Whereas with a REPL you can throw stuff at the wall. If something breaks you can just tweak variables and structure in real time till it starts working.
That’s just one characterization I came up with off-hand and it may be inaccurate. I’m mostly trying to paint a picture where tools affect the thinking of the programmer.
What are people’s thoughts on this? Does using a REPL or not using a REPL change your thinking and how so?
- mikelevins 6y agoI think it's a valid observation. Circumstances that make you think things through ahead of time compel you to learn things and gain skills that you would not otherwise learn and gain. The other way around is true, too, of course. But the intensely-interactive style of programming-by-teaching is the less common approach. In pretty much every thread I've been part of about the topic there have been commentators who've said they just weren't even aware of it as an option, who had no idea that full-featured repl-driven environments had ever existed or were a possibility. What are the odds that such an obscure approach to programming has already attracted all the programmers who would benefit from it? Long odds, I'm guessing. So my guess is that it's worthwhile to point out the option for the sake of people who would benefit from it but don't know they have the option. For my benefit too, of course. I want more people to know about it, because that increases the chances that demand will rise. Rising demand increases the chances of greater investment in those kinds of tools, and reduces the chances of their extinction.
- Jtsummers 6y ago> Specifically I mean if you have no REPL and maybe a long compile time you’re forced to put a little more thinking and planning in up front if you don’t want to waste your time Amusingly, to me, this is something people describe as the difference between having to submit punch cards to (or schedule a job on) a mainframe versus having a compiler on your own machine. That having such quick access to the compiler would lead to the "throw stuff at the wall" approach. IME, faster feedback loops do increase the "throw stuff at the wall" approach, but for those of us who still (mostly) sit back and think, it's an enabler and not (just) a crutch. I can get in the flow much better in a language like Lisp and stay there. If, for instance, there's some confusion in my mind about how a function or data structure works, in C++ it takes me longer (more of a constant factor longer rather than orders of magnitude longer) to write something and test it out (assuming documentation doesn't clear it up for me). But while the time to explore it isn't huge, I've been pulled out of my focus for longer. With Lisp, I can test it in seconds and get right back to whatever I was doing. But also, when I don't have a REPL, I break my programs into smaller programs (libraries/modules) which can be composed into the larger program I want. This lets me, partially, recreate the REPL experience. Using a test runner (a proper one or an ad hoc one) and a set of small CLI apps that let me use the smaller modules directly I get something approaching the feedback speed of the REPL. With fewer dependencies for any part under test (or as a CLI app), I get much faster compilation speeds vs needing to recompile a much larger program.