It really is incredible how many people don't know this. Granted, some people panic when they lock themselves out and aren't thinking of the financial cost, but let's look at why you should almost always opt for a mobile locksmith. (We say almost, as there are some rare exceptions that are covered in the final paragraph.)
One reason that people do decide to break a window instead of calling a mobile locksmith (besides the reasons of panicking or mistakenly thinking it's cheaper to break a window) is that they think they can get in quicker, leaving the broken glass as tomorrow's problem. However, there are three huge flaws with this plan. For one thing, it is about 5–10 times more expensive to repair a broken window than it is to simply call in a mobile locksmith.
Secondly, it is dangerous — especially if you don't know what you're doing. Many people try to smash in a window with their fists, elbows, or shoulders; this often results in serious and completely preventable injury. Ironically, such injuries only compound the time and expense of being locked out, and that's not even mentioning the tremendous pain (and embarrassment) that accompanies such an injury. Additionally, you will need to spend extra time cleaning up the glass shards — all while ensuring that you don't accidentally cut yourself on the way inside.
Finally, even assuming you managed not to hurt yourself, you have now created a security risk. If you've just come home from a late night out (and misplaced the spare key), going to sleep with a smashed window means you managed to break into your house — which means anyone else can potentially do the same! Alternatively, if you decided to call a mobile glass repair company that operates 24-7, this will end up costing you much more for no good reason. And any time you would've saved by breaking in will have been lost by staying up to pay the glass repairer.
In summary, the reasons to smash out a window instead of a mobile locksmith are very few and very far between. One exception, perhaps, is if you see a small child or animal trapped in a car on a hot day. Another exception might be an unattended child or special-needs person who urgently needs medication. However, in the overwhelming majority of cases, always opt for a mobile locksmith over smashing your window open.