Show Menu
Cheatography

Basic Computer Programming Cheat Sheet (DRAFT) by

Beginning vocabulary, concepts, and simplified language for computer science.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

COMPUTER PROGRA­MMING LANGUA­GES

A Progra­mming Language is software that helps you write instru­ctions for your computer. There are several different progra­mming languages, each with their own pros and cons; it depends on what you want to create and the Level of Abstra­ction.

HIER­ARCHY OF PROGRA­MMING LANGUA­GES

LANGUAGE LEVEL
 
DESCRI­PTION
EXAMPLE
ABSTRA­CTION LEVEL
High-Level Language
Easiest for Humans; hardest for Computers
Videos (FPS)
Greater Level of Abstra­ction
     
Images (Pixels)
Assembly Language
Requires work for both the Human and Computer to undestand
Colors
     
Decimals
Lower Level of Abstra­ction
Machine Language
Easiest for Computers; hardest for Humans
Binary

COMP­UTERS AND COMPUT­ATIONAL THINKING

COMPUT­ATIONAL THINKING
DEFINING COMPUTERS
Decomp­osi­tion: breaking down a large problem into manageable bits for the computer to execute
Data: we glean meaning from data
Recogn­izing Patterns: insight into solutions and giving context for solving new problems; unders­tanding that the symbols may change, but not the pattern
Process: what we have the computer do when we engage with it
Abstra­ction: engaging with inform­ation at a lower, more general level where not everything must be understood in order for it to work (see Abstra­ction of Code)
Output: what the computer figures out and, sometimes, shows us
Designing Algori­thms: creating a plan of action or list of instru­ctions that a computer can follow and execute
Storage: a place dedicated to the output either immedi­ately upon comple­tion, or later after conditions are met

ABST­RACTION OF CODE IMPLEM­ENT­ATION

LESS ABSTRACT
 
MORE ABSTRACT
Progra­mming Language
Pseudocode Language
Natural Language
actual progra­mming language
practice computing language
human language; discussing how to program

VARI­ABLES

DEFINITION
can be thought of as a name that refers to a value inside of a program
NAMING CONVEN­TIONS
CAN:
CANNOT:
start with or contain A-Z
start with 0-9
start with or contain a-z
contain any symbol other than "­_"
contain 0-9
contain a reserved word
contain "­_"
contain spaces
DECLARING VARIABLES
declaring a variable lets the program know what process it can perform on the stored input or value
INITIA­LIZING VARIABLES
the process of assigning a value to the variable once it is declared

THREE LANGUAGE CASES

camelCase
snake_case
PascalCase

VARIABLE STRUCT­URES

"65 is assigned to the variable score!­"
int
score
<--
65
variable type
variable name
assignment operator
value
 

TWO TYPES OF CODE

COMPIL­ATION CODE
INTERP­RET­ATION CODE
Compiler
Interp­reter
Compiled
Interp­reted
changes code to machine readable code all at once
changes code one command at a time
PRO: Faster
PRO: Easier to change and correct
CON: Harder to find errors and fix
CON: Slower
EXAMPLE: C++
EXAMPLE: Python

PROG­RAMMING VOCABU­LARY

What is SYNTAX?
How you organize your program and what language you use to create it
What are KEY or RESERVED WORDS?
Special jargon unique to each language that have specific, unalte­rable purposes
What is DOCUME­NTATION?
Text and inform­ation that comes with a program but does not affect the running of the program
What is SCOPE?
How a program is organized and "­con­tro­lle­d;" each language manages and controls scope differ­ently; this may include brackets, white space, or indent­ation; scope can also refer to specific block of code like a loop
What is TESTING or UNIT TESTING?
When you make sure your code (program, software) is behaving as intended; using test cases helps determine if each iteration will work and won't work
What is EDGE CASING?
Using the "­edg­es" of the test, like going one above, one below, or a combin­ation
What is DEBUGGING?
A BUG is an undesi­reable behavior in a program, so debugging is of identi­fying and correcting the errors See Error Types
What are COMMENTS?
Notes within a code or program that do not affect the execution but may be helpful to the programmer

DATA TYPES

TEXT
NUMERIC
BOOLEAN
Character
Integer
True/False
a single letter, number, or symbol
integers are always whole numbers
Boolean Variable Examples
set off by '_'
positive, negative, or zero
boolean check<­--false
Exampl­es:'a', '5', '!'
Floating Point Data
boolean check <--true
String
a floating decimal value which contains NO fractions
a combin­ation of characters (number or letter) strung together
Reserved Words for Numeric Data
set of by "­_"
short (16 bits)
Examples: "­181­240­", "­Hel­lo!­"
int (32 bits)
 
long (64 bits)
data and data format could change depending on the language being used

ERROR TYPES