That isn't something that can be measured if you consider the long term effects. The ends doesn't justify the means unless you are some kind of super accurate seer.
It isn't something that can be measured, but it is something that can be predicted.
I would argue you can reasonably predict how a situation is going to go down. If someone is running at you with a knife, you don't think to yourself "Maybe I'm misunderstanding the situation, and shouldn't assume they want to kill me", you could predict beyond reasonable doubt that they are planning to kill you.
Similarly, there are certain situations in which you can reasonably predict that theft will do more good than bad. Sure sometimes there are grey areas, but there are some situations where, if you look at the situation you can reasonably predict that theft would do more good than bad. For example: If someone is quite wealthy, it is reasonable to predict they wont miss one loaf of bread, and it is also reasonable to predict that a loaf of bread could help people in desperate need.
As for your point about long-term effects: Well technically speaking due to the butterfly effect, any action can have huge unnecessary consequences. Even a butterfly flapping it's wings. If we took the view that any consequences, no matter how distant and unimmediate they are, can be traced back to your actions, that would mean that we shouldn't be able to act at all since every single action would be completely world-changing.
Sure, it could be the case that if I steal a loaf of bread from a house, due to the butterfly effect the course of history could be changed forever, but it could also be the case that if I put a sock on the wrong foot it could have world-shattering consequences. We should try and look at the long-term consequences if able, but when they reach a point where any action could have devastating consequences, IMO it becomes reasonable to begin working with what you can know, and examining consequences which can be reasonably predict, rather than completely abandoning the ethical stance entirely.
Besides, IMO consequences are the best way to figure out morality. Sure there are flaws in this line of reasoning, but if we don't look at the consequences, we'd have to assume certain acts are evil in principle, which could very easily lead to easily avoidable situations in which everyone is worse off.
That loaf might be the one thing determining whether or not the shopkeeper makes enough for the month to feed his family. Or the homeless guy ends up stealing more and more after that because he got away with it the first time, affecting the shop's overall business.
That's why I specified "If more good is done than harm"
If one person stealing a loaf of bread to avoid starvation, and it leads a whole family in to starvation, then that wouldn't be a good thing.
My argument was, that if by stealing the bread more lives are saved, or more people have there basic needs met, than people who are deprived, that is in my mind a good act. If by stealing the loaf of bread more people are deprived than people who have basic needs met, in my mind that's an evil act.
Robbing someone's house deprives them of things they've earned money to buy.
That's assuming that there is something intrinsically good about having the things you earned.
An assumption I'd disagree with.
They too may be poor, but are able to just about feed themselves until said robber came along and stole something they desperately need.
I personally would argue that is more an issue with making a mistake in reasoning than it is a problem with consequentialist ethics.
No ethical theory will completely annihilate making mistakes. In that situation, the person making the decision to steal the loaf of bread, if they were considering consequences, clearly didn't look at all the variables, and as a result made a mistake in which the consequences were bad. That's not an issue with there ethics IMO so much as it is an issue of the person who stole the loaf of bread having some fault in there line of reasoning.