How to Write a Computer Program

Writing a computer program is an exercise in logic. A computer program is a series of logical operations to accomplish a task. Every step needs to be carefully planned and double-checked to make sure it does what it is supposed to. When it all comes together, the feeling of accomplishment is palpable. Each line of code is like a small cog which work together to make a great machine.

Things You'll Need

  • Interpreter
  • Compiler
  • Debugger
  • Code editor
  • Computer
Show More

Instructions

    • 1

      Pick a programming language. C++ is one of the most popular programming languages in the software industry. Lisp is a very powerful language with a straightforward syntax that is used in a lot of artificial intelligence applications. Visual Basic is popular among some new programmers because it is designed to be easy. See the list below for info on the different programming languages.

    • 2

      Learn basic programming. Get a code editor, a compiler or interpreter, a debugger and a basic instruction book. Work through the first several lessons to get an understanding of the language you want to use.

    • 3

      Identify the problem you want your program to solve. Write down what task your program has to accomplish in the clearest possible language. Describe how it will do that task.

    • 4

      Come up with steps to solve the problem. Use a flowchart to diagram each step the computer program should undertake to get to the end goal.Include user input (commands that the program user types or icons she clicks) . Mentally go through the flowchart to make sure that it accomplishes what it is supposed to.

    • 5

      Write the program. Turn each step into a sequence of programming commands one at a time. Debug the program when you are done to make sure that it works correctly.

    • 6

      Compile your program or run it through the interpreter. Compiling turns programs into machine code before running them. Interpreting turns programs into code as they are running. Some languages use compilers while others use interpreters.

Tips & Warnings

  • Expect things to not work right the first time. Debugging can be a long, frustrating process.

Related Searches:

Resources

Comments

View all 10 Comments

You May Also Like

Related Ads

Featured