As co-founder and lead developer of Pieces for Developers, Mack has auto-magical Pieces experiences nearly every day.
“One of my favorite moments is when Pieces auto-saves a snippet. Inside Pieces for Developers, we rely a lot on Dart Streams and Riverpod Listeners to fuel real-time updates in the code. So when you perform an action in one part of the app, it reacts everywhere else. And the way that we do that is through listeners — you use listeners in multiple areas in your code, and sometimes you put it in spot A but later on you decide you don't want it in spot A, so you move it to spot B. Sometimes you find you don't want it in spot B, so you move it back to A or to C, and so on. So when you're doing that, you're copying and pasting it all the time. When I'm coding and then I open Pieces and see a snippet there that I know I didn't put there manually, that's always really nice. Pieces auto-saved it, and then I can just insert the snippet in and I don't need to go find it somewhere in the code.”
For Mack, the useful features don’t stop there. One of his most common uses of Pieces is super simple, but saves him time and protects his code against regressions.
“When developing with Flutter, I often save snippets when I'm writing code and essentially use Pieces as a temporary save. When I'm about to delete a large chunk of code in order to refactor it and rewrite it, I'll just save the old code as I'm working with it. If I have a function I'm going to transport into a different file, but I'm not going to transport it right this second, I’ll take it, save it in Pieces, and then a couple of steps later move it into that new file. It doesn't necessarily live in Pieces long term, but it's a way to elongate my clipboard so that I can use it later on.”