Historically, cocktails made with gin were supposed to be shaken only if they included fruit juices, cream, or egg white. A Martini or other cocktail made with dry or sweet vermouth, simple syrup and bitters, or other non-cloudy ingredients would be stirred.
The reason for this was so a quality bar could show off its quality products and the skill of its bartenders by serving very cold, refreshing, beautiful clear or translucent cocktails glowing through a well-chilled glass. It takes longer to stir a drink cold, and you need your glass cold, too.
If the drink includes lime juice, for example, then it won't be crystal-clear in any event so you can save time and shake away.
Today we don't drink bathtub gin. We don't have to worry about clarity; we can take it for granted. Most people prefer a Martini shaken like a rat caught by a terrier. They value the ice crystals that show their drink got a great shake. And thanks to Mr. Bond, a bartender will look at you funny if you ask for your cocktail "stirred, not shaken".