programming language

40

Upload: fahad-khan

Post on 18-Jul-2015

277 views

Category:

Engineering


2 download

TRANSCRIPT

Fahad Khan AU-038

Abdul Aziz Khan AU-009

Muhammad Saad AU-033

Zaid Bin Mansoor AU-022

Abdul Samad AU-033

2

Computer

Programming

Computer Programming involves writing instructions and giving them to the computer to complete a task

Computer Programs are also named as Software.

Well designed programs must be:

◦ Correct and accurate

◦ Easy to understand

◦ Easy to maintain and update

◦ Efficient

◦ Reliable

◦ flexible

LANGUAGES

Set of rules for Computer to perform tasks

English is a natural language. It has words, symbols and grammatical rules.

A programming language also has words, symbols and rules of grammar.

The grammatical rules are called syntax.

Each programming language has a different set of syntax rules.

Machine

Language

Assembly

Language

High-Level

Language

Writability

Readability

Reliability

Maintainability

Standardability

◦ Correct and accurate

◦ Easy to understand

◦ Easy to maintain and update

◦ Efficient

◦ Reliable

◦ flexible

Source Code Compiler Object Code

Source Code Interpreter

Execute Program

Execute a line

of Program

Using Compiler:

Using Interpreter:

Variables are names for memory locations.

each memory location in a computer has an address.

A programmer can use a variable to store the integer

value of a score received in a test.

An expression is a sequence of operands and operators that reduces to a single value.

For example, the following is an expression with a value of 13:

An operator is a language-specific token that requires an action to be taken. The most familiar operators are drawn from mathematics

1. Parenthesis

2. Exponentiation

3. Multiplication/Division

4. Addition/Subtraction

3 * (6 + 2) / 12 – (7 – 5) ^ 2 * 3 ( ) first

= 3 * 8 / 12 – 2 ^ 2 * 3 ^ next

= 3 * 8 / 12 – 4 * 3Mult/Div (L to R)

= 24 / 12 – 4 * 3Mult/Div (L to R)

= 2 – 12Add/Subtr

= -10

HISTORY OF PROGRAMMING

C is a general-purpose language which has been closelyassociated with the UNIX operating system for which

it was developed - since the system and most of the programsthat run it are written in C.

Many of the important ideas of C stem from the language BCPL,developed by Martin Richards. The influence of BCPL on Cproceeded indirectly through the language B, which was writtenby Ken Thompson in 1970 at Bell Labs, for the first UNIX systemon a DEC PDP-7.BCPL and B are "type less" languages whereas Cprovides a variety of data types.

FIRST PROGRAM

The first programming languages designed tocommunicate instructions to a computer were written in the 1950s. An early high-level programming languageto be designed for a computer was Plankalkül,

developed for the German Z3 by Konrad Zusebetween 1943 and 1945. However, it was notimplemented until 1998 and 2000.

programming languages are used to make

Web Browsers Word Processor Games

File Sharing Programs

If you are asking about different uses for different languages, then here is a brief list:C - good for embedded systems, micro-controllers, or software that needs to interact with devices and hardware on a lower level. Operating systems often use C in parts of it. It can be difficult to use at times. Compiled C programs are often relatively small (in terms of file size)... this makes it useful for micro-controllers that have limited storage space.

C++ - Good for general purpose programming. Its built in library set is fairly limited, compared to many modern languages. (programming libraries are functions and features that are pre-built and provided to the programmer) However, popular 3rd party API's and libraries are readily available for free and can make up for these short comings. C++ is fairly complex, but has high performance and this makes it good for large applications and games.

Easy to learn and use. It also can use the .NET framework/libraries which are extremely useful for developing windows programs. It is a high level language and its versatility is a bit limited compared to languages like C++. It also is not built for performance. It was made to quickly and rapidly build relatively small Windows applications. It can also be used on web servers to create dynamic websites.

A strong general purpose language. It is a bit slower than C++, but it has large libraries and many features built in to it. Java programs can run on all systems without being modified or re-compiled. This portability is a major feature of java. However, Java apps often use more memory due to the way they run on a virtual machine, instead of being directly executed. This also slows the programs down a bit. It is a strong general purpose language and I have seen fairly large programs written in it. However, you will not find high-performance apps written in Java. While not the simplest of languages, it is still relatively easy to learn for a programmer.

It is kind of like microsoft's response to Java. The style of programming is very similar to java. It is not portable though. However, it does allow use of the .NET framework/libraries and it is more versatile than Visual Basic. This makes it useful for windows applications. It is also used on Windows based web servers to make nice, dynamic websites on the server side. I have noticed that C# programs tend to use more RAM.

Easy for programmers to pick up. It is primarily used as a server-side scripting language to dynamically generate web pages. It also works with common databases very well. It is very common for web development, but not used for much else.

- VERY difficult to use, but it allows low level programming. This makes it useful for situations in which efficiency or low level control is critical. This is not commonly used, but you do see it used occasionally for small bits in performance critical software and operating systems. It is used a bit more for micro controllers and embedded devices, but C is still often better due to assembly's difficulty.

Often used as a beginner language. However it is a fairly useful scripting language. (scripting languages are not compiled directly into machine code before they are run. Instead they are converted as they are run). It is not generally used for large apps, but it is relatively easy to learn.

Driverless Car

Eye Sensing Password Unlocker