Money doesn't always attract people to a job. The purpose of good pay is to keep people from leaving! Nothing will destroy a code base like having its original designers leave; there has to be someone who can answer questions quickly.
I've never known the salary for a job at the time I applied. I'm not even sure I had a ballpark. It does come up in interviews, since companies tend to want to know what you're expecting. But why should I care? That's what an offer is: if I don't like the offer, I don't have to accept.
To attract good talent, you have to put your requirements right into your job posting. Ask for proof of work on open-source projects, for example; things that are hard to fake. A candidate that feels daunted by your application won't even make it to the interview.
If you know ahead of time they're only interviewing for a position that tops out at $35k and you don't want anything less than $60k, it's better to not waste everyone's time.
If they're surprised that I expect more than they were planning to offer, they might also ask themselves why the difference would be so drastic. Maybe they compare their experience interviewing me, with others who seemed to want less, and make a connection. Or maybe that's wishful thinking. :)
I think it's wishful thinking. Most companies (large and small) I've worked at or known about (via friends) have ranges for particular positions. It doesn't really matter what you want if you're vastly outside of what they've been allocated to pay. Yes, occasionally orgs will bend the position to fit you and modify pay accordingly, but it's rare enough to be the 'exception that proves the rule' when it does happen.
I've never known the salary for a job at the time I applied. I'm not even sure I had a ballpark. It does come up in interviews, since companies tend to want to know what you're expecting. But why should I care? That's what an offer is: if I don't like the offer, I don't have to accept.
To attract good talent, you have to put your requirements right into your job posting. Ask for proof of work on open-source projects, for example; things that are hard to fake. A candidate that feels daunted by your application won't even make it to the interview.