Introduction to Programming: Understanding the Basics of Computational Thinking, Lecture notes of Computer science

An overview of programming fundamentals, including the stored program concept, programming languages, and their classification. Students will learn about procedural, object-oriented, and event-driven programming, as well as the advantages and disadvantages of compiled and interpreted languages. By the end of this unit, learners will be able to define basic algorithms and outline the process of programming an application.

Typology: Lecture notes

2020/2021

Uploaded on 05/16/2021

don-tharindu
don-tharindu 🇱🇰

1 / 19

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Programming
LESSON [01] INTRODU C TION TO P ROGRAMMING
Introduction to Programming UNIT1 - PROGRAMMING 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download Introduction to Programming: Understanding the Basics of Computational Thinking and more Lecture notes Computer science in PDF only on Docsity!

Programming

LESSON [01] – INTRODUCTION TO PROGRAMMING

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-orientated 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

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.

Stored Program Concept

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.

Programming Languages

Generation of Languages

Generation Pros Cons Examples

st Generation

(Machine Code)

No translation needed Very difficult to use

Machine Code

Execution is fast Machine dependent

nd Generation

(Assembly)

Simple translation High development effort Assembly

Language Execution if fast Machine dependent

3rd Generation

(Procedural)

Easier to use Need complex translation C, C++, Java,

Python Machine independent Efficiency is low

4th Generation

(Non Procedural)

Even a laymen can use Limited functionality

SQL

Need not say HOW to process Very low effciency

th Generation

(Artificial Intelligence)

Has intelligent features Very limited applications

PROLOG, LISP

Powerful interpreters Difficult to understand

High Level Languages - Classification

Imperative vs Declarative Languages

Imperative Declarative

Compare

High level programming language High level programming language

Need complex translation Need complex translation

User friendly User friendly

Contrast

Commands express HOW to process Commands express WHAT we know

Algorithms are needed for solutions Algorithms not needed

Can be compiled or interpreted Mostly interpreted

Program Translation

3 options

 Natively compiled languages

 Interpreted languages

 Hybrid languages

Interpreted Languages

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

Often slow than the compiled languages because of a number of reasons.

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

Compiled vs Interpreted