There's a (potentially big) semantic difference between...
1: She started to cry
2: She started by crying
Pragmatically we can assume that in #1 above, there must have been something that caused her to cry, but nothing about the words as presented gives any implication that her crying was part of any "defined sequence" of events. And it certainly says nothing about whether she might do anything else after starting to cry (apart from continuing to cry, obviously! :)
But the syntax of #2 very strongly implies that there was a [planned] sequence of actions [with some expected outcome] - the first of which was to cry. Usually (but not always), when someone starts by doing something, the implication is that they're consciously aware of the intended sequence that will follow. Perhaps if she didn't get what she wanted by crying, she might switch to cajoling or insisting.
I've no idea what to yank the declaration of var means, so I can't say whether that's a credible construction or not with that particular "verb".
For example, it's quite possible to say I started by marrying the boss's daughter (as the first step in my plan to take over the company), but you can't really say I started to marry the boss's daughter in any context I can think of.