Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.
/ Debug Public archive

Examples for the "My Code is Broken, Now What" workshop.

Notifications You must be signed in to change notification settings

itpresidents/Debug

Repository files navigation

My Code is Broken, Now What?

######Additional Resources:

Vocabulary to Help You Write Your Comment

######CONTROLS and CONDITIONS

  • Iterate through a Loop: For each thing in this array of things, do this and then that and then...
  • Index: For the i-th element in the array...
  • If/else : When this happens, do this...otherwise, do that

######ADJECTIVES

  • Data type: integer, float, boolean, String, someClass, array, ArrayList

######VERBS

  • Load (data, image, movie, text file) versus
  • Display (draw on screen) versus
  • Update (variable values)
  • Declare versus Initialize variables and objects
  • Call functions
  • Return some data type
  • Cast as some data type

######NOUNS

  • Listeners for Events: Functions that wait for stuff that happens like Mouse, Keyboard and Serial events
  • Function / Method, Argument / Parameter
  • Class, Constructor, Object
  • Variables and Temporary Variables

Common Error Messages

FYI: Exception is programmer-speak for error.

######SYNTAX ERRORS: Stray commas, missing curly brackets and typos

  • Unexpected token: ____
  • Expected ____, found ____

######DATA TYPING ERRORS: Trying to stuff a square peg in a round hole

  • Cannot convert float to int
  • The method ____ (int, int, int) is not applicable for the arguments (int, float, int)

######MISSING CONTENT: Trying to point to stuff that isn't there

  • No library found for _____

  • The package ____ does not exist. You might be missing a library.

  • ArrayOutOfBounds Exception : Your array only has 30 elements and you're trying to get the 31st element.

  • Null Pointer Exception

  • Can't find anything named ____

  • It looks like you are mixing static and active modes: You have drawing code outside of the draw loop. If you're going to use the draw loop to create animations, all drawing code must be inside draw(){}

The Ten Commandments of Coding from Jared Shiffman

  1. Thou Shalt Always Maintain Control of Thy Code

  2. Thou Shall Not Use What Thou Does Not Understand

  3. If Thou Uses What Thou Does Not Understand, Thou Shall Figure It Out In A Separate Test Project First

  4. Thou Shall Construct Thy Code In A Top Down Fashion

  5. Thou Shall Always Comment Thy Code

  6. If Thou Can Do It Thyself Instead Of Using A Library, Thou Shall Do It Thyself

  7. Thou Shall Manage Thy Memory As If It Were Thy Money

  8. Thou Shall Not Allow Thyself To Get Stuck For More Than One Hour Without Asking For Help

  9. When On Site, Thou Shall Test Everything Three Times Before Leaving

  10. Thou Shall Go To Line 1.

About

Examples for the "My Code is Broken, Now What" workshop.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages