Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't want to disparage the pragmatic value of the features on your list, but they all pale in comparison to the one true killer feature for fast development cycles: a REPL.


> 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.


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.


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).


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.


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.


Python has a lot of REPLs, which one in particular do you mean?


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.


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.


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.


I'd love to see a video of someone developing via the REPL that somehow let me "get it".

I've never written code for which I've found the REPL that useful so either my domain is not conducive to REPL usage or I need a good tutorial or example to see what I missing and how to change my approach.

Any suggested videos or articles? though i suspect a video would be better for this type of thing


Funny, that. I see the REPL as a trap. (IDEs, too, for other reasons.) REPLs are a trap because they give you the illusion of progress while mostly just wasting your time.

I am used to writing 2000 lines of code and having it run (mostly) correctly the first time. In C++, in my case. Otherwise my experience is like the author's. Types are not mainly for error checking. I demand they earn their keep as part of the solution, and they do.


It depends a lot on what the program is doing. Writing 2000 lines of C++ that interface with other C++ libraries and having it work first time is something I can understand.

But if you have to consume untyped input (such as parsing text), or produce untyped output (such as an image) then the value of a Notebook/REPL really shines.


Agreed, how'd I miss that!


REPL == eval.


eval is useful for making a repl, but there are languages with a repl and no eval (Haskell comes to mind), and there are languages like PHP that have eval but no (built-in) repl.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: