Home

Blog

Code Variable Type Cheat Sheet

April 27, 2025

This sheet covers common types in code

String / char / str

A String is like a sentence, a bunch of words, or a paragraph. Anything that has text in it. That text is made up of Characters, things like letters, numbers, and punctuation. Most languages like strings enclosed in "" or ''.

Int / number

Any integer value (A number).

Array

Like a list of objects, a lot of languages have syntax similar to myArray[0] to access items in an array. In this example we are retrieving the value in myArray‘s slot number [0].

Boolean

A bool is a true or false value. It can be on or off, one or zero. These are very good for basic logic. Check your language’s documentation for how to make one of these; I have ran into countless situations where true is not True or TRUE. Yay for case-sensitivity.

Dictionary

A dictionary usually refers to a list of values with corresponding keys. Basically, you can store data and set it to be found from a specific unique text. an example could be:

myDictionary = {
  message: "Hello World!",
  count: 3,
  isUseful: true
}

Outro (not a datatype)

Hope you found this cheat sheet useful! This covered some of the most basic datatypes, but there are likely many others depending on your language (don’t get me started on classes). If you are still confused consider checking out https://www.w3schools.com/ . Or consider reading another one of my articles: