Just asking cold calling style is not the only option for approaching such things.
This is cultural, no? I mean, I have a personal rule of never dating coworkers, but I have friends elsewhere in the world where this isn't such a strange notion.
Nonetheless, I was asked for a date by a senior programmer in the department I had been hoping to transfer to. This helped kill my hopes of having a real career at the company and helped me make my peace with just leaving the company shortly thereafter.
Some people know how to navigate such situations effectively. Some don't. Culture may help skew those percentages one direction or the other, but I think certain settings introduce inherent problems that need to be accounted for and navigated around. Working together is one such situation.
Merely curious, was the working relationship between the two of you already strained/tense? Said another way, were you already planning to depart from the company before the senior programmer asked you out?
I have a certificate in GIS. In the 5+ years at that company, he was the only person who knew what GIS was without me having to explain it. It never crossed his mind that I might have IT ambitions or that my technical training might have value for the company. He just saw an attractive woman, and that was it. This helped convince me that the company was simply not fertile ground for a serious career for me.
My department was a pink collar ghetto. I had no desire to remain in an underpaid pink collar job and use the company as a means to marry well. He no doubt made at least 3 to 5 times what I made.
And tech has the additional problem that women are under-represented so they get propositioned a lot.
I don't know about the US, but where I come from you never know that the answer is yes until you ask. Unless you are approaching a prostitute.