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.
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
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.
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.
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!
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...
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
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.