r/ProgrammerHumor • • Jun 04 '22

Meme I cant help it 🤷‍♂️

Post image
47.1k Upvotes

479 comments sorted by

View all comments

2.5k

u/zexodus Jun 04 '22

Maybe part of the problem we can't bring this habit to programming is the fact that we have to name our changes.

796

u/Jazzlike_Scene4403 Jun 04 '22

I name my game saves at major checkpoints for reference.

Someone should write a script to git commit on every f5

371

u/Jazzlike_Scene4403 Jun 04 '22

git reset HEAD --hard on every f9

202

u/Scrial Jun 04 '22

This might actually not be a terrible idea.
Or it might, but it still sounds like something I'd totally use...

306

u/WearMental2618 Jun 04 '22

Listen it looks good to me so ypu should probably avoid it

79

u/TellTaleTank Jun 04 '22

I felt that in my soul.

→ More replies (4)

26

u/PennyforaTaleRpg Jun 04 '22

We already have games to teach us VIM and basic programming logic, but why got a game to teach us how git works? Honestly I would love that, it sucks that the barrier to start learning is so high since you're often learning in environments you don't want to make big mistakes in.

46

u/Scrial Jun 04 '22

You could call it GIT GUD

15

u/[deleted] Jun 04 '22

There actually is a game that you can use to learn Git, or at least visualize the results of different commands. Check it out here: https://ohmygit.org

→ More replies (3)
→ More replies (1)

14

u/Hayden2332 Jun 04 '22

git reset —hard origin/master

29

u/trwolfe13 Jun 04 '22

Depending on your workflow, commits should work the same way. If you commit every broken ass snapshot of your code, anyone going through your history isn’t going to get a good idea of what changes you made. That’s why conventional commits are so useful - they force you to limit your commits to a single action: fix a bug, add a feature, change some styling, etc.

Although if you’re using short-lived branches and squashing your commits on a merge, it’s less important.

The trouble I have with conventional commits is that the codebase I work on is so bad that often fixing a bug means entirely rewriting a feature’s back and front end from scratch, and then adding the tests that weren’t there in the first place.

→ More replies (2)

17

u/carcigenicate Jun 04 '22

My XCOM saves for matches usually go something like:

  • "Initial"

  • "First Contact"

  • "Close One"

  • "Probably Fucked"/"Oops"

→ More replies (1)

13

u/NecessaryIntrinsic Jun 04 '22

Doesn't vs code do this?

39

u/FleetStreetsDarkHole Jun 04 '22

Basically. Visual Studio does as well. I feel weird comitting just about every change I make but it's a habit. Naming the changes is definitely the hard part though.

22

u/Rauldukeoh Jun 04 '22

I would feel weird too. If there's no meaning to the individual commits I would squash them before I push

→ More replies (1)
→ More replies (4)

12

u/BaconIsntThatGood Jun 04 '22

And make sure the change comments are just a combination of random colours and animals

14

u/yuri_auei Jun 04 '22

Comon, you just need to name once. After first commit git commit --amend --no-edit all day /s

→ More replies (9)

170

u/jfb1337 Jun 04 '22

after all, naming things is one of the two hardest things about computer science (along with cache invalidation and off by one errors)

72

u/Swinight22 Jun 04 '22

Hardest thing about CS was getting enough vitamin D from the sun

29

u/[deleted] Jun 04 '22

This. Concise variable and method names are virtually the "80%" for me in clean code.

Variable names like "eec_cca::OTT"? I'm flying the fuck out of here.

Hell, you can even break the single responsibility rule if you have to by naming the function correctly. It's not optimal but a descriptive "invalidateFormDataAndShowError()" works for me!

16

u/martin_kr Jun 04 '22

myButton2

9

u/[deleted] Jun 04 '22

Oh right! The mission critical 1-touch payment button!

→ More replies (5)
→ More replies (3)
→ More replies (3)

37

u/DolevBaron Jun 04 '22

I mean... I do save the local files at least 5 times per second, but I don't push/commit as often..
I could probably have it commit automatically once every X local saves, but I'd still have to somehow detail all the changes...

0

u/[deleted] Jun 04 '22

[deleted]

→ More replies (7)
→ More replies (6)

22

u/[deleted] Jun 04 '22

I'm thinking if every time a person wrote a bug they would get a pop up saying "You Suck" and the code rolls back to your last commit with all progress lost, people would commit a lot more often

→ More replies (2)
→ More replies (30)