For me it's much less glamorous, and even less purposeful. I write code almost everyday, sometimes without even thinking about it. If I don't carry out some form of automation at least once every 2 days, I get physically ill [hyperbole alert!] I'm the guy that always installs strange editors & calculators on other people's computers.
Most of the time I don't have a particular need for a development environment, but I have a phobia about being stranded somewhere without my tools. My mobile phone has 3 programming languages, their manuals and other cheat-sheets. It also has as many advanced calculators, solvers & graphic visualization utilities.
To me it's a mix of arms race & addiction. I hack because I crave it. I feel inadequate if I don't know how something works.
Most of my work is snippets. I usually store it in a file with a long descriptive name, for later finding & greping. I have had a ~/hacks directory in all my machines for the last 12 years or so.