Thanks for all the replies and suggestions. Here is a brief summary of the key points so far:
1. Have an energizing, challenging, job description (basically an inspiring mission) where creating great software is valued as an asset.
2. Flexibility about IDEs, coding tools, etc.
3. Mangers who understand and value software.