At most places the common wisdom holds and you should keep your job seeking activity a secret until you are ready to resign and give your two-weeks (at least, I've given more than two weeks in a few cases where the circumstances warranted it).
As soon as you even hint that you're thinking of leaving you will be seen as "the other" and a bit of a traitor up and down the chain except perhaps by your peers who will envy you (in most cases the things that drive you away are likely making their job overly stressful as well).
A lot of companies (even dedicated software shops, which is kind of mind boggling, but true IME) like to delude themselves into thinking programmers are just human resources like box lifters and with the proper amount of process you can just easily fit someone else into the role being vacated. They maintain this illusion even while knowing their people are thinking about leaving. In my experience it isn't until you make it official with a resignation letter that they snap out of this and go into "oh shit" mode and then attempt to offer real change. But by then it is too late, you've probably already accepted another job and mentally prepared to leave and unless the concessions are extremely, extremely substantial (and guaranteed somehow in your favor) you should virtually always just stick with leaving.