Learn More

Try out the world’s first micro-repo!

Learn More

Pieces User Stories: Auto-complete boilerplate code

Pieces User Stories: Auto-complete boilerplate code

From developing APIs to streamlining internal ops to building micro-utilities, Full Stack Engineer Brandon’s work is different every day. The ways he uses Pieces are similarly varied.

One feature that he started using recently is auto-complete. “Auto-complete was pretty useful on some of the boilerplate code that I use in my C++ and CMake projects, where I copy certain things a lot and there's not really a good way to abstract it out. So, Pieces auto-completed it and nearly took care of everything for me.”

The snippet Brandon uses across all of his C++ projects to bring in Catch2, a popular open-source testing framework.

A lot of developers prefer writing code over the more “menial” chores like documenting their code and writing unit tests. Unit tests are extraordinarily powerful when combined with test automation + CI/CD systems, and go a long way to improve software stability. But the caveat is that you have to actually write your tests! “I save these two snippets in Pieces so I can use auto-complete to write tests faster and sleep better at night knowing I’ve tested the code I put into production.”

Then, onto the next task! “A typical challenge for budding javascript developers is how to perform seemingly simple tasks, like center a div. There are many different ways to do it, and I may not be quite sure which one will work out for the structure that I have, but I saved a few snippets from the web to my Pieces library, tried them out in my editor using auto-complete, and ended up finding something that worked. The solution wasn’t exactly from those snippets I saved, but Pieces made it easier to quickly try a bunch of approaches.”

Pieces is always there when he’s going into uncomfortable territory. “If I need to figure out how to do something in a language or framework that I don't know, I’ll find, like, three different solutions to do something, but I'm not quite sure which one will work, so I save them all to Pieces. I’ll come back later and try them out locally, but I can keep researching really efficiently and then trying things out really efficiently.”

Table of Contents

Boilerplate

C++

Auto-Complete

Testing

More from Pieces
Subscribe to our newsletter
Join our growing developer community by signing up for our monthly newsletter, The Pieces Post.

We help keep you in flow with product updates, new blog content, power tips and more!
Thank you for joining our community! Stay tuned for the next edition.
Oops! Something went wrong while submitting the form.