Although based in the UK I used to do a fair amount of work in Milan - why would you avoid it? I thought it was a pretty nice place, although even when I dressed smartly I still felt pretty scruffy compared to most of the locals. :-)
It's relatively expensive, big, crowded and polluted, and yet wages are still not that high for programmers. I like living in Italy, but if I wanted a big city, I'd rather go back to the US where I'd make more money in a place like San Francisco, which is a nicer city than Milan.
My opinion is that you get a good mix of "things going on" and "Italian lifestyle" in the mid-sized northern/central towns like Padova, Pavia, Verona, Trieste, Bologna, Firenze, and so on. But that's just my bias in life...
As an Italian currently living in Milan and planning my escape, I agree. Also, as a southerner, I recommend you avoid South Italy, because there is less support for entrepreneurs.