Personally, the best practice is to not care.
Yep, I used to spend ages making sure that my HTML code looked tidy when being output by PHP.
With Firebug etc. I don't see the point anymore - there is very few times I just 'view source' now when looking for a problem.