The most important trick is just to name a price in the first place. Especially in software, if you're good at what you do and the position is a good fit, you are almost guaranteed to be able to get what you ask for, as long as it's not ridiculous. At worst, you'll get a counter-offer. If someone drops you outright it's because they really don't want you and the salary just forces them into a decision. (Or, rarely, it's because they truly can't afford you: you don't want that job, becuase it won't be there for long anyway.)
Employers actually hate it when people come in with squishy responses like "Oh, I'm not looking for salary specifically..." because it just makes more work for them. It's much easier if they can say "this person costs this much, do we pay it or not?". Coming up with a "fair" salary is much harder.