News for hackers. Stuff that matters.
Re:Throw away code by war1025 on Friday September 25, 2020 @10:35PM (#24595983)
> 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.

Re:Throw away code by xapata on Friday September 25, 2020 @11:19PM (#24596155)
If 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.

Re:Throw away code by SPBS on Friday September 25, 2020 @11:52PM (#24596276)
Tests 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).
Re:Throw away code by lukeschlather on Saturday September 26, 2020 @01:01AM (#24596564)
I'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.
Re:Throw away code by xapata on Saturday September 26, 2020 @04:16AM (#24597214)
I 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.
Re:Throw away code by mantap on Saturday September 26, 2020 @05:18AM (#24597471)
Python has a lot of REPLs, which one in particular do you mean?
Re:Throw away code by xapata on Saturday September 26, 2020 @01:03PM (#24600315)
My 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.
Re:Throw away code by war1025 on Sunday September 27, 2020 @09:58AM (#24606632)
This 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.

Re:Throw away code by xapata on Sunday September 27, 2020 @03:34PM (#24609497)
And 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.