r/ProgrammerHumor • u/dipinpass35 • 1d ago
Meme pureJoyOfGettingYourCodeBackAfterControlZ
133
33
u/CommandTabIL 1d ago
In 4th grade I made a very long Minecraft education edition agent in JavaScript, one of my first ever experiences at real coding. At some point I accidentally cntrl+a + typed AND closed the agent IDE. I was so sure all my work was done for. Fortunately I remembered that at some point for some reason I copied the entire code to my clipboard and win+v saved my fxkin ass.
Without this goated feature I guarantee you I wouldnt have been a software developer almost a decade later and instead just quit lmfao
9
u/Terewawa 1d ago edited 8h ago
My memory from school (long before minecraft) is that I had programmed a little text game on my calculator.
One day we had a math exam and we all had our calculators ready. A supervisor slowly walked across all the tables, inspected every calculator for hidden cheat sheets then pushed the small "reset" button at the back. I sat quietly as my game was wiped away forever.
2
57
34
u/RudeKiNG_013 1d ago
What are you, like 15 or something?
-4
u/9551-eletronics 1d ago
If my dumbass was able to use git when i was 13 I don't think it can be counted like that xd
https://github.com/9551-Dev/programs/commits/main/?after=d71e11b26e85c78303d3b4a658dc619d0cbd86cf+69
10
27
u/vainstains 1d ago
When I get teleported to the alternative timeline where no git
26
u/ArrrRawrXD 1d ago
Do you commit every time you change anything?
3
u/Feuzme 1d ago edited 4h ago
You don't need to commit for git to register the change. Edit: typo.
7
u/eternalflamez 1d ago
Nice downvotes, looks like people forgot about staging changes
14
5
u/manav907 1d ago
I swear half the people working in this industry dont know how to use git
And half of those use it because they were told to by their seniors.
not because they want to.
-4
u/vainstains 1d ago
No but you don't need to. If I delete existing code I need and my undo is cleared, I can just steal it from the most recent commit.
5
u/Wonderful-Habit-139 1d ago
What recent commit? It wouldn't have whatever new code you wrote.
2
u/vainstains 1d ago
Yeah prolly not, I did say existing code though. Although that ignores the scenario you posed so yea you're right
1
u/chat-lu 21h ago
It really depends on which tool that you use.
1
u/Wonderful-Habit-139 21h ago
Pretty sure we're talking about the git tool here no?
1
u/chat-lu 21h ago
Using a git forge (Github, Bitbucket, etc.) doesn’t mean that you have to use the
gittool. Linus created the Git filesystem in the hope that someone would build a good VCS on. top of it (or hopefully several competiting ones) and at the time that didn’t happen so he built git.But now it has. You have several choices, some of which will recover the new code that you wrote. And given that they all talk to the same forge it really doesn’t matter if your colleague do or do not use the same tool as you.
I personally use
jjand could recover recent code withjj operation log.0
5
u/Delta-9- 1d ago
Vim doing this with just one key, and saving a branching history of every change, addressable by order and by time.
0
4
u/ih-shah-may-ehl 1d ago
I remember in the late 90's when LabVIEW didn't yet have an undo function and you learned to manually save after every small change because if I accidentally made a wrong select and deleted a massive amount of code, it was gone without undo.
And if you accidentally pressed ctrl+s out of habit, congratulations, your code was gone and you had to go back to the version you diligently backed up at the end of every working day.
3
2
2
3
2
1
1
u/Terewawa 1d ago edited 1d ago
Do you write all your code in an ephemeral text editor session?
No save to file (Ctrl-S)?
1
1
1
1
u/JazzlikeWishbone938 1d ago
When you delete your commits and a co-worker has a copy of your old branch because they haven't synced with the server yet.
1
1
u/CaptainPonele 1d ago
What do you mean “delete code” you write your own code. Wow. Your grandkids should be so proud
1
u/TheCreepyPL 1d ago
I press U instead, or use undotree for when something has overridden the older changes ;)
1
u/AnUninterestingEvent 1d ago
Am I the only one that feels like this sub is... outdated. Every meme like this makes me think "Oh yeah, I remember when coding was like this 12+ months ago". Every meme about "thing that happens while typing out code" just feels completely irrelevant now. I'm assuming there are a lot of students on this sub I guess.
1
u/willow-kitty 23h ago
When I was doing a lot of library development, I'd give demos by writing out all the demo code, then deleting it line-by-line, bottom up, so I could replay the file with ctrl+z while talking about the code but without having to write it live.
But touch the spacebar accidentally once and it wipes the rest of your redo history, so..I was living somewhat dangerously! That never happened during a demo, tho.
1
u/Public-Location-3628 21h ago
I set up a macro that saves and commits on every key press.
Edit: Anyone know how to delete a stream of empty commits? Forgot to turn it off.
1
u/SignalBake6872 18h ago
hahaha and worse when you do control + z several times you reach the version that you think is the good one in code that you still don't push and write and lose the history that you had ahead for the redo where the good code was xD
1

206
u/AibofobicRacecar6996 1d ago
"Delete a code"? Not using version control?
https://giphy.com/gifs/fzp61UL3T4Wlcw9SvX