23

The short story of how I'm terminally retarded.

tldr: accidentally replaced good code with empty file.

So, it's 3 o'clock. I just came from school, after an exam. I'm tired. I decide to relax and continue coding kuronbka. It works very well. In about 30 minutes my headache is gone and I'm 100% dev mode. I've implemented a simple music track, a background and ground collision. All of that. So, seven hours later, I'm finally ready to go off to sleep.

What I am supposed to do:
1) Ctrl + S
2) Close VS Code
3) Edit todo file
4) Commit and push changes to GitHub.
Please note, this is done almost automatically. I don't watch what I'm doing.

What my dumbass does:
1) Ctrl+A
2) Space
3) Ctrl+S
4) Close VS Code
5) Commit and push changes to GitHub.
Once again, it's done automatically by me, in one go. I didn't check any code. 3 minutes later I see that ASM file is 0kb. Something is up. Check GitHub. File is empty. Shit. Desperately go to VS Code try to Ctrl+Z but unsurprisingly it doesn't work.

Thank you for reading and I suggest you leave your diagnosis down below.

Comments
  • 2
    this shit happens sometimes.

    I noticed though that the kuronbka code is all in one file. Can you have the code in more than one file?
  • 0
    @erandria you can't have the code in separate files, because that file is supposed to be written to the ROM chip on the cart
  • 2
  • 1
    I was about to propose a makefile that concatenated the files, but if that works that's better.
  • 2
    Jetbrains products keep a local history that allows you to keep track of those fuckups, perhaps an idea? 😛
  • 1
    @erandria I am aware of this but I have no clue how to use this whatsoever. Also I recovered the original file, good thing I keep backups everywhere
  • 1
    @alexbrooklyn im a broke boy, I can't pay for jetbrain tools
  • 1
    @dudeking is this commit the last one?
    https://github.com/dudeking/...
  • 0
    @erandria yes. All that was left from the 7 hours I spent is the capitalized letters all over
  • 0
    @dudeking I created this pull request to separate files and other stuff https://github.com/dudeking/...
  • 4
    @dudeking if you're still a student, you can get a free student license for all Jetbrains products (but you're not allowed to use them to develop commercial applications).
    Check their website
  • 1
    there is a "save local history" plugin for VCS, not using it yet, but it saved my ass a lot of times in Eclipse
  • 0
    What launguage is that? If you compile that code then the number of files dosent matter cuz some launguages have "partial" class support, they look for all parts of your class and pack it to one file.
    I know C# has it, but for embedded i think you use C or C++, no idea if they have simar features but im sure you can put some of your functions in a separate file.
  • 2
    @Gregozor2121 it is 6502 assembly, and @erandria actually spent his time seperating, but I have no idea how he did it yet. I'll come back from school and look into how it was done.
  • 1
    @erandria thanks a lot for the help, I've figured it out!
  • 1
    @dudeking haha, thanks for the ++
Add Comment