Python Forum

Full Version: Recovering lost source code when the code is running in memory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I think that this question came up multiple times on previous incarnations of the forum, and when I saw the following I wanted to get it documented here for the next time - https://gist.github.com/simonw/8aa492e59...618f9e6b12
is this better than making backups?
Certainly not. It solves a different problem.
(Mar-29-2017, 02:16 AM)micseydel Wrote: [ -> ]Certainly not. It solves a different problem.

it looked like the same problem to me:  user error with the rm or delete command.  need to restore the lost file.
One solves the problem proactively. You must take prior action. It's more effective. It's great.

The other is an "oh shit, I didn't do anything to protect myself" kinda thing and is useful when accidents happen. I'm not going to lose committed code, but accidents do happen sometimes.
my editor command (aliased as "e" ,,, how i use it). make a date-time stamped backup each time i edit the file.  i should mod it to make repo commits and make public.  i've been doing this for at least the past 15 years.  i rewrote it into python just last month Dance
May I ask why you are so compelled to rewrite something that's already written quite well in the first place?
(Mar-30-2017, 02:03 AM)Larz60+ Wrote: [ -> ]May I ask why you are so compelled to rewrite something that's already written quite well in the first place?

python makes it easier to add features.

i started, tonight, working on a new feature to make the my e command and my keep command (part of a module now) have a configurable option to store the copies it makes in a specific directory.  it uses my pyconfig function to get the directory name from the config file.
(Mar-30-2017, 02:03 AM)Larz60+ Wrote: [ -> ]May I ask why you are so compelled to rewrite something that's already written quite well in the first place?

That is always the point... If nononee ever rewrote something that is thought to be well written, we would all still be coding in Fortran or A(PL).
Quote:That is always the point... If nononee ever rewrote something that is thought to be well written, we would all still be coding in Fortran or A(PL).

I would agree you, but only to an extent.
When I work on my car, I don't first try and re-invent the lift.

The lift has worked well for what is does for many years.
That's not to say that is shouldn't be improved.

After 50 years of professional programming, I must say that I have seen
a lot of wasted time spent on attempting to re-write applications that are already
extremely good, instead of placing the effort on those that really need to be re-written.
Pages: 1 2