Home | Work & Business | Computers | Computer Programming | Computer Programing Basics

Computer Programing Basics

by Alex Cosper
  • Overview

    Learning how to write computer programs can take years if you want to learn many different computer languages. You can accelerate your journey to writing your first program by focusing on a specific language that fits your goals. Whether writing simple programs in the Python or Rebol languages or more elaborate programs in the C language, keep your goals realistic and understand that a programming task, such as writing popular game software, is usually accomplished by teams of many people over several years.
  • Computer Languages

    Choosing a computer language that meets your goal will accelerate your learning. There are four main types of computer languages: machine, assembly, high level and fourth generation. Assembly language is what a human programmer writes. There are many of these languages, such as C, Fortran and COBOL. That code is then converted in a "compiler" to machine language, which is too difficult for a human to read, since it's all based on binary code (zeroes and ones). A high level language is set up to be easy to understand by non-code writers. Fourth generation languages, such as Java, do not require knowledge of other programming languages.
  • Logic and Flow

    Logic is an important element in computer programming, which aims to create a set of instructions to be executed in a specific order. Before writing the program, a programmer needs to prepare a logical flow chart of commands. The result of these commands is called the output. In order to achieve the output, you must define the solution by defining equations and methods for using raw input data. Then you must map the solution by planning out a sequence that takes into account "if-then" conditional statements.
  • Inside the Language

    When you are ready to write the program, you need to divide the program into functions, which are expressed in curly brackets. Functions, also called "subroutines," are sets of brief instructions within the code that lead to a result and are independent of the overall code. Proper syntax is important because if you make errors in the code the program will not work. The shorter the code, the quicker it will execute. The code will include variables, which are arbitrary characters such as "X" and "Y," used for representing values. Adding comments to the code helps other programmers understand your program. After the code is run through a compiler, you can check for errors, which can be fixed with the use of a "debugger" program.

    References & Resources