Chapter 1-Introduction To Programming Language
Chapter 1-Introduction To Programming Language
Upon completion of this course, students should be able to: 1) Explain the basic computer and programming fundamentals with appropriate examples of language and technology.
SPECIFIC OUTCOME
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
Understand the computer fundamentals. Discuss the evolution of programming language. Explain fundamentals of programming language.
COMPUTER SYSTEM
include the computer along with any software and peripheral devices that are necessary to make the computer function
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
A system of interconnected computers that share a central storage system and various peripheral devices such as a printers, scanners, or routers. Each computer connected to the system can operate independently, but has the ability to communicate with other external devices and computers.
SOFTWARE COMPONENTS
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
APPLICATION
a sequence of instructions written to perform a specified task for a computer A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute the instructions
Types of OS
GUI (graphical user interface )
Multi-user
allows concurrent access by multiple users of a computer
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
allows users to interact with electronic devices with images rather than text commands.
Multiprocessing
use of two or more central processing units (CPUs) within a single computer system
Multitasking
method where multiple tasks (processes), share common processing resources such as a CPU
Multithreading
provides a way to have more than one thread executing in the same process
Application
Before1940
The 1990s : Internet age Haskell, Python, Visual Basic, Ruby, Lua, CLOS, Java, Delphi, JavaScript, PHP, Rebol, D
The 1980s C++, Objecyive-C, Ada,Common Lisp, Eiffel, Erlang, Perl, Tcl, FL
1967 1978 Logo, B, Pascal, Forth, C, Smalltalk, Prolog, ML, Scheme, SQL
Current trend C#, Visual Basic . NET, F#, Scala, Factor, Windows Poer shell, Clojure, Groovy, Go
11
12
MACHINE LANGUAGES
only languages understood by computers
Also called machine code A set of instructions for a specific central processing unit, designed to be usable by a computer without being translated impossible for humans to use because they consist entirely of numbers The lowest-level programming language sometimes called native code when referring to platform-dependent parts of language features or libraries Every CPU has its own unique machine language. Programs must be rewritten or recompiled, therefore, to run on different types of computers
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
13
ASSEMBLY LANGUAGES
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices
implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture
usually defined by the hardware manufacturer, and is based on mnemonics that symbolize processing steps (instructions), processor registers, memory locations, and other language features
same structure and set of commands as machine languages, but they enable a programmer to use names instead of numbers
an assembly language program written for one type of CPU won't run on another
14
rd 3
GENERATION LANGUAGES
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
Example: Fortran, ALGOL, and COBOL, C, C++, C#, Java, BASIC and Delphi
15
th 4 GENERATION LANGUAGES
a programming language or programming environment designed with a specific purpose in mind, such as the development of commercial business software
to reduce programming effort, the time it takes to develop software, and the cost of software development
fourth-generation languages are programming languages closer to human languages than typical high-level programming languages.
16
th 5 GENERATION LANGUAGES
designed to make the computer solve a a programming language based given problem without the programmer around solving problems using the programmer only needs to worry about constraints given to the program, what problems need to be solved and what rather than using an algorithm conditions need to be met, without written by a programmer worrying about how to implement a routine or algorithm to solve them
based on artificial intelligence, are still in development, though there are some applications, such as voice recognition
The goal of fifth-generation computing is to develop devices that respond to natural language input and are capable of learning and selforganization
17
TERMINOLOGY
Programmer
someone who writes computer software a specialist in one area of computer programming or to a generalist who writes code for many kinds of software
Program
An organized list of instructions that, when executed, causes the computer to behave in a predetermined manner
Programming
the process of designing, writing, testing, debugging, and maintaining the source code of computer programs
Assembler
A program that translates programs from assembly language to machine language.
Compiler
a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code)
Translator
A program that translate from one programming language into another
19
Structured Programming
the top-to-bottom approach
FP 101 : PROGRAMMING PRINCIPLES (CHAPTER 1)
It splits the tasks into modular forms. This makes the program simpler and easier to read with less lines and codes
This type of program accomplishes certain tasks for that a specific reason
decomposed into a hierarchy of processes. A process in this context is a body of code, typically a function or subroutine, that takes some input and manipulates it to produce an output
. A process may be composed of other, more specialized processes, i.e., it may be a function that calls other functions
20
It splits the program into objects that can be reused into other programs
Each object or module has the data and the instruction of what to do with the data in it. This can be reused in other software
An object-oriented program is decomposed into a network of collaborating objects. An object represents a thing or concept and has a known set of behaviours that may be invoked by other objects
21
Structured programming is as follows: --Program start var var var function { ... } function { ... } function { ... } main { ... } --- Program End
22
Object oriented is as follows: --- Program Start object { var var function { ... } function { ... } function { ... } } var var function { ... } main { ... } --- Program end
23
Structured vs Programming
24