Programming Concepts
Development Tools

Pseudocode

The idea behind pseudocode is to write down the major steps in an algorithm in a "language" that is very nearly plain-old English, but at the same time has some logical orderly structure similar to computer code.

Pseudocode can include such structures as variables, decisions, loops, and function calls. The exact precise syntax is not critical, which allows programmers to focus on the bigger picture rather than the nitpicking little details.

If you don't know where to begin when developing a new program, pseudocode is often a good place to start.

One popular approach is to begin by typing pseudocode into a file, in the form of comments, and then filling in between the comments with real code. In this approach the comments for the program are written before the program itself.

Pseudocode is also useful for explaining the overall working of a program or concept to another programmer, without getting bogged down in the picky details.

Example: Pseudocode to make a peanut-butter-and-jelly-sandwich.

  1. Start with two pieces of bread.
  2. while the first piece of bread is not covered with peanut butter on one side
  3. while the second piece of bread is not covered with jelly on one side
    • Spread jelly on one side of the second piece of bread
  4. Place the jelly side of the second piece of bread against the peanut butter side of the first piece of bread.
  5. Place sandwich on plate, and cut in half.

Flowcharts

Flowcharts are diagrams that illustrate the steps in an algorithm.

Typically rectangular boxes hold executable steps in the program, and diamonds hold decisions ( branchs ). Starting, stopping, and continuation points may be circles, ovals, or rounded rectangles. Arrows indicate the flow from one block to another.

Examples:

Simple Samples

A simple sample is a complete working program, containing the bare minimum amont of code necessary to be both functional and instructive. A good simple sample should exemplify the basic components that must be in every good working program, and should also exemplify good programming practices. ( I.e. it should have plenty of comments, well named variables, proper spacing and structure, etc. )

Compiling and Linking

Computer programs are normally written in a language that more or less approximates human speech, such as C++, Fortran, Pascal, Java, or Matlab script commands.However computers only work with binary data and instruction codes, and so the computer code that the programmer writes has to be translated into binary before the computer can execute it.

With traditional languages such as C/C++, FORTRAN, and Pascal, this typically comprises of two steps:

These two steps can be performed by either one or two separate programs from the comand line, such as gcc or g++ in UNIX.

Other languages may either be interpreted or compiled just-in-time, translating each program instruction into binary as needed, one-by-one.

Integrated Development Environments ( IDEs )

More commonly today code is developed in in Integrated Development Environment, IDE.

IDEs generally provide a graphical user interface ( gui ) with multiple windows, tabs, menus, etc, containing a wide variety of tools for developing, compiling, linking, running, and debugging programs.