There are situations where it's alright.
But it's not like a default situation, you just got to read the circumstances and see if it's right to give her your number or not. 99% of the time it's better to take her number though.
Two times I've given my number to a chick, 1. was when this girl kept looking at me on the beach, I smiled at her, she smiled back, I was going to go say hi but then for some random reason I had to leave the water because my friend nearly got in a fight so I had to go stop it, when I came back she wasn't there so I was like fuck it, before I left the beach I was looking around and I couldn't see her so I started walking away. Some random guy runs over to me and says hey I'm "(forgot her name's

)" friend...she wants to know if she can have your number. So I wrote it down.
Another time I was hanging out with my friends at some restaurant and this waitress was working there, starting talking to her for a bit, I asked for her number but her manager walked in at that moment, and apparently he was a bossy fuck. So I told her I'd come back later. When I came back it was really crowded and she was at the counter serving customers and my friends were outside waiting, so I couldn't just wait for her, so I just wrote my name and number on a piece of paper, quickly gave it to her in between a customer and said "give me a call some time". I walked away and she was smiling, so I took that to mean good news for me!
EDIT: I wouldn't usually do this, but this girl was an HB9!!! (I mean a REAL HB9!), and I already had another girl I knew who was interested in me, so I didn't really care if the HB9 rang me back or not, but it was a bonus when she did lol, so I wasn't completing worrying whether she'd ring me back, I simply didn't give a shit.
In both cases the girls rang me.
But like I said, it doesn't always work. Just read the situation you are in and decide for yourself!