Cheatsheets are the worst, especially in programming.

You see them shared all the time. People love them, and influencers love to share them for engagement. They have an allure, especially to beginners.

But cheatsheets can actually be bad for your programming!

Why do you hate cheatsheets so much?

Most cheatsheets already contain errors when published.

You'd think that people would clearly use an error-free version. No one would share a cheatsheet with bugs. People share "news" articles where they barely read the headlines. Cheatsheets get shared because they're pretty.

It gets worse, and yes, I have a list. Here's the list:

  • Errors cannot be corrected in cheatsheets
  • When software evolves, cheatsheets don't
  • Cheatsheets are not accessible
  • They're a semi-random collection of things someone thinks are important

Think back to university. I remember getting flashcards and notes from the smart kid. They did way better than me, obviously. The smart kid used the time to form mental connections while writing the flashcards, while I was only relying on their condensed information.

This can be used as a learning tool. If you write your own cheat sheet, you are exempt. Otherwise, you're missing out.

But let me show you an alternative in Python.

How Python gets documentation right

Beginner Pythonistas often start out in Jupyter in data science.

When Python was made up, its focus was on ease of use and readability, hence the whitespace. Python has an in-built tool to attach documentation to functions and classes called a Docstring.

This docstring can have paragraphs of information, explains all inputs and outputs, and often even contains example uses if your developer is good. Python is capable of introspection and shows you this docstring and a lot of other information.

When you use Jupyter, instead of busting out your 3-year old cheatsheet of dubious quality, you can have up-to-date organically grown information right from the source.

When you're in a function like print(), you can put your cursor between the parentheses and simply hit Shift + Tab up to four times. This shows neatly formatted information about the function and how to use it. This works offline and online as it takes the info right from the source code.

In fact, it's a "eat your own dog food" situation. The pretty website with the documentation that we end up on daily? It's generated from the docstring itself!

Cheatsheets suck. Use docstrings instead.

Image of Atomic Essay Day 17 - I Hate Cheatsheets. Here's how they make you a worse programmer and a better alternative.

This atomic essay was part of the October 2021 #Ship30for30 cohort. A 30-day daily writing challenge by Dickie Bush and Nicolas Cole. Want to join the challenge?