1 what is programming language? a language that is acceptable to computer system is called as...

29
1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa Mishra

Upload: valentine-barrett

Post on 21-Jan-2016

236 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

1

What is Programming Language?

A language that is acceptable to computer system is called as Computer Language or Programming Language

Prepared by Mrs.Deepa Mishra

Page 2: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 2

Types of Programming Languages

Machine-Level Assembly-Level High-Level

Page 3: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 3

Machine-Level Language

Only Lang understood by computer Consist of 0’s and 1’s It has two part format

OpcodeIt tells computer what function to perform

OperandIt tells where to find or store the data, or other

instructions

Page 4: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 4

Advantages & Disadvantages

Advantages Faster Execution

Disadvantages Machine dependent Difficult to program Error prone Difficult to modify

Page 5: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 5

Assembly Language

Designed in 1952 Alphanumeric mnemonics codes instead of numeric

codes for instructions Each line consists of 4 columns [Label]<Opcode><Operand>[;comment] Example

Label Opcode Operand Comment

BEGIN ADD A,B ;Add B to A

Page 6: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 6

Advantages & Disadvantages

Advantages Easy to understand & use Easy to correct and locate errors Easy to modify

Disadvantages Machine dependent Knowledge of h/w required

Page 7: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 7

Assembler

AssemblerInput Output

Assembly Lang Program

Machine Lang Program or m/c code or object code

Definition: Converts Assembly Lang program into it’s equivalent machine

Lang program

Page 8: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 8

High-Level Languages

Overcome limitations of Low level Languages( Machine & Assembly Language)

Page 9: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 9

Compiler

CompilerInput Output

High-Level Lang Program/sourceprogram eg. Hello.c

Machine Lang Program /object program eghello.exe

Translate high levele lang. instructions into m/c lang. instructions

Page 10: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 10

Interpreter

ResultSource program Interpreter( Translates & Executes statement-by-statement)

Fig. Role of Interpreter

Translates statement-by-statement instruction into machine Lang & immediately executes resulting Machine Lang instruction

Data

Page 11: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 11

Linker

Source File 1 Source File 2 Source File 3

Compiler

Object File 1 Object File 2 Object File 3

Compiler Compiler

Linker Program Library

Executable File

Fig. Role of Linker

Page 12: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 12

Loader

Loader is component of compiler Locates given program in offline storage Loads into main memory for execution

Page 13: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 13

Advantages of High level Lang.

Machine Independent Easy to Learn and Use Less Errors

Disadvantages Lower Efficiency

Page 14: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 14

FORTRAN

FORmula TRANslation. Designed for scientific and mathematical applications by scientists and

engineers. Fortan is refered as scientific language First high level language, using first complier Algebra based language General purpose and procedural language Oldest HLL BY JOHN BACKUS Initial release of FORTAN is for IBM 704contained 32 statement. American Standard Association (ANSI)formed a committee to develop

FORTRAN

Page 15: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 15

COBOL

COmmon Business Oriented Language. Developed in 1959 (Conference on Data System languages) Best File handling capability Typically used for business applications. It is Self documenting, truly connotative ie permits both

long names (up to 30 characters) and word connector char (dashes)

It has large set of class libraries offers object oriented features , visual programming languages.

Integration with world wide web.

Page 16: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 16

BASIC

Beginner’s All-purpose Symbolic Instruction Code. Today, it is not used to develop the programs but used to teach

fundamentals of programming Interpreted language BASIC allows Loops, input from keyboard, MENU driven application ,

Structured programming. Programme Structures

REM

PRINT

END

Example

PRINT “ HELLO WORD”

END

Page 17: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 17

Pascal

● Named after French philosopher and mathematician Blaise Pascal.● It is imperative and Procedural Programming language.● It is strongly typed block structured programming language● Start with keyword begin● Teaching Lang.● Platform independent● Used for scientific computational appl.● PASCAL Program :PROGRAM HelloWorld;BEGINWRITELN(“HELLOWORLD”);END

Page 18: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 18

SNOBOL

● String Oriented And Symbolic Language● It is a text string oriented languages, Oriented towards string

data handling.● It has the facility of pattern matching● SNOBOL 4 has no type declaration and no restriction on

data type so it is dynamically typed. ● Interpretive Language i.e compiler translates program into a

notation that the interpreter can easily execute.● Used as research tool rather than commercial application.● Used for analysis of Literature and music. ● Computer experts use SNOBOL for database programme.

Page 19: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 19

C

Developed at Bell Laboratories in the 1972 by Dennis Ritchie.

Provides efficiency of assembly language while having third generation language features.

Often used for system programs. UNIX is written in C. Easy to learn and use Rich set of in built functions

Page 20: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 20

C++

Developed by Bjarne Stroupstrup in 1983 It is C language with additional features. Object oriented language Designed for Unix system // title of the program //comment

# include<iostream.h>

Void main()

{

Cout<<“hello world”;

}

Page 21: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 21

JAVA

Developed by Sun Microsystem in 1991 An object-oriented language Platform independent Jvm is m/c dependent Java is complied into special machine code called byte

code and because of byte code java does not perform as fast as c++.

Applications Used to create WWW applets Used for cross platform application development to create network applications.

Page 22: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 22

LISP

● LISt Processing Language● Language based on lambda calculus. (Mathematical

notation for expressing functions.)● Oldest HLL second to Fortran.● Permit the use of recursion● Used in AI research

Page 23: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 23

MATLAB

MATrix LABoratory Possesses tools for building custom GUI Includes mathematical functions

Linear algebra, Fourier analysis, numerical integration USE

Image & signal processingIt is also known as language of technical computation.In this C, C++, java or excel code can be integrated.2D & 3D visualization options are given for better representation of

results

Page 24: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 24

Octave (Gnu octave)

• Open source free license software.• Same as MATLAB.• All commands which work in MATLAB can be used in this

software.• ADVANTAGES• Works on Windows as well as Linux.• Can give 2D & 3D graphics views.• DISADVANTAGES• Newly arrived software so may contain bugs.• Lack of proper support.• Performance is not proved till now.

Page 25: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 25

Scripting Lang

A scripting language is a form of programming language that is usually interpreted rather than compiled.

Used for web development Examples: Javascript ,vbscript,html etc Used for writing scripts Used to create GUI & forms in search engines, web

based e-mail Eg: java script, VB script,ASP,JSP, perl, ruby,tcl,shell

& python

Page 26: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 26

Scripting languages

Advantages• Easier to write code than in compiled lang. Minimum prog. Knowledge is required Allow rapid development & can communicate easily with

program written in other lang. Editing & running scripting code is fast Limitation• More time required for interpretation.• Hard to debug as no development environment is

available by default• All script. Lang. not supported by all system.• S.L are text based it is easy to modify & break by others

Page 27: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 27

Characteristics of Good PL Portability –M/c independent Simple & readable. Reliability Performance Reusability Modularity Structured programming

Page 28: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 28

Selecting Language for Coding

Selecting Lang out of many available Languages for coding an Application depending on following factors

Nature of Application-if the application is O.S intensive go for C,C++.

If app. Is O.S independent go for java Familiarity with Lang Ease of Learning Lang When developing wed page go for JSP. Execution Efficiency

Page 29: 1 What is Programming Language? A language that is acceptable to computer system is called as Computer Language or Programming Language Prepared by Mrs.Deepa

Prepared by Mrs.Deepa Mishra 29

Subprograms

Subroutine is a set of instructions that perform a specific task for a main routine & transfer control back to main routine

Addition(x,y)

//code to perform intended task

header

body