Lesson+1

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Introduction to Programming

BY: Muchina S.K


Structured Programming
• Structured programming is a procedural programming subset that
reduces the need for goto statements.
• Enforces a logical structure on the program being written to make it
more efficient and easier to understand and modify.
• In many ways, OOP is considered a type of structured programming
that deploys structured programming techniques.
Types of structured programming languages
• COBOL
• PASCAL
• ADA and
• Algorithmic Language (ALGOL)
• Are designed to enforce structured programming.
History
• The structured programming concept was formalized in 1966 by
Corrado Böhm and Giuseppe Jacopini, who demonstrated theoretical
computer program design through loops, sequences and decisions. In
the late 1960s-early 1970s, Edsger W.Dijkstra developed structural
programming functionality as a widely used method, in which a
program is divided into multiple sections with multiple exits and one
access point.
• Modular programming is another example of structural programming,
where a program is divided into interactive modules.
History of programming languages
• Computer programming is essential in our world today, running the systems for
almost every device we use. Computer programming languages allow us to tell
machines what to do. Machines and humans “think” very differently, so
programming languages are necessary to bridge that gap.
• The first computer programming language was created in 1883, when a woman
named Ada Lovelace worked with Charles Babbage on his very early mechanical
computer, the Analytical Engine. While Babbage was concerned with simply
computing numbers, Lovelace saw that the numbers the computer worked with
could represent something other than just amounts of things. She wrote an
algorithm for the Analytical Engine that was the first of its kind. Because of her
contribution, Lovelace is credited with creating the first computer programming
language. As different needs have arisen and new devices have been created,
many more languages have followed.
• 1883: Algorithm for the Analytical Engine: Created by Ada Lovelace for Charles
Babbage’s Analytical Engine to compute Bernoulli numbers, it’s considered to
be the first computer programming language.
• 1949: Assembly Language: First widely used in the Electronic Delay Storage
Automatic Calculator, assembly language is a type of low-level computer
programming language that simplifies the language of machine code, the
specific instructions needed to tell the computer what to do.
• 1952: Autocode: Autocode was a generic term for a family of early computer
programming languages. The first was developed by Alick Glennie for the Mark
1 computer at the University of Manchester in the U.K. Some consider autocode
to be the first compiled computer programming language, meaning that it can
be translated directly into machine code using a program called a compiler.
• 1957: Fortran: A computer programming language created by John Backus for
complicated scientific, mathematical, and statistical work, Fortran stands for Formula
Translation. It is the one of the oldest computer programming languages still used today.
• 1958: Algol: Created by a committee for scientific use, Algol stands for Algorithmic
Language.
• Algol served as a starting point in the development of languages such as Pascal, C, C++,
and Java.
• 1959: COBOL: Created by Dr. Grace Murray Hopper as a computer programming
language that could run on all brands and types of computers, COBOL stands for
COmmon Business Oriented Language. It is used in ATMs, credit card processing,
telephone systems, hospital and government computers, automotive systems, and
traffic signals. In the movie The Terminator, pieces of COBOL source code were used in
the Terminator’s vision display.
• 1959: LISP: Created by John McCarthy of MIT, LISP is still in use. It stands for LISt
Processing language. It was originally created for artificial intelligence research
but today can be used in situations where Ruby or Python are used.
• 1964: BASIC: Developed by John G. Kemeny and Thomas E. Kurtz at Dartmouth
College so that students who did not have a strong technical or mathematical
understanding could still use computers, it stands for Beginner’s All-purpose
Symbolic Instruction Code. A modified version of BASIC was written by Bill Gates
and Paul Allen. This was to become the first Microsoft product.
• 1970: Pascal: Developed by Niklaus Wirth, Pascal was named in honor of the
French mathematician, physicist, and philosopher Blaise Pascal. It is easy to learn
and was originally created as a tool for teaching computer programming. Pascal
was the main language used for software development in Apple’s early years.
• 1972: Smalltalk: Developed by Alan Kay, Adele Goldberg, and Dan Ingalls at Xerox Palo
Alto Research Center, Smalltalk allowed computer programmers to modify code on the fly
and also introduced other aspects now present in common computer programming
languages including Python, Java, and Ruby.
• 1972: C: Developed by Dennis Ritchie at Bell Labs, C is considered by many to be the first
high-level language. A high-level computer programming language is closer to human
language and more removed from the machine code. C was created so that an operating
system called Unix could be used on many different types of computers. It has influenced
many other languages, including Ruby, C#, Go, Java, JavaScript, Perl, PHP, and Python.
• 1972: SQL: SQL was developed by Donald D. Chamberlin and Raymond F. Boyce at IBM.
SQL stands for Structured Query Language. It is used for viewing and changing information
that is stored in databases. SQL uses command sentences called queries to add, remove,
or view data.
• 1978: MATLAB: Developed by Cleve Moler. MATLAB stands for Matrix
Laboratory. It is one of the best computer programming languages for writing
mathematical programs and is mainly used in mathematics, research, and
education. It can also be used to create two- and three-dimensional graphics.
• 1983: Objective-C: Created by Brad Cox and Tom Love, Objective-C is the main
computer programming language used when writing software for macOS and
iOS, Apple’s operating systems.
• 1983: C++: C++ is an extension of the C language and was developed by
Bjarne Stroustrup. It is one of the most widely used languages in the world.
C++ is used in game engines and high-performance software like Adobe
Photoshop. Most packaged software is still written in C++.
• 1987: Perl: Perl was originally developed by Larry Wall in 1987 as a scripting language designed for text editing. Its
purpose was to make report processing easier. It is now widely used for many purposes, including Linux system
administration, Web development, and network programming.
• 1990: Haskell: Named after Haskell Brooks Curry, an American logician and mathematician. Haskell is called a
purely functional computer programming language, which basically means that it is mostly mathematical. It is
used by many industries, especially those that deal with complicated calculations, records, and number-crunching.
• 1991: Python: Designed by Guido Van Rossum, Python is easier to read and requires fewer lines of code than many
other computer programming languages. It was named after the British comedy group Monty Python. Popular
sites like Instagram use frameworks that are written in Python.
• 1991: Visual Basic: Developed by Microsoft, Visual Basic allows programmers to choose and change pre-selected
chunks of code in a drag-and-drop fashion through a graphical user interface (GUI).
• 1993: R: Developed by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, R is named
after the first names of the first two authors. It is mostly used by statisticians and those performing different types
of data analysis.
• 1995: Java: Originally called Oak, Java was developed by Sun Microsystems. It was intended for cable boxes and
hand-held devices but was later enhanced so it could be used to deliver information on the World Wide Web. Java
is everywhere, from computers to smartphones to parking meters. Three billion devices run Java!
• 1995: PHP: Created by Rasmus Lerdorf, PHP is used mostly for Web development and is usually
run on Web servers. It originally stood for Personal Home Page, as it was used by Lerdorf to
manage his own online information. PHP is now widely used to build websites and blogs.
WordPress, a popular website creation tool, is written using PHP.
• 1995: Ruby: Ruby was created by Yukihiro “Matz” Matsumoto, who combined parts of his
favorite languages to form a new general-purpose computer programming language that can
perform many programming tasks. It is popular in Web application development. Ruby code
executes more slowly, but it allows for computer programmers to quickly put together and run
a program.
• 1995: JavaScript: Created in just 10 days by Brendan Eich, this language is mostly used to
enhance many Web browser interactions. Almost every major website uses Javascript.
• 2000: C#: Developed by Microsoft with the goal of combining the computing ability of C++ with
the simplicity of Visual Basic, C# is based on C++ and is similar to Java in many aspects. It is
used in almost all Microsoft products and is primarily used for developing desktop applications.
• 2003: Scala: Created by Martin Odersky. Scala is a computer programming language that
combines functional programming, which is mathematical, with object-oriented programming,
which is organized around data that controls access to code. Its compatibility with Java makes it
helpful in Android development.
• 2003: Groovy: Developed by James Strachan and Bob McWhirter, Groovy is derived from Java
and improves the productivity of developers because it is easy to learn and concise.
• 2009: Go: Go was developed by Google to address problems that can occur in large software
systems. Since computer and technology use is much different today than it was when languages
such as C++, Java, and Python were introduced and put to use, problems arose when huge
computer systems became common. Go was intended to improve the working environment for
programmers so they could write, read, and maintain large software systems more efficiently.
• 2014: Swift: Developed by Apple as a replacement for C, C++, and Objective-C, Swift is supposed
to be easier to use and allows less room for mistakes. It is versatile and can be used for desktop
and mobile apps and cloud services.
Programming Paradigm
• Paradigm can also be termed as method to solve some problem or do
some task.
• Programming paradigm is an approach to solve problem using some
programming language or also we can say it is a method to solve a
problem using tools and techniques that are available to us following
some approach.
• There are lots for programming language that are known but all of them
need to follow some strategy when they are implemented and this
methodology/strategy is paradigms. Apart from varieties of
programming language there are lots of paradigms to fulfil each and
every demand.
Imperative programming paradigm
It is one of the oldest programming paradigm. It features close relation to machine
architecture. It is based on Von Neumann architecture. It works by changing the program
state through assignment statements. It performs step by step task by changing state. The
main focus is on how to achieve the goal. The paradigm consist of several statements and
after execution of all the result is stored.
Advantage:
• Very simple to implement
• It contains loops, variables etc.
Disadvantage:
• Complex problem cannot be solved
• Less efficient and less productive
• Parallel programming is not possible
• Imperative programming is divided into three broad categories:
Procedural, OOP and parallel processing. These paradigms are as
follows:
Procedural programming paradigm
• This paradigm emphasizes on procedure in terms of under lying
machine model. There is no difference in between procedural and
imperative approach. It has the ability to reuse the code and it was
boon at that time when it was in use because of its reusability.
Object oriented programming
• The program is written as a collection of classes and object which are
meant for communication. The smallest and basic entity is object and
all kind of computation is performed on the objects only. More
emphasis is on data rather procedure. It can handle almost all kind of
real life problems which are today in scenario.
Advantages:
• Data security
• Inheritance
• Code reusability
• Flexible and abstraction is also present
Parallel processing approach
• Parallel processing is the processing of program instructions by
dividing them among multiple processors.
• A parallel processing system posses many numbers of processor with
the objective of running a program in less time by dividing them.
• This approach seems to be like divide and conquer.
• Examples are NESL (one of the oldest one) and C/C++ also supports
because of some library function.
2. Declarative programming paradigm
• It is divided as Logic, Functional, Database.
• In computer science the declarative programming is a style of building
programs that expresses logic of computation without talking about its
control flow.
• It often considers programs as theories of some logic.It may simplify writing
parallel programs. The focus is on what needs to be done rather how it
should be done basically emphasize on what code code is actually doing.
• It just declare the result we want rather how it has be produced. This is the
only difference between imperative (how to do) and declarative (what to
do) programming paradigms. Getting into deeper we would see logic,
functional and database.
Logic programming paradigms
• It can be termed as abstract model of computation. It would solve
logical problems like puzzles, series etc. In logic programming we have a
knowledge base which we know before and along with the question
and knowledge base which is given to machine, it produces result.
• In normal programming languages, such concept of knowledge base is
not available but while using the concept of artificial intelligence,
machine learning we have some models like Perception model which is
using the same mechanism.
• In logical programming the main emphasize is on knowledge base and
the problem. The execution of the program is very much like proof of
mathematical statement, e.g., Prolog
Functional programming paradigms
• The functional programming paradigms has its roots in mathematics
and it is language independent.
• The key principal of this paradigms is the execution of series of
mathematical functions.
• The central model for the abstraction is the function which are meant
for some specific computation and not the data structure. Data are
loosely coupled to functions.
• The function hide their implementation. Function can be replaced
with their values without changing the meaning of the program.
Some of the languages like perl, javascript mostly uses this paradigm.
Database/Data driven programming approach
• This programming methodology is based on data and its movement.
Program statements are defined by data rather than hard-coding a
series of steps.
• A database program is the heart of a business information system and
provides file creation, data entry, update, query and reporting
functions.
• There are several programming languages that are developed mostly for
database application. For example SQL. It is applied to streams of
structured data, for filtering, transforming, aggregating (such as
computing statistics), or calling other programs. So it has its own wide
application.
Hardware and software considerations for
structured programming
• With modern processors (Intel, AMD, ARM, PowerPC) all the support
necessary for high level languages such a C, C++, and the like is provided.
(The CDC 6600 had a “Store location and jump” for subroutine calls. Pascal
was implemented without using this instruction!”)
• The software considerations are necessary loop and loop exit high level
constructors in the language. For example in C is “for”, “do” and “while”
looping statement with “break” and “continue” statements for loop exit or
continue without using “gotos”.
• The “catch” and “throw” allow for “global exits” without the use of “gotos”.
• The CDC Pascal compiler had on global exit (Lable 13) which occurred when
input tokenizer encountered and premature end-of-file.

You might also like