4 ms·
> the one true killer feature for fast development cycles: a REPL. I've been a python dev for about a decade. I do use the REPL a couple times a week, but I w
by war1025 6y ago
> the one true killer feature for fast development cycles: a REPL.
I've been a python dev for about a decade.
I do use the REPL a couple times a week, but I wouldn't really call it "essential".
How do people use it that makes it so valuable?
Usually I just use it when trying to figure out how to parse some text or check what methods or properties are available on an object. Really nothing that I couldn't do in a test suite or the code itself.
- deleted 6y ago[deleted]
- xapata 6y agoIf you're not writing your code in a design that lets you run parts of it every few minutes (or more frequently), you're missing out. Best way to avoid bugs in your module: don't put them in there. Find out in the REPL before you put code in the .py file. Also, it's more important the more data-dependent your code is.
- SPBS 6y agoTests also have the advantage of input automation. They have the disadvantage that you can't poke around at the environment once they're done (unless you drop into a debugger).
- lukeschlather 6y agoI've found this is more and more the primary way I use the Python repl - I invoke pytest and tell it to drop me into the debugger if there's an error.
- xapata 6y agoI usually have a test data set and run my module against it in IPython. So input is automated to some extent. If I'm analyzing the output, it can be helpful to quickly adjust charts and graphs. I'm now in the process of building distribution tests into my test suite, but it's not clear how to track everything. I need data sources essentially kept under version control, but which are generally too big for git.
- mantap 6y agoPython has a lot of REPLs, which one in particular do you mean?
- xapata 6y agoMy personal choices are IPython and Jupyter, depending on whether I'm making plots. If you choose Jupyter, though, I caution that you should be careful you don't switch entirely away from modules and test suites. Jupyter can be too easy in a way.
- war1025 6y agoThis sounds quite a bit different from the sort of development work I do. I can see how a REPL would be really useful when working with data, but for building out a webserver or desktop application, it doesn't have nearly as much value.
- xapata 6y agoAnd tests have less value, or at least are more difficult to write, when you're not sure if an outlier is valuable information or junk to be discarded.