0% found this document useful (0 votes)
7 views

Programming Languages and uses

The document provides an overview of programming languages, their development, and the program development life cycle (PDLC). It details different generations of programming languages, from machine language to natural languages, and explains the roles of compilers and interpreters in translating source code. Additionally, it outlines the PDLC phases, including analysis, design, coding, testing, deployment, and maintenance.

Uploaded by

Hessa Al Maadeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Programming Languages and uses

The document provides an overview of programming languages, their development, and the program development life cycle (PDLC). It details different generations of programming languages, from machine language to natural languages, and explains the roles of compilers and interpreters in translating source code. Additionally, it outlines the PDLC phases, including analysis, design, coding, testing, deployment, and maintenance.

Uploaded by

Hessa Al Maadeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Programming Languages

& Program Development


• Programming is the creation of 2] 2nd Generation: Assembly
software applications. Language:
• Programmers are the people who • Machine dependent
create the software applications. • Programs use:
• A programming language is used -Mnemonics, brief abbreviations for
by programmers to create software program instructions which makes
that the computer understands. assembly language easier to use than the
• Syntax is the vocabulary and rules machine language
of a programming language. -Base-10 (decimal) numbers
• Source code, the programming • Must be translated into machine
instructions in their original form, language
which need to be translated into a • The danger of writing spaghetti
form that the computer can code is especially great caused by
understand. GOTO statements
• GOTO statements make code
DEVELOPMENT OF difficult to follow and prone to errors
PROGRAMMING LANGUAGES: bubble:
r2 = 0
• Five distinct programming start;puter:
r4 = r0 - 1
language generations if (r2 >= r4) goto end_outer

Non- r3 = 0
Machine Assembly High Level Procedural Natural
Language Language Language Language start_1nner:
Language r5 = r4 - r2
if (r3 >= r5) goto end_inner
1] 1st Generation: Machine sort2(r1+r3*4,r1+r3*4+4)

Language: r3 = r3 + 1
goto start_inner
• Based on binary numbers end_inner:
r2 = r2 + 1
• The only programming language goto start_outer
end_outer:
that a computer (CPU) understands return

directly
• Machine dependent: Each family 3] 3rd Generation: High Level
of processors has its own machine Languages:
language • Do not require programmers to
Program Fragment: Y = Y + X know details relating to the
Machine Language Code processing of data
(Binary Code)
• Machine independent
Dpcode
1100 0000
Address
0010 0000 0000 0000 • Easier to read, write, and maintain
1011 0000
1001 0000
0001 0000 0000 0000
0010 0000 0000 0000 than assembly and machine lang.
Memory Cell Definitions: • Source code must be translated by
Addr. Name Cell Contents a language translator
1000 X 32
2000 Y 18

1
• Translators: -The finished compiled program runs
-Compilers translate source code into faster than an interpreted program
object code (object program) because the interpreter is constantly
-Interpreters translate source code one translating and executing as it goes.
line at a time and execute instructions -The interpreter immediately displays
without creating an object code feedback when it finds a syntax error.
C++ Program Java Program
Thus, the programmer can correct any
errors or debug the code before the
Ready-to-use
interpreter evaluates the next line. They
program file Machine
Language
immediately see the results of changes as
Compiler 1 11 0 Interpreter
0 0 011001 they are making them in the code.

• Types of High Level Languages


• Compilation: (Not mutually exclusive):
-Compilation: Converting source code Procedural

High Level Languages


into object program
Event-driven
-After compilation, programmers have
an executable program (object program) Visual

Source Object OOP


Compiler Results
Program Program
Web-based

Data
-Procedural Languages:
+A sequence of instructions to run,
• Interpreter: which uses program control structures
-Interpreter translates source code line by (IF, Loops, Functions…)
line +Examples: PASCAL, BASIC, COBOL,
-Each line is executed before the next line FORTRAN
is processed
-Programmers do not have to wait for the -Event-driven Languages:
entire program to be reprocessed each +Waits for events (mouse click, button
time they make a change press…) to process a defined set of
instructions (event handler)
Source
Program +Examples: C++, Javascript
Interpreter Results
-Visual Languages:
Data
+Allow programmer to manipulate
items visually on a form setting their
• Compilation vs. Interpretation: layout and properties.
-The compilation process takes longer +Creating Graphical User Interface
than the interpretation process because (GUI) applications.
in compilation, all of the lines of source +Examples: Visual Basic, Visual C++,
code are translated into machine Delphi
language before any lines are executed.
2
-Web-based Languages: 5] 5th Generation: Natural
+Uses special coding instructions to
Languages:
indicate style and layout of text and other
elements of web sites. • Non-procedural
+Mark-up and scripting languages. • Uses everyday language to
+Examples: HTML, XML, ASP program
• Example: Prolog
-OOP (Object Oriented Languages)
+Coding is attached to basic prebuilt items
called objects, which include:
• Data
• Attributes that define the data
• Procedures or operations called
methods
• An interface to exchange messages
with other objects
+Relies on reusability
+Makes information hiding
(encapsulation) a reality Sample Code for Language
+Examples: C#, Java, Python Generations:
Gen. Example Sample Code
4] 4 Generation:
th
1st Machine
Bits describe the commands to the CPU.
1110 0101 1001 1111 0000 10111110 0110
Non-Procedural Languages: Words describe the commands to the CPU.
2nd Assembly
• Non-procedural languages ADD Register 3, Register 4, Register 5

• Do not require step-by-step 3rd


FORTRAN,
BASIC, C, Java
Symbols describe the commands to the CPU.
TotalPay = Pay + OvertimePay
procedures to achieve the More powerful commands allow complex
appropriate programming outcome 4th SOL
work to be done in a single sentence.
SELECT isbn, title, price, price*0.06 AS
• Allows complex operations to be sales tax FROM books WHERE
price> 100.00 ORDER BY title;
processed in one statement Programmers can build applications
• Examples: 5th PROLOG
without specifying an algorithm.
Find all the people who are
-Database report generators Mike's cousins as: ?-cousin (Mike, family)

-Query languages: Structured Query


Language (SQL)
One Size Doesn’t Fit All: check the
table in slide (22)
SELECT LAST_NAME. FIRST_NAME. NET_AMOUNT_DUE
FROM CUSTOMER
WHERE DISCOUNT_CODE <> 0 QUERY
ORDER BY LAST_NAME: Top Programming Languages of
LASLNAME
Baker
FIRST_NAME
Mark
NET_AMOUNT_DUE
54.12
2016:
RESULT
Dolton
Francis
June
Anna
678.10
101.45
C++ - C# - Java - Java Script - PHP -
Python - SQL - IOS - Ruby/Rails

3
PROGRAM DEVELOPMENT LIFE • Desk Checking
CYCLE (PDLC): -An important design tool
• An organized plan for breaking -The main purpose of desk checking the
down the task of program algorithm is to identify major logic
development into manageable parts errors early, so that they may be easily
corrected
Analysis -Logic errors are bugs that cause
program to run incorrectly and produce
undesired outputs
Deployment Design -Test data needs to be walked through
PDLC
each step in the algorithm, to check that
Phases
the instructions described in the
algorithm will actually do what they are
supposed to
Testing Coding

3] Coding:
-PDLC Phases- • Process of creating SW applications
1] Analysis: • Programmers use programing
• Defining the problem languages to convert algorithms into
• Interviews, questionnaires and source code
observation • Syntax errors:
• System analysts collect the user -Mistakes in the construction of the
requirements and specify the programming commands
program specifications specs -Must be corrected for the program to
• Specs define IPO run
-Input data • Integrated Development
-Processing Environment (IDE) helps
-Output data programmers write and test their
• Specs also include the appearance programs.
of user interface

2] Design:
• Program design identifies
components of the program
-Top-down program design breaks
program into small, manageable, highly
focused subroutines
-Structured design uses control
structures
-Algorithm
• They are not mutually exclusive

4
• Version Control SW: 5] Deployment and
-SW tools that help team members Maintenance:
manage changes to the source code over • Deployment: All processes
time involved in getting new SW up and
-Keeps track of every modification by
running properly in its environment,
each contributor
including installation, configuration
-Developers can turn back to earlier
versions to help fix any mistakes running, testing and making
-Example tools: Git, CVS, SVN, Mercurial necessary changes
and Bazaar…. • Maintenance: Evaluate the
program on a regular basis

4] Testing: • Documenting the Program:


• Assessing the functionality of SW -Throughout the PDLC
program -Documentation includes:
+Program design work
• Two main categories: Dynamic and
+Overview of program
static
functionality
• Static Testing: Manual or +Thorough explanation of main
automated review for: features
-Code (static code reviews) +Tutorials
-Requirements and design documents +Reference documentation of
(technical reviews) program commands
• Dynamic Testing: Check the +Description of error messages
functional behavior of a SW unit by
entering test data and comparing
results to the expected results
• Dynamic Testing Opacity:
Opacity (view of code):
-Black-box testing:
+Tester has no knowledge of code
+Often done by someone other
than the coder
-White-box testing:
+Testing all possible logic paths in the
software unit
+Deep knowledge of the logic
+Makes each program statement
execute at least once

5
#Exercises: 15. ................... testing is conducted when
• Differentiate between: tester has no knowledge of code.
1. Source and machine code 16. Assessing the functionality of SW
2. White and black box testing program is called ................... .
3. Logic and syntax errors 17. The main purpose of ................... the
4. Compiler and interpreter algorithm is to identify major logic errors
5. Dynamic and static testing early to be easily corrected.
20. Evaluating the program on a regular
• Complete: basis is called ................... .
1. The ................... phase of PDLC includes 21. ................... translates source code one
identifying syntax errors. line at a time and execute instructions
2. Testing all possible logic paths in the without creating machine code.
software unit, with thorough knowledge 22. Phases of PDLC are ................... , ................. ,
of the logic is called ................... . ................... , ................... and ................... .
3. ................... allows complex operations to
be processed in one statement, e.g. report
generators and query languages.
4. ................... testing checks functional
behavior of SW by entering test data and
comparing results to expected results.
5. ................... are brief abbreviations for
program instructions that make assembly
language easier to use.
6. Interviews, questionnaires and
observation are employed in the ...................
phase of PDLC.
7. ................... is the vocabulary and rules of
a programming language.
8. ................... is the only programming
language that a computer (CPU)
understands directly.
9. ................... converts source code into
object program.
10. ................... are mistakes in construction
of programming commands which must
be corrected for program runs.
11. ................... are the processes involved in
getting new SW up and running properly
in its environment.
12. ................... and ................... are machine
dependent languages.
13. ................... code is full of GOTO
statements, which make code difficult to
follow and prone to errors.
14. The compilation process takes
................... time than the interpretation
process.
6

You might also like