DRY

DRY

There's a common mantra that you'll hear from developers: DRY! (Don't repeat yourself).

While it may not be completely possible to achieve, it's a good rule of thumb to hold yourself to—especially if you're trying to eliminate or reduce your workload. First let's get the basic idea, then we'll look at some examples of non-developer tasks.

For a developer, it's common to realize you need the same bit of code to be used in other parts of the program. You may be typing along and realize you've come to a problem you've solved before, or you're noticing you've written out code that is essentially the same as some other section. It's time to condense those things and put it in a place where whatever needs to access it can do so.

Formatting a Doc

Here's an example of this with a word processor. Say you're working on a document that's pretty long. You've got titles and subtitles all over. You realize the headings aren't big enough or bold enough, so now you have to update the font and turn on "bold" for 20 headings...

In Microsoft Word or in Google Docs, you have the ability to define styles to combat this very situation. If you start out by planning your heading styles or if you realize you're going to have more than one heading in the doc, these style definitions will keep you sane.

When something needs to be tweaked, like the font size and weight, you just modify that one heading style, and then every single heading using that style gets updated at the same time. Now you're not repeating yourself.

Text Snippets, Text Expanders, Templates

Another example could be when you're writing emails, asking for a review, or sending instructions. Templates and snippets will be your go-to to stop the constant repetition.

There are a few ways to do this, depending on your operating system or the software you have available. Here are a couple of ways, choose the best setup for you:

MacOS

This is one of the easiest methods I’ve used to set up some snippets. Open up the System Preferences and click on Keyboard, then select the “Text” tab. Here you’ve got your own little “dictionary,” but you can set up some great shortcuts here.

I have in the “Replace” column several options that I can type to trigger the snippet. Here’s a good one:

Replace With
ifit If it looks good, let me know and I’ll mark your request as complete. Thanks!

This one is so nice—I used to type this sentence at least once a day, if not more. Now, I can just start typing it without the space and a little pop-up will appear and by hitting space or tab, it switches out the shortcut “word” with that whole response.

This also appears to be shared across your Apple devices, so you take these shortcuts wherever you are. Here are some other ideas for these particular snippets:

  • Hashtags on Instagram (shortcut = a campaign or theme, replace with all of the hashtags you need / typically use)
  • Brand names with the correct spelling and casing (especially your company)
  • Quick responses that should be typed out to be more professional (omw → On my way)

Firefox Plugin

If you’re into Firefox, it’s pretty likely you’ve used Add-ons before, but if you haven’t, they are little programs that you can install to work with your browser to give you extra functionality. There are quite a few add-ons that can help you with templates and text snippets. Browse them here: https://addons.mozilla.org/en-US/firefox/

Just be sure that you trust the program—look at the developer info, the number of users, ratings, and reviews. Always be cautious and critical before you install anything.

Microsoft Word (Desktop App)

There are two methods you can use in the Word desktop app to create text snippets or text expanders.

If you have a large amount of text, you'll want to go with AutoText. You're able to build options that appear in the Insert > Quick Parts > AutoText menu, and from there you can choose which block of text to insert.

The other method is adding character combos to the AutoCorrect function. This ideal for shorter text (up to 255 characters) and doesn't interrupt the flow of typing.

To see the steps to set up each of these functions, check out Microsoft's article here:

Create reusable text snippets
Add reusable text snippets to your document automatically using AutoText.

Python

There is a way to code your own snippets with Python. If you want me to write up a tutorial on this with some extra flair and improvements, message me on Instagram: @NotDefinedTech

In the meantime, if you're dying for a quick tutorial, use this one:
https://automatetheboringstuff.com/2e/chapter6/#calibre_link-223