Pseudo-Code

Pseudo-code is exactly what you would think it is: it's "fake code." Pseudo-code is useful to programmers because it allows us to work out the logic of a program before we ever start worrying about syntax or classes or anything else that's complicated. Working out the logic before we sit down to program allows us to work out logic bugs before testing.

So how do you write pseudo-code? The same way you write regular code, but with plain-English syntax.

  1. #Buy Cheap Cereal

  2. offBrand = lookAtOffBrandPrice

  3. brandName = lookAtBrandNamePrice

  4. if (brandName <= offBrand)

  5. buy brandName

  6. else

  7. buy offBrand

Pseudo-code is really a personal thing. You write it however you want, but most people will still be able to understand it. I write mine with Java-like syntax, because that is what I'm most familiar with, however I left off the semi-colons at the end of the lines, because they are not important to the overall meaning of the code.

Resources: Stuff I Made: Pseudo-Code - JessicaHough.com

Pseudo-Code

Pseudo-code is exactly what you would think it is: it's "fake code." Pseudo-code is useful to programmers because it allows us to work out the logic of a program before we ever start worrying about syntax or classes or anything else that's complicated. Working out the logic before we sit down to program allows us to work out logic bugs before testing.

So how do you write pseudo-code? The same way you write regular code, but with plain-English syntax.

  1. #Buy Cheap Cereal

  2. offBrand = lookAtOffBrandPrice

  3. brandName = lookAtBrandNamePrice

  4. if (brandName <= offBrand)

  5. buy brandName

  6. else

  7. buy offBrand

Pseudo-code is really a personal thing. You write it however you want, but most people will still be able to understand it. I write mine with Java-like syntax, because that is what I'm most familiar with, however I left off the semi-colons at the end of the lines, because they are not important to the overall meaning of the code.