Thursday, 28 November 2013

History of programming or History of c-language



Topic;

Computer program

Definition;

“Computer is an electronic machine. It is used to solve different kinds of problems according to the set of instructions given to it. A set of instructions given to computer to perform a particular task is called is called a computer program or software.

Programming languages;

A programming language provides the way of communication between user and computer. A computer program is writing in programming languages. The programming language provides set of rules for writing computer programs. The instaurations of the program are written in a specific manner and according to the rules of the programming language. There are many programming language. Each language has its own set of rules to write computer programs.

History of programming language:

The first programming language predate modern computer. At first the languages were codes. During a nine-month period in 1842-1843 Ada lovelace translated the memoire of Italian mathematician Luigi Menebrea about Charles Babbage’s newest proposed machine, the analytical engine. With the article, she append a set of notes which specified in complete details a method of calculating Bornoulli number with the engine, recognized by some histories as the world first computer program.
The first program codes were specialized for there application. In the first December of 20th century, numerical calculations were based on decimal numbers. Eventually it was realized that logic could be represent with numbers, not only with worlds, for example Alonza Chuch was able to express the lambda calculus in a formulae way.

The 1940s

in the 1940s, the first recognizably modern eclectically powered computers were crated. The limited speed and memory capacity forced programmers to write hand tuned assembly language programs. It was eventually realized that programming in assembly language required a great deal of intellectual effort and was error-prone.
I.        1943-plankalkul (Konrad Zuse,), designed, but unimplemented for a half century
II.        1943-ENIAC Electric Numerical integrator and computer. Machine-specific code set appearing in 1948
III.        1949-1954 a series of a machine-specific mnemonic instruction set like ENIAC’s beginning in 1949 with c-10 BINAC. Each code set, or instruction set, was tailored to a specific manufactured.

The 1950 and 1960:

In the 1950s, the first three modern programming languages whose descendants are still in widespread use todays were designed:
      I.        FORTRAN (1955), “FORmula TRANslator”, invented by Jhon Baku ser al.
     II.        LISP(1958), the “LISt processor”, invented by Jhon Mccharthy.
    III.        COBL(1959), the common Business oriented language created by the short Range committee, heavily influenced by Grace Hopper.
  IV.        IAL-(1958), international Algebraic Logic.

1964:

APL-A programming language
This language using for a mathematical notation, with lot of operator. A unique type, the array. Define from 1957 to 1960, implemented in 1964.

1965:

Iswim-if you see what I Mean by p.Landin.
First purely functional language in the mathematical sense. The first to use LAZY EVEALUTION.

1970:

Pascal-Named from the French mathematician Blaise Pasca by NIKLaus
 Wirth.

1973:

C-c is the successor of B, Which is the successor of BCPL by Dennis Ritchie.

1974:

Awk- first letters of author’s name
Aho Keminghan Weinber.
This is use for word processing language based on a regular expression, using a pattern action principle.

1981-1986:

C++. By Bjarne stroustrup.   

Types of programming languages

The programming languages are divided into two main categories:
(i)                    Low-level programming languages.
(ii)                  High-level programming languages.

Low-level programming languages:

The programming languages that are very close to machine language are called Low-level programming languages. The program written in these languages are in binary form (0 or 1) and symbols. The examples of Low-level programming languages are.
(i)                    Machine language
(ii)                  Assembly language

High-level programming languages:

The programming languages that are very close to human languages are called High-level programming languages. The program instructions are written according to the syntax of the programming language. The examples of high-level programming languages are.


(i)    C\C++

(ii)  FORTRAN

(iii) COBOL

(iv) Java

(v)  Pascal

(vi) BASIC



History of c-language

C is a general-purpose high-level programming language. It was developed by (Dennis Ritchie at AT&T Bell laboratories) in 1972. It was derived from an earlier programming language named B.B-language was developed by Ken Thompson in 1970. This language provided the basis for the development of c. In the late seventies C began to replace the more familiar languages of that time like PL/I, ALGOL, etc. No one pushed C. Thus, without any advertisement C’s reputation spread and its pool of users grew. Ritchie seems to have been rather surprised that so many programmers preferred C to older languages like FORTRAN or PL/I, or the newer ones like Pascal and APL. But, that's what happened. Possibly why C seems so popular is because it is reliable, simple and easy to use. Moreover, in an industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that has survived for more than 3 decades has to be really good.
In the past, c-language was mainly used for writing system. These system software were operating systems, compilers, utility programs etc. the UNIX operating system and its tools were also written in c.

Advantages of C:

1.    Easy to learn
2.    Easy to detect errors
3.    Machine independent
4.    Availability of library functions
5.    Shorter programs
6.    Well-defined syntax and standard
7.    Source code is understandable by another programmers

The C Character Set:

A character denotes any alphabet, digit or special symbol used to represent information. Figure shows the valid alphabets, numbers and special symbols allowed in C.

Alphabets
A, B, ….., Y, Z
a, b, ……, y, z
Digits
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Special symbols
~ ‘ ! @ # % ^ & * ( ) _ - + = | \ { }
[ ] : ; " ' < > , . ? /


C Keywords:

Keywords are the words whose meaning has already been explained to the C compiler (or in a broad sense to the computer). The keywords cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword, which is not allowed by the computer. Some C compilers allow you to construct variable names that exactly resemble the keywords. However, it would be safer not to mix up the variable names and the keywords. The keywords are also called ‘Reserved words’.
There are only 32 keywords available in C. these keywords given in figure.
auto
double
int

struct
break
else
long

switch
case
enum
register

typedef
char
extern
return

union
const
float
short

unsigned
continue
for
signed

void
default
goto
sizeof

volatile
do
if
static

while














 Programming Languages

and Program Development


A computer program is a series of instructions that directs a computer to perform tasks. A computer programmer, often called a developer, creates and modifies computer programs. To create a program, programmers sometimes write, or code, a program’s instructions using a programming language. A programming language is a set of words, abbreviations, and symbols that enables a programmer to communicate instructions to a computer. Other times, programmers use a program development tool to create a program. A program that provides a user-friendly environment for building programs often is called a program development tool.

Types Of Programming Language


There are two types of programming languages

Low Level Language

High Level Language


A low-level language is a programming language that is machine dependent. A machine dependent language runs on only one particular type of computer. These programs are not easily portable to other types of computers. High-level languages often are machine independent. A machine-independent language can run on many different types of computers and operating systems.

LOW LEVEL LANGUAGE


Two types of low-level languages are machine languages and assembly languages. Machine language, known as the first generation of programming languages, is the only language the computer directly recognizes . Machine language instructions use a series of binary digits (1s and 0s) or a combination of numbers and letters that represents binary digits. The binary digits correspond to the on and off electrical states.

Assembly language, the second generation of programming languages, a programmer writes instructions using symbolic instruction codes. Symbolic instruction codes are meaningful abbreviations. With an assembly language, a programmer writes abbreviations such as A for addition, C for compare, L for load, and M for multiply.

HIGH LEVEL LANGUAGE


A procedural language, the programmer writes instructions that tell the computer what to accomplish and how to do it. With a procedural language, often called a third-generation language (3GL), a programmer uses a series of English-like words to write instructions. For example, ADD stands for addition or PRINT means to print. Many 3GLs also use arithmetic operators such as * for multiplication and 1 for addition. These English like words and arithmetic symbols simplify the program development process for the programmer.

OBJECT-ORIENTED PROGRAMMING (OOP)


Computer programmers use an object-oriented programming (OOP) language or object oriented program development tool to implement an object-oriented design. an object is an item that can contain both data and the procedures that read or manipulate that data. An object represents a real person, place, event, or transaction. A major benefit of OOP is the ability to reuse and modify existing objects. For example, once a programmer creates an Employee object, it is available for use by any other existing or future program. Thus, programmers repeatedly reuse existing objects. For example, the payroll program and health benefits program both use the Employee object. That is, the payroll program would use it to process employee paychecks and the health benefits program would use it to process health insurance payments.

Programs developed using the object-oriented approach have several advantages. The objects can be reused in many systems, are designed for repeated use, and become stable over time. In addition, programmers create applications faster because they design programs using existing objects.

Object-oriented programming languages and program development tools work well in a RAD environment. RAD (rapid application development) is a method of developing software, in

which a programmer writes and implements a program in segments instead of waiting until the entire program is completed.

Most object-oriented program development tools are IDEs. An IDE (integrated development environment) includes tools for building graphical user interfaces, an editor for entering program code, a compiler and/or interpreter, and a debugger (to remove errors, which is discussed later in the chapter). Some IDEs work with a single programming language others, such as Eclipse support multiple languages.

The following sections discuss a variety of object-oriented programming languages and program development tools.

Java


Java is an object-oriented programming language developed by Sun Microsystems. When programmers compile a Java program, the resulting object code typically is called bytecode, which is machine independent. Java then uses a just-in-time ( JIT ) compiler to convert the bytecode into machine dependent code that is executed immediately. Programmers use Java Platform, Standard Edition ( Java SE ), developed by Sun Microsystems, to create stand-alone programs for desktop computers and servers. Similarly, programmers use Java Platform, Micro Edition ( Java ME ) to create programs for smart phones and other mobile devices.

.NET


The Microsoft .NET Framework, or .NET (pronounced dot net), is a set of technologies that allows almost any type of program to run on the Internet or an internal business network, as well as stand-alone computers and mobile devices. Similarly, ASP.NET is a Web application frame work that provides the tools necessary for the creation of dynamic Web sites.

C++


Developed in the 1980s by Bjarne Sroustrup at Bell Laboratories, C++ (pronounced SEE-plus-plus) is an object oriented programming language that is an extension of the C programming language. C++ includes all the elements of the C language, plus it has additional features for working with objects, classes, events, and other object-oriented concepts. Programmers commonly use C++ to develop database and Web applications. Much application software, such as word processing and spreadsheet programs, also is written in C++. A programmer does not need C programming experience to be a successful C++

 c#


c#(programmer. pronounced SEE-sharp) is an object-oriented programming language based on C++ that was developed primarily by Anders Hejlsberg, Microsoft chief architect and distinguished engineer. C# has been accepted as a standard for Web applications and XML-based Web services. Like Java, C# uses a JIT compiler but its resulting code is MSIL. C# applications can be built on existing C or C++ applications, saving development time for companies migrating from C or C++.

Program Translators

To execute a computer program written in high or low level language, it must be first be translated. There are 3 types of system software used for translating the code that a programmer writes into a form that the computer can execute (i.e. machine code). These are:

1. Assemblers

2. Compilers

3. Interpreters


An Assembler converts an assembly program into machine code. A Compiler is a program that translates a high level language into machine code. An Interpreter is also a program that translates high-level source code into executable code. However the difference between a compiler and an interpreter is that an interpreter translates one line at a time and then executes it.

4GLs


A 4GL ( fourth-generation language) is a nonprocedural language that enables users and programmers to access data in a database. With a nonprocedural language, the programmer writes English-like instructions or interacts with a graphical environment to retrieve data from files or a database. Nonprocedural languages typically are easier to use than procedural languages. Many object-oriented program development tools use 4GLs. One popular 4GL is SQL. SQL is a query language that allows users to manage, update, and retrieve data in a relational DBMS. These powerful languages allow database administrators to define a database and its structure. They also enable users to maintain and access the data in the database.

Web Page Development

HTML and XHTML


HTML (Hypertext Markup Language) is a special formatting language that programmers use to format documents for display on the Web. You view a Web page written with HTML in a Web browser such as Internet Explorer, Safari, Firefox, Opera, or Google Chrome. Similarly, XHTML (extensible HTML) is a markup language that enables Web sites to be displayed more easily on micro browsers in smart phones and other mobile devices. HTML and XHTML are not actually programming languages. They are, however, languages that have specific rules for defining the placement and format of text, graphics, video, and audio on a Web page. HTML and XHTML use tags or elements, which are words, abbreviations, and symbols that specify links to other documents and indicate how a Web page is displayed when viewed on the Web. A Web page, thus, is a file that contains both text and HTML and/or XHTML tags. Examples of tags are <p> to indicate a new paragraph, <tr> to create a new row in a table, and <title> to define a document title. You can write HTML code using any text editor such as Notepad.

XML and WML


XML (Extensible Markup Language) is an increasingly popular format for sharing data that allows Web developers to create customized tags, as well as use predefined tags, used for developing a single Web site whose content can be formatted to display appropriately on various devices. XML separates the Web page content from its format, allowing the Web browser to display the contents of a Web page in a form appropriate for the display device. Wireless devices use a subset of XML called WML. WML (wireless markup language) allows Web developers to design pages specifically for microbrowsers. Many smart phones and other mobile devices use WML as their markup language. An extension of XSL, called XSLT (Extensible Stylesheet Language Transformations), creates style sheets that describe how to transform XML documents into other types of documents. Scripts,

Applets, Servlets, And Active Controls


Markup languages tell a browser how to display text and images, set up lists and option buttons, and establish links on a Web page. By adding dynamic content and interactive elements such as scrolling messages, animated graphics, forms, pop-up windows, and interaction, Web pages become much more interesting. To add these elements, Web developers write small programs called scripts, applets, servlets, and ActiveX controls.

A script is an interpreted program that runs on the client. That is, a script runs on your computer, instead of running on a Web server.

An applet also usually runs on the client inside of an interpreted program, but the applet itself is compiled. Thus, an applet usually runs faster than a script.

Scripts and applets shift the computational work from the Web server to the client. A servlet, by contrast, is an applet that runs on the server.

Similar to an applet, an ActiveX control is a small program that runs on the client computer, instead of the server. Active controls use ActiveX technology.
Program Development

Program development consists of a series of steps programmers use to build computer programs. The program development life cycle consists of six steps.

1. Analyze Requirements

2. Design Solution

3. Validate Design

4. Implement Design

5. Test Solution

6. Document Solution


The steps in the program development life cycle form a loop. Program development is an ongoing process within system development. Each time someone identifies errors in or improvements to a program and requests program modifications, the Analyze Requirements step begins again. When programmers correct errors or add enhancements to an existing program, they are said to be maintaining the program. Program maintenance is an ongoing activity that occurs after a program has been delivered to users, or placed into production.

1. Analyze Requirements


The first step in program development is to analyze the requirements of the problem the program(s) should solve, so that the programmer can begin to develop an appropriate solution. The Analyze Requirements step consists of three major tasks:
       Review The Requirements
       Meet With The Systems Analyst And Users
       Identify input, processing, output, and data components.

First, the programmer reviews the requirements. The requirements may be in the form of deliverables such as charts, diagrams, and reports. During this step, the programmer also meets with the systems analyst and the users. This enables the programmer to understand the purpose of the requirements from the users’ perspective. the programmer defines the input, processing, output (IPO), and data requirements for each program. Many programmers use an IPO chart to show the input, processing, and output components. An IPO chart identifies a program’s inputs, its outputs, and the processing steps required to transform the inputs into the outputs. Programmers review the contents of the IPO chart with the systems analyst and the users. This allows programmers to be sure that they completely understand the purpose of the program

2. Design Solution


The next step is to design the solution that will meet the users’ requirements. Designing the solution involves devising a solution algorithm to satisfy the requirements. A solution algorithm, also called program logic, is a graphical or written description of the step-by-step procedures to solve the problem. A system can be designed using process modeling (structured analysis and design) or object modeling (object oriented analysis and design).

Structured Design


Structured design sometimes called top-down design, the programmer typically begins with a general design and moves toward a more detailed design. This approach breaks down the original set of requirements into smaller, more manageable sections. The first step in top-down design is to identify the major function of a program, sometimes called the main routine or main module. Next, the programmer decomposes the main routine into smaller sections, called subroutines or modules.

Object-Oriented Design


The programmer packages the data and the program (or procedure) into a single unit, an object. When the structure of an object changes, any program that accesses the object automatically accesses the change.

A control structure, also known as a construct, the logical order of program instructions. Three basic control structures are sequence, selection, and repetition.

Sequence Control Structure


A sequence control structure shows one or more actions following each other in order. Actions include inputs, processes, and outputs. All actions must be executed; that is, none can be skipped.

Selection Control Structure A selection control structure tells the program which action to take, based on a certain condition. Two common types of selection control structures are the if-then-else and the case.

Repetition Control Structure


The repetition control structure enables a program to perform one or more actions repeatedly as long as a certain condition is met. Many programmers refer to this construct as a loop. Two forms of the repetition control structure are the do-while and do-until.

3. Validate Design


Once programmers develop the solution algorithm, they should validate, or check, the program design for accuracy. During this step, the programmer checks the logic for accuracy and attempts to uncover logic errors. A logic error is a flaw in the design that causes inaccurate results. Two techniques for reviewing a solution algorithm are a desk check and an inspection.

4. Implement Design


Implementation of the design includes using a program development tool that assists the programmer by generating or providing some or all code, or includes writing the code that translates the design into a computer program and, if necessary, creating the user interface. Coding a program involves translating the solution algorithm into a programming language (sometimes on paper) and then typing the programming language code into the computer.

5. Test Solution


Once a programmer codes and enters the program, the next step is to test it. Testing is very important. The goal of program testing is to ensure the program runs correctly and is error free. Errors uncovered during this step usually are one of two types: (1) syntax errors or (2) logic errors. A syntax error occurs when the code violates the syntax, or grammar, of the programming language. Misspelling a command, leaving out required punctuation, or typing command words, called keywords, out of order all will cause syntax errors. The process of locating and correcting syntax and logic errors in a program is known as debugging the program. The program errors themselves are the bugs. Thus, removing the errors is debugging.

6. Document Solution


The programmer should be sure all documentation is complete and accurate. This becomes especially valuable if the program requires changes in the future. Proper documentation greatly reduces the amount of time a new programmer spends learning about existing programs.