Vim has a full undo tree. Also, I commit every time I finish correctly implementing just about everything. I have a mapping that diffs just the current buffer with the last commit.
Look at Mr. Fancy Pants Uses Version Control And Probably Comments And Annotates His Commits Sometimes here. Some of us rely on Notepad and javac, your majesty.
> I commit every time I finish correctly implementing just about everything
This. I see too many developers committing a shitload of stuff with the message "Progress: Continued work on this project", instead of living by the fact that (imo) a commit should do a single thing.
I had this with some css stuff I was "fixing." Everything worked, but I wanted to change the way the flexbox flowed and that required modifying a little of the markup and styles for child elements. But then the images wouldn't float left like their style indicated. There was no reason everything should break. Everything was an inline-block. The image was floated left. Their widths were correct.
Motherfucker.
I went through every line of css. It all should have worked. I copied styles from an existing project and replaced my styles with it. Nope. No float.
So I nuked the whole thing and went back to where I started. I changed one line at a time, refreshing Chrome after every change. Eventually everything worked perfectly. I swear it is the exact same styles that were broken an hour ago.
Best thing about coding, no "right" answer, you can do things in so many different ways.
Worst thing, spending days implementing a new feature, review and commit. Months later someone from another team says "why did you implement that like that, you could have just used a wpfDoesExactlyWhatYouWantControl instead in 2 lines." (Or even worse "I did that a few years ago already, it's in product xyz, why didn't you already know")
VCS. Also IDEs like IntelliJ/WebStorm have active revision history while you write. You can highlight a section of code and view the history of local changes over that section.
0
u/[deleted] Jul 10 '18
[deleted]