You are on page 1of 18

UNIT 1 -Programming

Week [01] – Introduction to Programming

1
Unit – Learning Outcomes

▪ LO1. Define basic algorithms to carry out an operation and


outline the process of programming an application.
▪ LO2. Explain the characteristics of procedural, object-oriented
and event-driven programming, conduct an analysis of a suitable
Integrated Development Environment (IDE).
▪ LO3. Implement basic algorithms in code using an IDE.
▪ LO4. Determine the debugging process and explain the
importance of a coding standard.

2
Lesson Learning Outcome
Pass Merit Distinction

LO1 Define basic algorithms to carry out an operation and


outline the process of programming an application

P1 Provide a definition of M1 Determine the step taken D1 Examine the


what an algorithm is and from writing code to implementation of an
outline the process in execution. algorithm in a suitable
building an application. language. Evaluate the
relationship between the
written algorithm and the
code variant.

3
A Computer Program

▪ A computer program is a collection of instructions that


performs a specific task when executed by a computer.
▪ In 1945 John von Neumann outlined the architecture of
the modern computer with a “Stored Program
Concept”.
▪ In this the program contains a one-at-a-time sequence
of instructions that the computer follows.

4
Stored Program Concept

5
App | Program | Script

▪ App- Most people think of an 'app' as an application on an


Apple computer or a program on a smartphone or a tablet.
▪ But, App (Application) = Program
▪ Script- Is not compiled but needs an interpreter to translate
the script into something the computer understands.

▪ Script once written can run on any platform.

6
Why Programming?

▪ Programming helps you understand computers.


▪ Writing a few simple programs increases your
confidence level.
▪ It will increase your appreciation of what programmers
and computers can do.

7
Programming Languages

8
Generation of Languages
Generation Pros Cons Examples

1st Generation No translation needed Very difficult to use


Machine Code
(Machine Code) Execution is fast Machine dependent

Simple translation High development effort


2nd Generation Assembly
(Assembly) Execution is fast Machine dependent Language

3rd Generation Easier to use Need complex translation C, C++, Java,


(Procedural) Machine independent Efficiency is low Python

4th Generation Even a layman can use Limited functionality


SQL
(Non Procedural) Need not say HOW to process Very low efficiency

5th Generation Has intelligent features Very limited applications PROLOG,


(Artificial Intelligence) Powerful interpreters Difficult to understand LISP

9
High Level Languages - Classification

10
Imperative vs Declarative Languages

Imperative Declarative

High level programming language High level programming language

Compare Need complex translation Need complex translation

User friendly User friendly

Commands express HOW to process Commands express WHAT we know

Contrast Algorithms are needed for solutions Algorithms not needed

Can be compiled or interpreted Mostly interpreted

11
Program Translation

3 options
▪ Natively compiled languages

▪ Interpreted languages

▪ Hybrid languages

12
Natively Compiled Languages

▪ Compiler(s) convert the source code to native code (machine code).


▪ Large software are written in such languages.
▪ E.g., Office suites, IDEs, Compilers, Games, Time and Mission critical applications

13
Interpreted Languages

▪ The source code is executed line by line by a software called interpreter.


▪ Often slower than the compiled languages because of a number of reasons

14
Hybrid Languages

▪ Source code is converted to an intermediate language that is


embedded in a executable or any sort of file.

▪ Then the virtual machine or interpreter executes the


intermediate language during the runtime of the application.

▪ This methodology proved to improve the performance of


interpreted languages.

15
Hybrid Languages

16
Compiled vs Interpreted

17
Lesson Summary

▪ Program – App – Script – Definitions


▪ Stored Program Concept
▪ Why Programming?
▪ Generation of Programming languages
▪ Classification of High level languages
▪ Compiled, Interpreted & Hybrid translation models
▪ Compiled vs Interpreted – Advantages and
Disadvantages
18

You might also like