I think REPLs might be why I've never really got excited about IDEs. When you're working in a REPL you can answer questions about your code instantly without needing smart autocomplete or context-sensitive help.
I think REPLs might be why I've never really got excited about IDEs. When you're working in a REPL you can answer questions about your code instantly without needing smart autocomplete or context-sensitive help.
REPLs are nice, don't get me wrong, but they are by nature single entrance, single exit. You are basically riding shotgun on a single unit test. You get a great view along the way, but the problem solving doesn't scale, nor can it handle situations where you need to consider multiple paths through the code. Writing a good test suite, and knowing just where and how to place debug trace statements are two of my best problem solving skills.
That lets you work line-for-line through your code, inspect and analyze each step as needed, edit parameters as wanted, restart and do clean runs through calculations using custom and third party libraries, and also interactively execute any tests/specs you have defined. It's a very tight feedback loop that doesn't compromise any of the long term artifacts you might want in a serious app.
In conjunction with .Nets extension mechanisms and some F# language features the setup lets you fire up a basic script, replace/extend anything from your object graph with new code, write accordant tests, and execute any or all parts of the test as desired in an interactive REPL-like session for problem solving and debugging: all in the same file :)
This flows really nicely with the single pass compiler, keeping things nice and clean so they integrate into the main app once exploratory development is done. Semi-serious typing, functional composition, and dynamic exploration -- it ain't bad.
The Common Lisp REPL automatically binds the last expression evaluated to the variable "+". It also automatically binds the value returned from the evaluation of the last expression to the variable "*".
I write code and develop interactively at the REPL with the package under development loaded/running. When the value I expect gets returned from the function or form I'm developing at the REPL, i just evaluate the "test" function (or a variant thereof if extra specificity or features are wanted such as names, doc-strings or tags, etc.), and the forms and expected values are packaged into a test and added to the projects' test repository.
Pretty much all the benefits of TDD, without writing tests up-front or wanting to do red/green (i did allow for the option, but i practically never do in practice), because they're an almost costless artifact of just developing now...
Where a REPL starts to fail, I find integration tests start to shine and vice versa.
A REPL makes writing both code and tests easier.
I have my IDE setup with some scripts to copy a database from production. Set some breakpoints and press the play button and I am debugging.
With A REPL first I need to do a load of import statements. Then populate my objects. Then get started with the actual debugging. I personally don't find it anywhere near as efficient as an IDE that has been setup. Plus with the IDE I can stop at a certain point in the code, have numerous variables populated then run "evaluate" in PyCharm, which gives most of the benefits of a REPL as far as I can tell.
Admittedly the IDE does take a fair bit more effort to get to a state where it is set up to be useful, but dealing with the whole system as opposed to a small part of it is incredibly beneficial for development. Though I guess a lot depends on the type of problem you are solving.
Can't you just run those scripts as the first thing in your REPL session?
Having an IDE setup is pretty essential to my job, so I am going to need that for debugging certain errors anyway. Once that is setup, I rarely see the need to start scripting things for a REPL as a debugger feels far more useful to me.
No, you absolutely do not. You just need to click around until your code hits the point in the code (or, ideally, run an integration test that gets you to that point) where you want the ability to run methods, inspect objects, etc.
Just make sure you've shoved an import IPython ; IPython.embed() in there and you're good to go. No additional imports necessary.
I agree that having your environment set up with production data (or as close an approximation as you can get) is a good idea, but I'd rather script that with a test framework where it can be used for regression testing rather than bodge it together using an IDE.
This is generally a lot less effort than populating objects in the REPL to reproduce the same set of conditions.
For me, it's way way easier the other way around.
Or did you think that once they're there it would still be a lot of effort to use them to populate objects?
But you are welcome to do what works for you. Maybe you work on something more suited to your approach. My approach works better for what I do.
That said, a high level 'unit test' (e.g. one that manufactures a request and checks its response) is often realistic enough and works pretty well with IPython.embed().
That being said, why do you find iPython so much better than Jupyter? I write probably 80% of my python code in Jupyter and cannot imagine coding without it.
But it's also just not a nice workflow. Projects are not linear. I tend to work on a function and get it working in the REPL. Then build up the program by combining together higher level functions. How am I suppose to test functions in Jupyter? Write the test then keep evaluating it and then delete it later?
I use it to make very pretty PDFs for bosses who want executive summaries, and I've started investigating using it to give lab talks so we can hack on the data together if i have to.
I don't think it's a particularly useful development tool.
I can't think of any good ide (dating back to vb6 20 years ago) that doesn't have one.
But, as I said above, it's not explicitly labeled as such.