We publish our salary ranges, but the ranges are large - and I think this comes down to different ways people hire in tech. Big corporates say - we want a person @ £80k pay grade and expect them to have XYZ experience. On the other hand, a start-up will say, we want great coders - straight out of uni? 10 years experience? Doesn't matter. We want great coders. You'll be compared against others in your pay bracket when you apply.
It is in the candidates interest to state their expectation, as it doesn't waste anyone's time. If a candidate appears to be wasting our time, I'll automatically be less inclined to proceed - hiring isn't a game where you try to outsmart the other person. It's someone's livelihood, and ensuring both parties are clear, upfront, and honest is vital to a good employer / employee relationship.
As a candidate you should be thinking what makes me infinitely more hireable than the other candidates - playing a salary negotiation game from step 1 isn't going to do that.
As an employer, we try to be as clear as possible about our expectations - and it seems to work. Alternatively, we could of course split the "roles available" into 10 different pay brackets each with different expectations and force candidates to apply to the bracket they feel most suited for (and hence tell us their salary expectations), but this doesn't match reality, is disingenuous, and feels like a pointless exercise when it's so easy to be up-front and honest when neither party is trying to game the other!