this post was submitted on 30 Dec 2023
58 points (80.9% liked)

Programmer Humor

19817 readers
623 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 13 comments
sorted by: hot top controversial new old
[–] [email protected] 33 points 1 year ago* (last edited 1 year ago) (2 children)

Become a professional, then you'll commit every time you make a small bit of functionality. If you're doing massive changes like this, you haven't broken something after multiple days of code enough. When you do that and you have no idea what you broke it with and when, it conditions you towards small iterable chunks.

[–] [email protected] 7 points 1 year ago

This. Instead of making commits time-based (for example once per hour or once per day), make them purpose-based (say, add a database migration in one commit, and change the color of a button in another one). This also makes it easy to cherry-pick or otherwise backport specific changes to different program versions gor example.

[–] [email protected] 3 points 11 months ago (1 children)

I learned this the hard way, I forgot to commit for a single day and got burned really bad when my regression tests failed and I could not trace the issue(it is called source control for a reason). I declared it was more efficient to revert back to the last commit than spend time fixing broken code that I had no fucking clue where it was and the only thing I had to go by was that it happened between two commits with a whole work day between.

[–] [email protected] 1 points 11 months ago

I work a lot with the local history of the IDE, where I can also set labels to a current state. In addition, it creates its own labels like last time all tests were green etc.

Still, in one of my last project that really lived TDD, they made a good point that I should just push as often as I label, since that also triggers all sorts of other tests which I usually don't run locally, or not as often.

I had "rearrange code" checked once for a commit, and fortunately, it had automatically saved the exact state before that.

[–] [email protected] 20 points 1 year ago (2 children)
[–] [email protected] 2 points 1 year ago (1 children)

More specifically, what's the connection to Reddit?

[–] [email protected] 1 points 11 months ago

This

The hyperlink was in the title, that's why I couldn't see it from my client

[–] [email protected] 0 points 1 year ago* (last edited 1 year ago) (1 children)

The image is from a reddit post. You can click on the link to read it if you want.

(Weird, I remember kbin rendering it as an embed...)

[–] [email protected] 1 points 11 months ago

Ah, I get it now, so it's this https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2Fb0htg42kv89c1.png

That's way too slanderous, lol

[–] [email protected] 12 points 1 year ago (2 children)

Me when I don't know at how many changes I should commit (the previous commit changed 2 characters):

[–] [email protected] 3 points 1 year ago

For real, or when you should make the first and second commit.
Or worse, when you're too focused and start making a ton of changes, then you realize you haven't committed anything. Discovering I can stage ranges has made me fall for this way too many times, because I think I'll easily just go back and extract one atomic change at a time later (spoiler: it won't be easy ( ; ´ Д `))

[–] [email protected] 2 points 11 months ago

as soon as you realize you can't easily contain your commit message within a 50-character conventional message (or slightly more if you wand to be more specific about the scope)

[–] [email protected] 1 points 11 months ago

When you go to merge master into your feature branch but accidentally squash master in.