Jump to content


All my precious work gone!


22 replies to this topic

#1 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 04 December 2009 - 05:07 PM

Just a reminder, when developing always back up.

I was using gcc and didn't back up, or use any kind of SCM software, when I went to compile if forgot a single flag and lost about 400 lines of code! It went a little something like this:
gcc -o main.c physics.c timing.c -lSDL
instead of this, as it should have been:
gcc -o ../pong main.c physics.c timing.c -lSDL

Now, all I am left with is the knowledge that I learned while making it, a memory of 5 hours of work (- maybe 30 minutes for the simple generic functions, that I have in physics.c, I already wrote timing.c for something else), and a semi-finished executable.

Remember to back up!

I think I am going to cry in the corner now.

P.S. At this point, all I had was a functioning scoring and collision system, as well as a basic state machine. Do you think that it would be wise to start again on the same project and maybe do it a little better with my new insight? Or just start on my next project?
/* Perfect_day.c */
#include <arcade>
#include <computer>
#include <drinks>
#include <hardware/high_end>
#include <snacks>
#pragma <responisiblities>
...........

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4969 posts
  • LocationBellevue, WA

Posted 04 December 2009 - 05:48 PM

This is why you always use SCM even for single-party development! :)

Seriously though, 400 lines of code isn't much, and rewriting it will take far less than 5 hours. I bet you'll find you remember a lot more of it than you think. Go ahead and rewrite it - don't give up because of a little setback.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 onyxthedog

    Senior Member

  • Members
  • PipPipPipPip
  • 467 posts

Posted 04 December 2009 - 05:50 PM

Part of the reason it took me so long is that I had to learn how to use SDL at the same time, all I really knew how to do was create a window and blit some stuff.

Now it will probably take me maybe 2.5 or 3 hours to rewrite and add some more.

Now to bzr!
/* Perfect_day.c */
#include <arcade>
#include <computer>
#include <drinks>
#include <hardware/high_end>
#include <snacks>
#pragma <responisiblities>
...........

#4 v71

    Valued Member

  • Members
  • PipPipPip
  • 289 posts

Posted 04 December 2009 - 06:06 PM

I remember in the old days when something like that happened to me i always thought it was an higher entity, advicing me not to loose time on lame stuff
and do university work :-/

#5 alphadog

    DevMaster Staff

  • Moderators
  • 1643 posts

Posted 04 December 2009 - 06:13 PM

Reedbeta said:

This is why you always use SCM even for single-party development! :).

And, I might add, backups of said repository.
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.

#6 Reedbeta

    DevMaster Staff

  • Administrators
  • 4969 posts
  • LocationBellevue, WA

Posted 04 December 2009 - 06:22 PM

Also, go ahead and spend a few minutes to set up a makefile or a build script of some sort. Typing in build commands by hand is, as you found, error-prone. :)
reedbeta.com - developer blog, OpenGL demos, and other projects

#7 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2327 posts

Posted 04 December 2009 - 06:41 PM

v71- is that a hint of superstition?
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#8 v71

    Valued Member

  • Members
  • PipPipPip
  • 289 posts

Posted 04 December 2009 - 08:17 PM

...................

#9 TheNut

    Senior Member

  • Moderators
  • 1472 posts
  • LocationThornhill, ON

Posted 04 December 2009 - 08:31 PM

I'm a nut when it comes to backups ;) Local backup drive + portable drive + netbook + personal USB that's really for the "my house caught on fire and I wasn't home to dash in and save my precious code", lol.

Best thing is to setup all your backup drives and run a sync tool to periodically copy over stuff. rsync is pretty popular in the *nix world. SCM works too but I prefer backing up original content and not some database.

And a Makefile is an absolute must too!
http://www.nutty.ca - Being a nut has its advantages.

#10 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1271 posts

Posted 04 December 2009 - 09:08 PM

I'm not a backup person at all. One thing that finally occurred to me was to save my work on a different drive than c, using windows. That way when I ultimately destroy everything and need to reload windows, my work is still hanging around on another drive. The last time it happened was when, even though I had a valid, Best Buy copy of Windows with the computer I bought, Microsoft suddenly decided it was illegal. Help desk was useless and I don't save receipts, either. Losing 4 or 5 hours of work would only earn a shake of the head and a smile for me. What you'll find is the code you re-write will be a lot shorter and better organized than the code you lost.
Currently using Blender 2.5, FlashPunk, and Unity.

#11 Mihail121

    Senior Member

  • Members
  • PipPipPipPip
  • 1052 posts

Posted 05 December 2009 - 02:44 PM

I backup to gmail daily. Uploading SmallTalk images as attachments is slow, however, that's why I also use flash USB. I send my bachelor thesis to myself every few hours however. :D

#12 poita

    Senior Member

  • Members
  • PipPipPipPip
  • 322 posts

Posted 06 December 2009 - 05:39 PM

At least it was 400 lines. Could have been a lot worse.

As for your question, I say you start the project again and finish it. Rewriting 400 lines of code should easily take less than half an hour, unless you've managed to forget how you did everything.

#13 .oisyn

    DevMaster Staff

  • Moderators
  • 1822 posts

Posted 06 December 2009 - 09:00 PM

fireside said:

I'm not a backup person at all. One thing that finally occurred to me was to save my work on a different drive than c, using windows.
First of all, even if you can't boot Windows anymore your data is still there. Secondly, if your drive crashes your data *is* gone, no matter the drive letter of the data.

As for some others, keeping backups serves a different purpose than source control management. Most incremental backups don't keep a history of files and simply overwrite old versions with new ones. So if you wrongly change a file and a backup has already taken place, your original is gone. So you should use source control management for that purpose. However, SCM doesn't add redundancy, so if you lose the SCM database you'll lose all history information. Therefore it's wise to make a backup of the SCM database.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#14 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1271 posts

Posted 07 December 2009 - 04:33 AM

Quote

First of all, even if you can't boot Windows anymore your data is still there. Secondly, if your drive crashes your data *is* gone, no matter the drive letter of the data.

This a solution between those two. I don't have to come up with some way of reading the drive, I can just reformat and reload windows. Everything is still sitting on the other drive waiting for me to reload the major programs. Actually, I started doing it since the last computer I bought which had an extra drive labeled "data" with it. Even then it took a little while to sink in. I've personally never had a drive crash. I know some others that have but they were smokers. I've had Windows crash and become un-bootable many times.
Currently using Blender 2.5, FlashPunk, and Unity.

#15 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2327 posts

Posted 07 December 2009 - 05:20 AM

Before visual studio you had visual c++ 6.0 and thank god they improved it.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#16 .oisyn

    DevMaster Staff

  • Moderators
  • 1822 posts

Posted 07 December 2009 - 01:12 PM

Actually Visual C++ 6.0 *was* in fact part of Visual Studio 6. The first visual studio was released in 1997 and contained Visual C++ 5.0. The VC++ versions that came before that (4.0 and lower) were not packaged in a suite like visual studio.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#17 alphadog

    DevMaster Staff

  • Moderators
  • 1643 posts

Posted 07 December 2009 - 02:32 PM

In fact, a one-man team, or small teams, can avoid using an SCM if they keep multiple sets of backups. Generally, take a full backup once a month, differential every week, incremental every day. Keep all backups for six months to a year. Add salt and pepper to taste.

If you need to go back to older code, it's a bit annoying, but possible.

Of course, using an SCM gives you many other smaller benefits, if you are willing to add this tool to your toolbelt. (Some people aren't for whatever reason. But, at least keep rigorous backups.) For example, you have much more granularity on changes. You also can move back and forward across versions very easily to track down regressions and such.

The only reason to not do any of the above is pure laziness.

BTW, the justification for avoiding setting all this up that once you code something, you can code it again in a fraction of time is just plain stupid. I wouldn't want you wasting time like that on my team. That's just bad team hygiene.
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.

#18 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1271 posts

Posted 07 December 2009 - 04:58 PM

Quote

I wouldn't want you wasting time like that on my team. That's just bad team hygiene.

Once you have a team or a very large project, it's a job at that point, even if it's not a paid for job and you should do everything possible to protect your work. If you are banging around on a little one or two month hobby project, I think it gets a little ridiculous making a big deal out of everything. It's a hobby. I'm doing it for fun. I can rewrite a little code. It's almost like making a big deal out of not making a game save for me. People get too serious about the whole thing. These are frivolous games. My first computer was a Radio Shack color computer which had no way of saving your work. You typed it in, played around with it, and turned it off.
Currently using Blender 2.5, FlashPunk, and Unity.

#19 alphadog

    DevMaster Staff

  • Moderators
  • 1643 posts

Posted 07 December 2009 - 05:43 PM

That's totally fine if you want to risk your time when working alone on your hobby. It's your prerogative. I said as much that full SCM can be overkill for some. Backups to removable drives are the first step and always worthwhile.

If you're diddling with code, then yes, SCM is overkill. Kinda like a condom while diddling yourself. :)

But, as soon as we're a two-man team, and some re-write or delete you do blows up my/your/our work, and we waste time tracing it, testing it and re-writing it, you better hope we have an SCM. To continue my impromptu metaphor, I'd like to practice safe coding once at least one partner is involved. :)
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.

#20 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1271 posts

Posted 07 December 2009 - 06:13 PM

I've never actually worked with anyone on a coding project. I've donated some work to others and had them donate to me, but it was artwork, voice work, etc. I tried being on a team a couple times and I couldn't stand it and ended up quitting right away. That's a little too much like work at that point. I can see the necessity of it, but I don't need a boss unless I'm getting a pay check.
Currently using Blender 2.5, FlashPunk, and Unity.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users