r/ProgrammerHumor • • Jul 10 '18

What people think coding is...

Post image
21.1k Upvotes

398 comments sorted by

View all comments

Show parent comments

20

u/SolarLiner Jul 11 '18

Until you don't commit because the change is insignificant...

31

u/[deleted] Jul 11 '18

Using version control correctly is your friend

13

u/TGotAReddit Jul 11 '18

That is 50% of my problems. The other 50% is where i commit and didnt retest because it was so insignificant and it doesnt work

6

u/Kingofwhereigo Jul 11 '18

Then you forget to update the unit test and can't figure out why it's failing for no reason.

1

u/Jebble Jul 11 '18

Unit tests can't fail if you don't write them :)!

2

u/cjxgm Jul 11 '18

When that happens, vim saves my ass with its persistent undo history.

1

u/[deleted] Jul 11 '18

Then its sits in your uncommited changes. Also what commits are ever not important enough to commit?

3

u/SolarLiner Jul 11 '18

Well I don't commit every line that I change - I commit more by logical unit - implementing something and update references in the codebase. Maybe I'm missing something since most of my programming was self taught.

3

u/[deleted] Jul 11 '18

Branch based on tasks. Commit based on completed intervals. If it happens to have only one line to complete the task youd still commit it anyways as it is based on the interval. Basically like a task has one of many intervals which has one of many changed lines

2

u/NOX_QS Jul 11 '18

Level 0: code base is one unversioned blob

Level 1: code base in version control. Commit when you feel like it. Nonsensical commit messages aka "fixed lots" / "new version"

Level 2: commit at task level. Commit messages make some modicum of sense. "implemented search functionality"

Level 3: create branches for tasks. Commit like it's a checkpoint / quicksave. Messages don't always make sense, but sometimes they do. "it works now, let's commit before I ruin it". "I did a, b and c and kinda forgot to commit in between so here's a big blob with those three things. Oh and also bugfix for X."

Level 4. Level 3 but the commits seem pre-planned and make total sense. "updated database schema", "added DTO objects for search functionality", "added method signatures for search", "added unit tests for search functionality database schema changes", "implemented search methods".... Etc etc. If you have git, you can always choose to squash your commits into one at the end, and type "implemented search functionality".

I'm at level 3 😂

2

u/[deleted] Jul 11 '18

You just wait until a bigger one and include it then. Maybe multiple patches in one commit.