Used to do this when I was a lot younger, like you said, to control what I was spending.
Didn't do it all the time, but if I was running short during a month - I'd take cash out relevant to what I had left in my account and spend accordingly - these were the days of ridiculous overdraft charges!