Video: How to Write a Program

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Your next lesson will play in 10 seconds
  • 0:05 Steps to Writing a Program
  • 0:39 Writing Code
  • 2:10 Syntax
  • 3:47 Testing
  • 5:12 Debugging
  • 7:03 Lesson Summary
 Save Timeline
Autoplay
Autoplay
InstructorPaul Zandbergen

Paul is a GIS professor at Vancouver Island U, has a PhD from U of British Columbia, and has taught stats and programming for 15 years.

Writing Code

Computer code is a list of instructions for compilers to compile for a computer to understand. It is written using plain text so the compiler can read it and detect syntax errors. Multiple unique file extensions indicate that this file is code for a specific programming language.

The steps in writing a code are the following:

  • Understand the problem and develop a solution.
  • Draw a flowchart and write pseudo-code.
  • Write code, test, and debug.
  • Test with real-world users and release the program.

Integrated Development Environment (IDE)

An Integrated Development Environment (IDE) is a software application used in coding; it is a tool to help the user format, syntax check, run, and test the code. It also helps with syntax highlighting, which shows different codes in different colors for easier identification. It also helps with autocompletion; the application will list what they think you are trying to type and lets you choose whichever you need to use. This saves time and reduces typographical syntax errors in your code. Some IDEs are for one programming language only, but some IDEs support multiple programming languages.

Testing Code

Testing the code is a crucial part of writing your code. This step ensures that the program is doing what you intended, including checking the correct prompt, input, formats, calculations, etc. Using real-world test data will also ensure that your program will work on real-world applications.

Debugging Code

Debugging Code is a step when you find an error in your program. It is a process of finding and fixing bugs. Bugs are defects within the code that make the program faulty. Debugging can be done manually or using an IDE. One important tool of an IDE is a debugger. This tool helps you check your code systematically to find where the bugs/defects lie.

Read How to Write a Program: Coding, Testing & Debugging Lesson
Create an account to start this course today
Used by over 30 million students worldwide
Create an account
close