Belt and braces

A moment ago, I was deep in some coding. What it was is not entirely relevant, With a page-full of carefully crafted code, I hit 'preview'. Bang. The IDE died. Normally, the programmer will say at that point something like "Aiee! I wish I'd hit 'save' first!", Probably, the temporary file would have saved the latest version of the code, but I didn't even bother to look. Being a graduate of the school of hard knocks, I keep a couple of tools in use that are great for this sort of emergency. The first of these is AceText, which is a sort of extended clipboard utility. Basically, everything you've ever stored on the clipboard is preserved on disk, and you can likewise keep all sorts of materials, such as favourite regexes, urls, clips, templates, procedures, HTML fragments or stock letters. A quick glance to see if I had the code pasted in there. This time, it didn't have a complete version of my lost code as it so often does. (Code I use gets copied and pasted a lot. Sometimes I copy onto the clipboard just to be doubly sure of preserving code.before running things), but this particular IDE had caught me out. I looked wistfully at the complex code. Looked? If you can see it, you can get it. Out came Abbyy screenshot reader. If you can red it on-screen, then it is likely that Abbyy Screenshot reader will scrape it off as text. Google Books? No problems, Locked-up application with an hours work sitting there taunting you? Work of a moment. Now back on song, cursing myself for not saving, but nothing lost. Programs like these are great for those little emergencies like 'Phil, I hope you kept a copy of the old version before you altered it?', and these occasional occurences of 'Mr Gates's revenge'.

If only SSMS had even the simplest of precautions against accidental loss of work, I'd be happier with it. My trusty Editpad saves every time I run some code, and keeps a copy of everything I've run. Of course, you can get add-ons to SSMS but it is hard to imagine how IDEs can still get away with losing code.