Some of the best programmers I know have mechanical engineering backgrounds!
I think reason being is that before, mechanical engineering was just purely, mechanical engineering, where as now the mechanical engineering degree (in my old uni anyway) was combined with mechatronic, which was robotics, and alot of low level process control type courses that for obvious reasons required alot of programming ... They basically fell under the same department