I’m simplifying this for brevity but: Hot reload is a concept whereby changes will be saved, if necessary compiled (in the case of compiled/JIT-ed languages), then whatever is pointing at the original source is run again automatically (a web page/an app screen/whatever).
Edit-and-continue allows for changing the code and then updating the output directly in memory without re-compilation or restarting the execution. It sounds similar but in practice it allows for much more rapid iteration and is profoundly more useful. If you’re pretty deep into an application or web app for example (e.g. added to basket -> checkout -> process payment) and are 30 or 40 calls deep in a stack and realise you’ve a simple bug or change to make, you can edit the code in memory, drag the debugger back to the line, re-execute it and move to the next statement. The benefits of this compound really quickly for anything more than trivial scenarios, so much so that I’ll often code directly in a debugging session as it’s just handier to have a full rewindable call stack right there for simple cases where I’ve forgotten a property name or need to correct and XPath or something.
The surprising thing is that this isn’t even new, VS has had this for at least 20 years (and I think 25 or more as i know VB6 had it. Yes I’m old.)
From your description it sounds like in-memory application state is lost with Hot Reload, but I don't think that's true? I admit might be wrong about this, it doesn't apply to Unity which is my main development environment.
Quoting from the docs (emphasis mine):
> .NET Hot Reload applies code changes, including changes to stylesheets, to a running app without restarting the app and *without losing app state*
That sounds more like how you described edit-and-continue to me.
highwaylights|1 year ago
Edit-and-continue allows for changing the code and then updating the output directly in memory without re-compilation or restarting the execution. It sounds similar but in practice it allows for much more rapid iteration and is profoundly more useful. If you’re pretty deep into an application or web app for example (e.g. added to basket -> checkout -> process payment) and are 30 or 40 calls deep in a stack and realise you’ve a simple bug or change to make, you can edit the code in memory, drag the debugger back to the line, re-execute it and move to the next statement. The benefits of this compound really quickly for anything more than trivial scenarios, so much so that I’ll often code directly in a debugging session as it’s just handier to have a full rewindable call stack right there for simple cases where I’ve forgotten a property name or need to correct and XPath or something.
The surprising thing is that this isn’t even new, VS has had this for at least 20 years (and I think 25 or more as i know VB6 had it. Yes I’m old.)
Edit: 27 years ago in VC++5 (1997).
martindevans|1 year ago
Quoting from the docs (emphasis mine): > .NET Hot Reload applies code changes, including changes to stylesheets, to a running app without restarting the app and *without losing app state*
That sounds more like how you described edit-and-continue to me.