Flash Flash Revolution

Flash Flash Revolution (http://www.flashflashrevolution.com/vbz/index.php)
-   Technology (http://www.flashflashrevolution.com/vbz/forumdisplay.php?f=74)
-   -   Very Expensive Typo (http://www.flashflashrevolution.com/vbz/showthread.php?t=130408)

UserNameGoesHere 06-1-2013 08:20 PM

Very Expensive Typo
 
gcc -o myprogram myprogram.c
./myprogram
...errors at blah blah line numbers ...
...fix those errors...
rm myprogram
gcc -o myprogram myprogram.c
./myprogram
....errors at blah blah line numbers...
.
.
.
...(hours of this later)...
rm myprogram.c
gcc -o myprogram myprogram.c
No such file or directory

FUUUUUUUU

dAnceguy117 06-2-2013 01:40 AM

Re: Very Expensive Typo
 
rip source code

Fluvs 06-2-2013 01:43 AM

Re: Very Expensive Typo
 
Messed up

FissionMailed1 06-2-2013 01:46 AM

Re: Very Expensive Typo
 
Why aren't you using a makefile so this kind of thing doesn't happen, lmfao. Even if you only have one source file, it is a good habit to get into.

UserNameGoesHere 06-2-2013 02:06 AM

Re: Very Expensive Typo
 
Quote:

Originally Posted by FissionMailed1 (Post 3915786)
Why aren't you using a makefile so this kind of thing doesn't happen, lmfao. Even if you only have one source file, it is a good habit to get into.

Yeah if it was something bigger I would. And you're right that I probably should.

I dunno -- I get sloppy sometimes when I'm just trying to throw something together.

Finished what I was doing, but that oops did set me back a bit. :-P

Izzy 06-2-2013 03:31 AM

Re: Very Expensive Typo
 
I'm confused what you were trying to type in the first place that was similar to "rm".

UserNameGoesHere 06-2-2013 04:29 AM

Re: Very Expensive Typo
 
Quote:

Originally Posted by Izzy (Post 3915822)
I'm confused what you were trying to type in the first place that was similar to "rm".

rm wasn't the typo

the .c on the end was.


Basically- compile code, test executable, fix code, delete executable, compile code,etc..
Except one time an accidental delete source.

Izzy 06-2-2013 04:58 AM

Re: Very Expensive Typo
 
But wouldn't recompiling already overwrite the preexisting executable?

UserNameGoesHere 06-2-2013 06:08 AM

Re: Very Expensive Typo
 
Quote:

Originally Posted by Izzy (Post 3915838)
But wouldn't recompiling already overwrite the preexisting executable?

It does. But, ... habit. It was more to ensure I had a "clean" environment in the off-chance it for some reason didn't get overwritten, as unlikely as that might be. Probably a tad OCD like double or triple checking your house door to make "sure" you locked it.

I'm very thorough, but sometimes a bit too thorough.

While this over-thoroughness bit me here, it is quite handy for things like finding and fixing bugs though.

qqwref 06-2-2013 10:32 AM

Re: Very Expensive Typo
 
Why didn't you use the up arrow (or similar) to copy the command you previously used? That should make it very hard to make a mistake like this.

UserNameGoesHere 06-2-2013 07:39 PM

Re: Very Expensive Typo
 
Quote:

Originally Posted by qqwref (Post 3915896)
Why didn't you use the up arrow (or similar) to copy the command you previously used? That should make it very hard to make a mistake like this.

With a bunch of miscellaneous commands, it's usually easier to just type stuff out than search through command history unless it's a particularly involved command (lots of options used/etc...)

Again, more force of habit. I would be issuing other commands in the between time and don't really feel like sifting 5 to 10 commands back to find what I want when it's easy enough to just type it out. That said, costly typo. :-P

One other thing I could do though to avoid this particular problem in the future is just allow the default name of a.out for the executable, for testing purposes, and only rename it once finished. It'd be pretty hard to accidentally delete a source code file that looks nothing like "a.out" and if I tried to remove a.out.c that file wouldn't exist and wouldn't matter.

FissionMailed1 06-3-2013 12:52 AM

Re: Very Expensive Typo
 
The thing about makefiles is that you can just make a template one that is universal for simple directory structures (i.e. everything is in the same directory as the makefile). It isn't a big deal to just reuse it, just change GCC args and whatnot. Also, in your makefile, you can add a label to delete all object files, so you can do something like this:

make
make clean

If you don't want to set up source control, you could just work out of Dropbox. That way, you have rudimentary housekeeping, should you make this mistake again.

dAnceguy117 06-3-2013 01:19 AM

Re: Very Expensive Typo
 
I email myself code periodically. #ghettolyfe

leonid 06-6-2013 09:04 PM

Re: Very Expensive Typo
 
Check your recycle bin :twisted:

dAnceguy117 06-7-2013 08:49 AM

Re: Very Expensive Typo
 
oh u..........

YoshL 06-7-2013 08:52 AM

Re: Very Expensive Typo
 
this reminds me of Toy Story 2
http://www.techdirt.com/articles/201...e-backup.shtml


All times are GMT -5. The time now is 08:45 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution