Programming Terms Cheat Sheet


This is a cheat sheet showing various programming terms alongside example code (in Java) of what the terms describe. I created this document to give junior developers and interns a reference for the terms that developers often use to describe different elements of a program. The goal of this document is to allow senior developers to use technical language and be somewhat Socratic during code reviews with new programmers instead of pointing to specific lines and explaining exactly what to do. If a junior developer’s code is being reviewed and he or she is asked, “Why did you pass the obtainClass() method a String variable?”, he or she can quickly search this sheet for the unknown terms and try to answer the question. It will also help new developers to know what parts of the code senior devs are talking about—for example: obtainClass()’s method signature versus an obtainClass() method call. Rather than create an exhaustive reference, I want this cheat sheet to be brief, so I only included the technical words that I use the most during my current code reviews. However, I’m sure this document is not perfect, so if you would like to add or fix something, please write a comment explaining what could be improved and/or make the improvement yourself and send me a pull request.

Note that underlined text can be clicked to navigate to another section of the cheat sheet which shows terms for each element of that line of code.

/* Term */ Example Code

/* Class Declaration: */

/* Constant Declaration: */

/* Member Variable Declaration: */

/* Method Signature: */
/* Method Body (begin): */

/* Conditional (If) Statement: */
/* If Block (begin): */

/* Return Statement: */

/* If Block (end): */
/* Else Block (begin): */



/* Else Block (end): */

/* Method Body (end): */



/* Local Variable Declaration: */

/* Variable Assignment: */



                

public class ExampleClass {

    private static final String PREFIX = "prefix";

    String value;

    public String getValue(boolean prefixValue)
    {

        if ( /* Condition: */ prefixValue)
        {

            return PREFIX + /* Member Variable: */ value;

        }
        else {

            return value;

        }

    }

    public void runTest() {

        boolean valueStartsWithPrefix = getValue(false).startsWith(PREFIX);
        Assert.assertFalse(valueStartsWithPrefix);
        valueStartsWithPrefix = getValue(true).startsWith(PREFIX);
        Assert.assertTrue(valueStartsWithPrefix);
    }
}
                
/* Types of Strings */







/* String Constant: */

/* String Variable: */

/* String Literal: */
                

private static final String PREFIX = "prefix";

String value;

/* ... */

PREFIX

value

"prefix"
                
/* Elements of a Method Signature */

/* Access Level Modifier: */
/* Return Type: */
/* Method Name: */

/* Method Parameter: */


                

public
String
getValue
(
boolean prefixValue
)
{
                
/* Elements of a Local Variable Declaration Statement */

/* Variable Type: */
/* Variable Name: */
/* Assignment Operator: */
/* Method Call: */
/* Value Passed to Method: */

                

boolean
valueStartsWithPrefix
=
getValue(
false
).startsWith(PREFIX);
                

Comments

Related Posts

Technical Writing

Version Control

Encapsulating Functionality

Step Through Your Code

Java Testing Tip #2: