The myth of 'humane killing' is a popular one., as it assuages the guilt people feel for taking someone's life that was never theirs to take.
People have different ideas about what is 'humane'. Many people think that a 'quick blow to the head' to render an animal unconscious before the final act of killing is humane, but I've seen far, far too many instances where this goes wrong and animals are left thrashing around in agony with horrific head injuries.
In Islam, Halal slaughter is considered humane. Even if you ignore the big so-called 'Halal' abattoirs that completely ignore the rules set out in the religion, and focus on individuals, it doesn't matter how nicely you talk to the animal before hand, how you stroke their head or whether you hide the knife so they don't see it coming, from the moment their throat is cut til the moment of their death (what must feel like an eternity later) all they know is pain, terror, suffering and betrayal.
And how many animals are actually killed on the farm? Even the most well-cared-for pigs are still sent off to the same slaughterhouse as all the other pigs, where the standard practice is lowering them into a gas chamber filled with CO2 which burns them from the inside out. Footage from inside the gas chambers has revealed they thrash around, screaming in agony, for up to two minutes or more before losing consciousness.
And that's just the killing itself.
You mentioned dairy farms. Like humans and every other mammal, cows must be made pregnant to produce milk - it's food for their babies. On dairy farms, calves are taken from their mothers so humans can drink the milk which is their birthright. Just as in humans, the maternal bond is extremely strong and cows often cry out for days for their stolen children.
But to get to the real crux of the matter, let me ask you just one question.
Imagine I want something from you that is yours but I didn't want to cause you any suffering. So I quietly creep up behind you and shoot you in the back of the head. You don't see it coming. There's no suffering. One moment you're happy and content, reading a Medium article by your favourite author, the next moment you're dead, with no knowledge at all of the event. My question to you is: have I acted ethically in that situation?