I wish folk would stop going on about the swearing and berating - it happens. All tennis players do it. People are taken it WAY TOO FAR. Andy is only human.
No John, didn't you realise, he's supposed to be a good little boy, keep his mouth zipped and thank Raonic for beating him, whilst shaking him warmly by the hand. I'd be inclined to shake him warmly by the throat, but there we are.
I get the argument about the effect on an opponent, but I think some understanding should come in to it as well, and frankly I couldn't care less about people watching with their kids, all that. Andy isn't there to parent other people's kids. Andy lost the first set. He worked to get back in to it, taking the second on a tie-break. He then had match points and lost them. Add in him being tired, and clearly expecting better of himself, he got frustrated. He smashed a racquet. It happens. He swore a bit. Big deal. If he'd smashed the racquet over Raonic's head, or sworn at him or an official, people might have cause to be annoyed, but he didn't.
For the record, I don't think Lendl being there would have made any difference today. It might have made Andy feel worse to be honest. As for it being better if he'd lost in straight sets, sure, a drubbing by an upstart would have made him feel great about himself going in to Shanghai. As it is, there is no shame. He fought. He lost. Now he moves on.