In one of his most interesting and direct answers in the February 26, 2009 discussion of various user questions, Google software engineer Matt Cutts answers a question from a user in Madrid, Spain.

Do ids in heading tags affect search engines? – 
The Spanish questioner was concerned that proper html tagging of her headers could possibly lead to Google dinging the page as a result. In this case, Matt was willing to go into detail to a little greater degree than he had in some of his other answers in the series.

What he had to say was that Google was not in the business of awarding style points for how concise or sloppy one’s underlying code was. The algorithms are apparently able to distinguish such things as ID tags in the headers and discount them as being of no consequence one way or the other.

His advice was basically to write clean code that will aid you in the future when it comes time to upgrade or redesign the page and not to worry about offending Google in any way. The talk also touched briefly on several new refinements to the search engine that allowed it to refine its searches for images by such things as image size. All things considered, the topic of header ID tags was interesting and enlightening. This topic was easily the most straightforward look into the mind of Google.