When writing code, I've noticed that different developers hit the Save button at different frequencies. This is in addition to whatever AutoSave setting has been set. Personally I have the AutoSave set to 10 minutes, and I hit the Save button whenever I type a reasonable amount of code (perhaps 10 to 30 lines). How about you guys?
I save when I complete my thought, or right before I want to run my code.
I agree with J.J. and hit it when I'm done with my thought. I have tried my fingers to save frequently because I use a lot of editing programs that don't support auto-saves. I lost about half an hour's worth of code once due to a power outage...once bitten twice shy.
I (necessarily) save just before I hit the compile button, which is very often. Every few minutes perhaps?
I remember years ago the Borland IDEs had a feature where they would compile from memory, because saving the file to disk before compiling was seen as "too expensive". I recall losing much work because the IDE crashed after not having saved my code for hours.
I have slight OCD for hitting Save. If we're measuring in thoughts, I would say I do it after every one.
No auto save here, that would only save when the code is not executable, not a clever idea. My editor creates real-time backups of the buffer so if it crashes I can recover easily. How often do I save? Not so sure, when refactoring after each refactoring step to check if it still runs [in dynamic languages] and normally every run or ~20 minutes, whatever comes first.
Every 1.3 minutes or less (if i stop writing and start to think i save)
Sometimes as often as every line, but usually after a "semantic unit" of code. I frequently forget to save when dong Edit and Continue in Visual Studio, though :-(
I only autosave. I hate working in IDEs that don't save for me.
I compile every five minutes or so. It may break, but that's ok; I'm saving. If I'm doing a large architectural change that spans more than a few files, again, I'll compile every so often just to get the save down (and also to make sure I'm not making stupid errors).
I'll save whenever I finish typing something, though I maintain a mostly consistently applied rule of only saving when what I've got should compile.
Of course, using vim, the ":w" combination is pretty much hard-wired into my brain now.
I save almost immediately after changing something.
I test after a few (5 - 10) saves
I commit after finishing any significant change that passes the tests
My CI server builds and tests 5 minutes after my commit.
Ctrl+S and Ctrl+Shift+S is the most used combination on my keyboard...
I save pretty frequently - certainly after writing any complex lines of code. Been bitten too many times by Visual Studio crashing at inopportune times.
But more than that, I also shelve pretty frequently so my code isn't only saved locally, it's saved on our source control server, at intervals before I am ready to check in. (For those not using TFS, shelving is similar to a private branch).
All the time. It's instinctive.
cntl-s in windows.
or
:w in vim*
or
: map v :w^M:!gmake my_prog 2>&1 \| tee results^M:!my_prog 2>&1 \| tee my_output^M
and then I'm hitting v all the time, when developing using vim*
just embedded paranoia from when I started in 1975, when things would "go south" for no reason! (-:
If you have either an editor that supports undo across saves, or an extension to your editor that makes each save create a local revision (sort of like local source control) then you can save with reckless abandon.
I'm the same as some other posters - saving when I stop thinking. This has the added benefit of not saving screwed-up code, if I realise I've messed it up before I stop thinking that is :) For this reason, I don't like auto-save.
I constantly hit Ctrl+S out of habbit. It's like I can't stand to see the little asterisk by the filename. It agitates me just looking at it!
I never hit the save button, but always hit CTRL + S instinctively after I make some change. So I end up saving frequently enough to not lose more than 1-2 lines of work at any given time due to any incident.
I never press save - I use Intellij IDEA and it saves files on frame deactivation. In case I corrupt something it maintains local history which works similar to version control system.
(Ok...beating the dead horse a bit...sorry.)
A good rule I learned from gaming:
SOS = Save Often Stupid
Your soul or sanity may just need to be saved after grinding 10 levels and losing them all to a boss. ;)
Also learned to keep multiple saves for when you find out something you did was really stupid. ;)
I save frequently. Whenever I complete a small little bit of code I save. If I modify something just slightly I'll save. I've been a victim of power surges and lightening strikes at the most inconvenient times. That is the downside to sunny-florida.
I routinely go hours without saving, sometimes several. Lost power once while I was gone at lunch. I went a couple hours without saving. Came back, thought I was screwed. Booted up, Visual Studio actually brought me right back where I left off (recovered).
In fact, I never actually click the save button (or Ctrl+S). I just do a rebuild which essentially saves it.
Hitting CTRL+S has become a habit now... I do it without knowing. As others have said already, I save when I pause coding and start thinking again. For that matter, I save a lot more often when I'm having trouble focusing on the project that I'm working on. =)
I used Brief for OS/2 for quite a while - a bad version of a good editor. It crashed at unpredictable times. Ever since then I've been hitting Ctrl-S every minute or two.
I save very infrequently. In fact, I rarely explicitly save my work. It already gets saved when I do a build, which I feel is often enough. Then again, I can't remember the last time my IDE crashed, let alone my computer. Are people's systems really that unstable that they find a need to save every 2-3 minutes? If you save so frequently, don't you increase the likelihood that the file will be in the middle of saving, exactly when it crashes, causing potentially more problems then if you hadn't saved?
I save during a coding pause, before compiling, running unit tests. Short answer very frequently. I use our version contorl system as a 'global undo' if I need to revert changes.
I use the TextMate setting to save after losing focus on the pane. I am looking forward to Google Docs style IDEs that have a total history of everything you typed...
- Save after typing in a "chunk" of code,
- (Re-)compile after a the functionality is added (or the bug fixed),
- Run my unit-test after the code compiles,
- Check it into version control after unit-test (and any regressions) pass.
It's nice if you editor has macros for each of the above steps...
I hit save as i do the addition or changes in code so that if something happens i don't have to do all over again.
We use a proprietary IDE, which is not surprising as it is a proprietary language. We have linked the save to the syntax check button, so every time I check syntax, I also save. We have the check syntax as the language is compile on loading (we only save source code) and an application will fail to load if there is a syntax error.