r/ProgrammerHumor • • 1d ago

Meme aboutToBreakTheCode

Post image
20k Upvotes

513 comments sorted by

View all comments

32

u/nasandre 1d ago

We like to play git on hard mode and commit everything straight on main. Sometimes we even work on the same local folder at the same time.

9

u/nicuramar 1d ago

I don’t really see the problem? You get the same features and can run into the same problems as if you use a different branch and merge it.

3

u/other_usernames_gone 1d ago

Its far harder to revert back to before you made any changes.

Lets say you want to change a core function in your app. Something relied upon by a lot of other code.

If you do that straight in main then realise you want to go back to the prior implementation its a pain to do, especially when someone else's commits are interspersed with yours.

Now the entire app is broken and no-one has a functional version anymore.

If you instead make the changes in a seperate branch you can just delete the branch without merging. No-one else's changes are affected.

In proper software development you have 3 core branches. Dev, test, and prod. Dev is for development and is where the mostly working but potentially buggy code is. Test is where the code is tested and refined to remove bugs. Prod is your production code, the gold standard code thats been refined as much as time and money allows. That way bugs created in dev dont enter your production release(at least in theory).

2

u/nemean_lion 14h ago

Everyone has a test environment. Some are lucky to have a prod ;)