The Context of Software Development

The Context of Software Development

A computer program, from one perspective, is a sequence of instructions that dictate the flow of electrical impulses within a computer system. These impulses affect the computer’s memory and interact with the display screen, keyboard, mouse, and perhaps even other computers across a network in such a way as to produce the “magic” that permits humans to perform useful tasks, solve high-level problems, and play games. One program allows a computer to assume the role of a financial calculator, while another transforms the machine into a worthy chess opponent. Note the two extremes here:

more concrete level electrical impulses alter the internal state of the computer, while
at the higher, more abstract level computer users accomplish real-world work or derive actual pleasure.

The Context of Software Development AndroWep-Tutorials
The Context of Software Development AndroWep-Tutorials

Software

A computer program is an example of computer software. Software makes a computer a truly universal machine transforming it into the proper tool for the task at hand. A hard drive, a CD, a DVD, and a USB pen drive are all examples of media upon which software can reside. The CD is not the software; the software is a pattern on the CD.In order to be used,software must be stored in the computer’s memory.

An example of a binary program sequence is
10001011011000010001000001001110

Development Tools

Software can be represented by printed words and symbols that are easier for humans to manage than binary sequences. Tools exist that automatically convert a higher-level description of what is to be done into the required lower-level code. Higher-level programming languages like C++ allow programmers to expresssolutions to programming problems in terms that are much closer to anatural language like English. level programming languages that have been devised over the past 60 years include FORTRAN, COBOL, Lisp, Haskell, C, Perl, Python, Java, and C#. Most programmers today, especially those concerned with high-level applications, usually do not worry about the details of underlying hardware platform and its machine language.

Consider the following program fragment written in the C++ programming language:

subtotal = 25; 
tax = 3; 
total = subtotal + tax;

Editors

An editor allows the user to enter the program source code and save it to files. Most programming editors increase programmer productivity by using colors to highlight language features. The syntax of a language refers to the way pieces of the language are arranged to make well-formed sentences. To illustrate, the sentence

The tall boy runs quickly to the door.
uses proper English syntax. By comparison, the sentence
Boy the tall runs door to quickly the.

Compilers

Acompiler translates the source code to tar get code. The target code may be the machine language for a particular platform or embedded device. The target code could be another source language; for example,theear liest C++ compiler translated C++into C,another higher-level language. The resulting C code was then processed by a C compiler to produce an executable program. C++ compilers today translate C++ directly into machine language.

Preprocessor

adds to or modifies the contents of the source file before the compiler begins processing the code. We use the service soft preprocessor mainly to #include information about library routines our programs use.

Compile

Translates C++ source code to machine code.

Linker

combines the compiler-generated machine code with precompiled library code or compiled code from other sources to make a complete executable program. Most compiled C++ code is incapable of running by itself and needs some additional machine code to make a complete executable program. The missing machine code has been precompiled and stored in a repository of code called a library. A program called a linker combines the programmer’s compiled code and the library code to make a complete program.

Debuggers

A debugger allows a programmer to more easily trace a program’s execution in order to locate and correct errors in the program’s implementation. With a debugger, a developer can simultaneously run a program and see which line in the source code is responsible for the program’s currentactions.

Profilers

A profiler collects statistics about a program’s execution allowing developers to tune appropriate parts of the program to improve its overall performance. A profiler indicates how many times a portion of a program is executed during a particular run, and how long that portion takes to execute.

Simple Code

#include <iostream>
int main() 
{ 
     std::cout << "This is a simple C++ program!\n"; 
}

Exercises

  • 1. What is a compiler?
  • 2. How is compiled code different from source code?
  • 3. What tool does a programmer use to produce C++ source code?
  • 4. What tool(s) does a programmer use to convert C++ source code into executable machine code?
  • 5. What does the linker do?
  • 6. Does the linker deal with files containing source code or machine language code?
  • 7. What does the preprocessor do to source code?