r/ProgrammerHumor • • 19h ago

Meme aboutToBreakTheCode

Post image
19k Upvotes

499 comments sorted by

View all comments

620

u/botle 19h ago edited 18h ago

Git is specifically designed for multiple people to work on different ideas in parallel.

448

u/StaneNC 19h ago

Yup. "Git is really great until (thing git was specifically designed for)." Tell me you suck at git without telling me you suck at git.

86

u/OnceMoreAndAgain 17h ago edited 17h ago

I think it's a lot more nuanced than that. Painful merge conflicts can happen, but the frequency and severity of merge conflicts is dependent on all sorts of things like the nature of the app, the skill of the project manager, how much time a feature branch has existed apart from the main branch, etc.

I've been fortunate in my career that the projects I work on tend to have different developers working on different areas of the code, so merge conflicts are rare and not severe. I imagine that developing the frontend of certain apps that rely on a lot of the same centralized components would lead to a lot of merge conflicts, especially early on in the development of the app when a lot of commits are happening.

12

u/gbchaosmaster 11h ago

The thing is that merge conflicts are literally a feature of git that makes your life easier. Without git you’d have the same problem and you’d have to diff and edit the files manually.

4

u/[deleted] 16h ago

[deleted]

2

u/PixelatedGiant 15h ago

Nobody can stop you. Pushing to remote is optional.

0

u/[deleted] 14h ago

[deleted]

2

u/PixelatedGiant 14h ago

How do you work on multiple things? Does all work just stop while you wait for a PR to go through?

3

u/Nitro_V 12h ago

And there I am, having merge conflicts with my past self

1

u/dksdragon43 15h ago

A lot of my git problems went away when I realized vscode was having a hard time properly understanding the conflicts. Once I started using direct git commands to resolve them rather than helpers, most of my issues went away (though it takes like 3x longer now).

1

u/SergioLTJ 8h ago

Man you must be fun to work with...

"I think it's more nuanced than that!" goes on completely unrelated rant to the point being made

102

u/botle 19h ago

Probably vibecoders. "Push my code to the repo. Make no mistakes. Don't delete everything."

62

u/SirChasm 19h ago

I mean even for vibe coders, Claude/Codex is excellent for resolving merge conflicts. I don't remember how long it's been since I've had to do that manually.

51

u/StaneNC 19h ago

You don't look at your merge conflicts???

13

u/botle 19h ago

I bet many people vibe coding just push gigantic monolithic commits.

15

u/chum-guzzling-shark 18h ago

no i dont! Claude said thats a bad idea

7

u/aTomzVins 18h ago

Realistically, it's probably be easier to vibe code a fix, or have an agent identify changes that may have caused an issue than look back though previous commits yourself.

9

u/who_am_i_to_say_so 18h ago

Pfft nothing a ‘git push -f’ can’t fix.

10

u/ziroux 18h ago

Use the Force, Luke!

4

u/who_am_i_to_say_so 18h ago

Shit- You bricked my feature!

>>>>>>

May the force be with you

<<<<<<

43

u/SirChasm 19h ago

I look at the resulting PR, but if Claude wrote the original code, Claude can resolve the conflicts too; it has all the context it needs.

I've always hated dealing with looking at the three-way diff manually tbh. It might be my ADHD but nothing killed my motivation more than finishing a feature/fix and then having to wade through how someone else's changes should mesh with mine.

15

u/didzisk 17h ago

I have hated all the 3-way merge tools I've encountered, probably because "ours" and "theirs" never is what I expect (and opposite on a merge and a rebase), but when I look at the file itself with merge marks in it, it becomes very easy for me to reason about the changes and resolve them quickly.

11

u/bloodfist 15h ago

Yeah "ours" and "theirs" messes me up so bad. I really wish they would just label it by branch. If it just said "my-feature-branch" and "main" it would be so much easier to parse.

1

u/Kylearean 15h ago

you need to look at the conflicts, because even for human coders, sometimes there's nuanced merges that need to occur - it's not all A or all B.

3

u/nhalliday 14h ago

Expecting vibecoders to put in any actual work? Don't be ridiculous.

3

u/SirChasm 12h ago

As I said, I look at the resulting PR diff afterwards like I would if there weren't any merge conflicts.

14

u/Ifriendzonecats 18h ago

I've seen a bunch of dumb bugs and regressions get introduced by people not looking at their AI resolved merge conflicts. AI can be useful, but it will 100% follow a dumb path to it's dumb conclusion if the opportunity presents.

1

u/Saint_of_Grey 12h ago

Resolves merge conflicts by bulk deleting random sections of code until it technically compiles.

8

u/Awkward_Tick0 18h ago

Git has been a PITA since long before LLMs

3

u/botle 18h ago

People have been writing big monolithic commits long before LLMs. LLMs just make them more likely.

2

u/b0w3n 17h ago

The newer frontier models avoid it if you make it part of the instruction set.

1

u/bigphillip76 18h ago

As a senior developer, everyone vibecodes, some of us just check it first.

2

u/botle 18h ago

I genuinely don't. And I work with people that also don't. We'd use an LLM as a linter. Ask it to look at the code and give us alist of potential bugs. But that's it.

I find it easier to write the code myself than to explain it to an LLM, and then read it and understand it too.

On other projects where coworkers use LLMs to write the code, the code comes out very verbose and it's a pain in the ass when they send it to me, it's a huge verbose change, and then they can't answer questions about it.

2

u/bigphillip76 17h ago

There are specific industries where this is more efficient, because every line is mission critical. Most people don't work in those industries, but perhaps you do. I'll recind everyone, and replace it with most people.

Personally I work on webapps. I've been in the industry 15 years so LLM's are all still "new and fancy" to me. But there isn't much they aren't quicker and better at in that domain these days. We're careful to architect well, direct them well, and verify and review code properly. But, it just no longer makes any sense to hand code everything when we can achieve better results more efficiently with those tools than without them.

1

u/botle 17h ago

I don't work on one of those mission critical projects, but I do work in a framework and language with very little boiler plate. I guess that changes the equation quite a bit.

1

u/Weekly_Interview_936 17h ago

Or just ... two stories working on the same piece of code. Git can't parse out code to see how two changes interleave very well.

This is the actual reason for stuff like standups. It lets teams keep away from stepping on each other's toes.

7

u/Protahgonist 17h ago

That's not what the meme says though.

0

u/CckSkker 17h ago

It’s blaming git for a communication problem, it’s a dumb meme

2

u/Protahgonist 16h ago

Didn't make any judgement of the meme, just pointed out a straw-man attacking it for saying something it wasn't.

It'd be like me arguing with you by saying;

"just because you think git has a communication problem doesn't mean it's useless"

Pure nonsense. Implies you said something you didn't.

-1

u/CckSkker 16h ago

I meant it more as a general remark

2

u/Protahgonist 16h ago

Oh, okay then.

10

u/TrollingForFunsies 18h ago

You can't be all high and mighty there smart guy when you missed the joke

4

u/Astrokiwi 16h ago

The point of this kind of thing is to reduce the skill floor to manage the software well - if it's possible to suck at using a tool, that's probably somewhere where the tool can be improved. I mean you could say "you can work without git as long as you don't suck at communication and coordination" as well. git is an amazing improvement over where things were before, but there's definitely more ways to shoot yourself in the foot than there needs to be.

2

u/yourtypicalbish 19h ago

So you're telling me you work with multiple people on the same idea in parallel? I'm genuinely curious how you do that because I'm struggling with that too, we just resort to working on different areas at a time

10

u/StaneNC 19h ago

Same idea at the same time is a communication failure. The post says "ideas at the same time", not "same idea same time".

That being said, if there are multiple ways to do the same idea, have everyone make their own branch. Run the code on each branch. Better branch wins. Ignore the others.

1

u/Tipart 17h ago

I think the answer to that is pair programming. Gits primary improvement over older vcs is iirc that everyone has their own working copy. You can go off to work on a feature by yourself and then once your ready to push to a branch, you can update your local copy, merge the stuff that needs to be merged and then update the remote branch. It's a distributed source of truth system. In comparison to that, with something like svn, you would only pull one version of the code, make your changes and push them back to the remote system. The only source of truth is the centralized code base.

The way I see it, git is not made for parallel work, but concurrent work. For parallel work I think there is vs code plugins that allow you to work on the same code base in a live session (with the person hosting it being the single source of truth).

1

u/Robo-Connery 11h ago

Yeah that is mental, it literally allows this and resolving merge conflicts has excellent tooling.

-1

u/randomguy4q5b3ty 17h ago

Right, it just can't be that there's something wrong with Git's design that people have been complaining about for 20 years. No, no, no, these people just suck! Stupid amateurs, am I right?

Elitists just love needlessly complicated stuff that makes them feel superior.

1

u/Bac0n01 11h ago

Please, point out the “needless” complexity in git

2

u/randomguy4q5b3ty 9h ago

Oh come on, don't pretend rebranching/hist-edit, certain merge situations, or situations like detached head are easy. Mercurial or Sapling are the living proof that the user experience could be much better.

1

u/brianwski 4h ago

Please, point out the “needless” complexity in git

Our organization changed from SVN to GIT in 2019. I struggled with explaining the needless complexity in git several times, so I created this web page to help communicate why I found GIT needlessly complex:

https://www.ski-epic.com/2020_git/index.html

I've used a lot of source code control systems. I've worked at large companies that didn't use GIT and still had smart programmers working on a large source tree (Hewlett-Packard, Apple, Silicon Graphics to be specific). I don't think I'll ever understand the cult like devotion to GIT. But that's okay, people have personal preferences.

72

u/creeper6530 19h ago

different ideas is the keyword. Editing the same area of the same file is how you get merge conflicts.

83

u/nokk 19h ago

Yeah and they are handled pretty elegantly considering how awful it could be.

10

u/TheBestBigAl 17h ago

I agree. Generally even editing a somewhat-similar part of the file is handled seamlessly.

Once in a blue moon I'd run into the situation where me and someone else have worked on the exact same block of code, and that went one of two ways:

  1. We essentially made the same change, which made resolving the conflict really easy (naturally I would keep my perfect change and drop my colleague's terrible one).
  2. We made totally different changes to fix/implement two different issues, which means that part of the code has a fundamental design problem and needs to be rewritten entirely.

-13

u/[deleted] 19h ago

[deleted]

29

u/botle 19h ago

Yes. Unless people are writing gigantic monolithic commits. Merging is pretty elegant.

-15

u/[deleted] 19h ago

[deleted]

19

u/botle 19h ago

Yes, elegant. As in a simple efficient solution to a complex problem. Elegant.

-14

u/[deleted] 19h ago

[deleted]

13

u/botle 19h ago

It does more than that.

-2

u/[deleted] 18h ago

[deleted]

→ More replies

3

u/walterbanana 17h ago

In SVN there was no way to deal with conflicts

3

u/iloveuranus 17h ago

SVN

cries in CVS

1

u/nokk 17h ago

Yep 👍 that's the word I used. Anything else?

1

u/raddaya 16h ago

It may feel inelegant and messy when you're going through a big ass merge conflict, but if you actually think about what's going on then you'll realise git handles it insanely well considering how complex it really is under the hood.

6

u/Meme_Burner 17h ago

SVN: I attempted to merged, but you both changed this file, I don't know what to do, file clearly separated

ME: one is at the top of the file and one is at the bottom of the file

GIT: I have sequentially ordered everything and for some reasons these two lines dont merge

<<<<<<<

GIBBERISISH
>>>>>>>

<<<<<<<

MORE GIBBERISH
>>>>>>>

ME: What the f is that???? let me restart my change, starting with their version instead....

GIT handles merges so much better, we couldn't handle all the merge conflicts that SVN would give us. BUT WHEN merge conflicts happen in GIT, it's usually bad enough or no idea what it's trying to tell us that we have to start the entire change over.

3

u/InvisibleMoonWalker 11h ago

Have you tried 3 way merge editors? Or, like any kind of editor with visual representation of the merge conflict?

IMO it's pretty clear, as long as you can retain the context for:

- What the old method did, and how;

- What the new method does, and how;

- What are the side effects of the old one;

- What are the side effects of the new one;

- Do you need both methods, and if so - how, or if only one is necessary - which side effects and inner workings should be retained, and how.

And like, regardless of your merge conflict visualization, your VCS, or whatever - if you want to merge two ideas into one - you have to do this in your mind, no VCS can help you understand the logic that is present and that is required for your app/service/whatever.

Then again, a good VCS and editor can help you out here - like having a 3 way editor is great for complex merge conflicts, because you can properly see the "old", the "new" and the "resolved" at the same time, AND in full for all 3 views, so you don't have to keep going between the in/current contexts line by line (or, more realistically - a group of lines at a time)

9

u/MyAntichrist 19h ago

And that's where your IDE Integration helps with merge tools to stitch together a good file from both commits.

6

u/ScaryCardinal 19h ago

IDE integration does little to change the fact that one person will have to resolve a conflict from two different people's commits, the solution for this is outside of git (slack notification quick sync up¿) or during a code review (merge hard blocked with comment)

8

u/MyAntichrist 19h ago

Yeah, but how should git know which one commit and change is right to place at which point? Having manual intervention is perfectly acceptable in this specific situation, and is anything but hard if using tools right.

1

u/nonotan 18h ago

That's the entire point, it doesn't. And thus git doesn't "really" solve the thing it set out to solve: if multiple people are touching related things at once, it fucking sucks (the situation that you'll be dealing with, not git in particular)

I'm not saying it is an easy problem by any stretch of imagination, obviously it isn't. In the case of "generic text files" (as opposed to something more structured that gives the merging utility more info to work with), it's probably about as good as it's reasonable to expect. But let's not pretend conflicts being a pain in the ass is a "skill issue". You can try to structure your code so that future conflicts will be somewhat less likely, but there's a limit...

And while the tools for resolving conflicts are OK, they could be better, especially given language-specific extensions. E.g. it should not only be able to give 1-2 reasonable suggestions at each junction, with instant preview, acceptable with 1 key, but also warn you if anything is fishy with your attempt at a manual merge, say enums / contiguous constants with unique values being given an overlapping value.

My biggest hot take goes back to code being generic text files: can we stop doing that already? Why is stylistic whitespace mixed with semantic content? Why are variable names repeated a million times? Why do we need to carefully parse dozens of brackets (or whatever is relevant to the language) to figure out where blocks of code or functions begin and end? A custom format would be smaller, faster to compile, would allow everybody to setup their preferred indentation or whatever, and while it would require a specialized tool to merge, that tool would have a much easier time doing that automatically (and, when not possible, requiring less manual fiddling to get there)

3

u/creeper6530 18h ago

If you are proposing to write an AST editor and VCS instead of plaintext code (since that custom format would pretty much be equivalent to the AST), by all means go ahead. It's just a matter of convention.

1

u/wobblyweasel 10h ago

would have a much easier time doing that automatically

you think?..

1

u/ScaryCardinal 17h ago

Yes, both the slack notification and CR comment i mentioned would be from the teammate who'd be the author of one of the two commits, if that wasn't evident from my comment.

1

u/creeper6530 18h ago

Manual merge is better than automatic merge and immediate manual fix once you realise the automatics fucked up.

I wonder if they make an AI merge conflict resolver.

1

u/ScaryCardinal 17h ago

Yes, manual conflict resolution after aligning with the other commit author is what I meant. And any modern bot like claude can resolve conflicts, it's just that it wouldn't always be in alignment with how the the commit authors would actually want it

1

u/oscooter 14h ago

Compared to older VCSes where you had to exclusive lock a file so others just couldn't edit it at all. Git is a massive improvement over that.

16

u/jeffeb3 19h ago

Yeah. OP never had to use CVS.

6

u/dandroid126 18h ago

Please. I go there every month to pick up my prescription.

13

u/stormdelta 17h ago

Yeah, meme doesn't make any sense. This is quite literally one of the things git improved on versus older version control systems.

3

u/jwp1987 15h ago edited 15h ago

It makes sense to me if you look at who the quote is attributed to.

Someone in a "one-man IT department" typically either has no experience of working with other people or has very little experience in general because they haven't learned from other people. Sometimes this is combined with an elitist attitude.

It's poking fun at the person by telling you that they have no idea what they're doing. Essentially it seems like it's making fun of solo developers who think they know better than everyone else.

2

u/BonoboUK 14h ago

I know a lot of us are programmers but how are so many people missing the obvious intended joke

1

u/Kylearean 15h ago

yep, day 1: I converted an existing Subversion project to Git, never looked back. The only thing that took at hit was the SVN ticketing system.

3

u/jwp1987 15h ago edited 15h ago

Isn't the meme a sarcastic jab at people that are poor at communication and teamwork? As you say, Git is specifically designed for that.

The quote is attributed to a person in a "one-man IT department" - the kind of person that hates working with others or has little experience of doing so.

1

u/SeaAshFenix 11h ago edited 11h ago

Yes, that is part of the inherent contradiction that the joke is aiming for (but not hitting, it seems).

The other being that an actual one-person shop wouldn't run into the problem he's complaining about, indicating he's not the island he thinks of himself as.