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

LESSON 1 - Programming Languages

The document provides an overview of programming languages, defining them as tools for creating software and categorizing them into various types such as high-level, low-level, declarative, imperative, procedural, general-purpose, and domain-specific languages. It discusses the characteristics and examples of each type, as well as the concepts of object-oriented programming and the advantages and disadvantages of command and scripting languages. Additionally, it highlights the process of compiling and executing code, along with references for further reading.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

LESSON 1 - Programming Languages

The document provides an overview of programming languages, defining them as tools for creating software and categorizing them into various types such as high-level, low-level, declarative, imperative, procedural, general-purpose, and domain-specific languages. It discusses the characteristics and examples of each type, as well as the concepts of object-oriented programming and the advantages and disadvantages of command and scripting languages. Additionally, it highlights the process of compiling and executing code, along with references for further reading.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Programmin

g
Languages
Programming Language

A programming language is a
computer language programmers use
to develop software programs, scripts,
or other sets of instructions for
computers to execute.
Although many languages share similarities,
each has its own syntax.

Once a programmer learns the languages rules,


Programmi syntax, and structure, they write the source
code in a text editor or IDE.
ng Then, the programmer often compiles the code
into machine language that can be understood
Language by the computer.

Scripting languages, which do not require a


compiler, use an interpreter to execute the
script.
Types of Programming Language

Each of the different programming


languages can be broken into one or
more of the following types (paradigms)
of languages.
High-level (most common) / low-level
Declarative / Imperative / Procedural
General-Purpose / Domain-Specific
Object-Oriented / concurrent
Command / Compiled / Script Languages
1.1 High-Level Language

 Sometimes abbreviated as HLL, a high-level language is a

computer programming language that isn't limited by the

computer, designed for a specific job, and is easier to understand.


 It is more like human language and less like machine language.
 For a computer to understand and run a program created with a

high-level language, it must be compiled into machine language.


1.1 High-Level Language

 The first high-level languages were introduced in the

1950s. Today, high-level languages are in widespread

use.
 Examples of high-level languages include BASIC, C, C++

, COBOL, FORTRAN, Java, Pascal, Perl, PHP, Python, Ruby,

and Visual Basic.


1.2 Low-Level Language

 A low-level language is a programming language that

provides little or no abstraction of programming concepts

and is very close to writing actual machine instructions.

Two examples of low-level languages are assembly and

machine code.
1.2 Low-Level Language

Uses and Other Information


 Low-level languages are useful because programs written

in them can be crafted to run very fast and with a very

minimal memory footprint. However, they are considered

harder to utilize because they require a deeper

knowledge of machine language.


2.1 Declarative Language

 Declarative programming is a computer programming

paradigm that the developer defines what the program should

accomplish rather than explicitly defining how it should go about

doing so.
 This approach lends itself naturally to the programmatic

definition of formal logic systems, and has the benefit of

simplifying the programming of some parallel processing

applications.
2.1 Declarative Programming
Languages
• ABSET • CLP(R)
• Absys • Curl
• Alpha • CycL
• Ant • Datalog
• ASCEND • DASL
• Atom • Dependent ML
• ATS • ECL
• Brooks • Embedded SQL
• Candle • Erlang
• Curry • EAML
2.2 Imperative Language

 Imperative programming is a paradigm of


computer programming where the program describes
steps that change the state of the computer.
 Unlike declarative programming, which describes
"what" a program should accomplish, imperative
programming explicitly tells the computer "how" to
accomplish it.
 Programs written this way often compile to binary
executables that run more efficiently since all CPU
instructions are themselves imperative statements.
2.2 Imperative Language

 To make programs simpler for a human to read and write,


imperative statements can be grouped into sections
known as code blocks.
 In the 1950s, the idea of grouping a program's code into
blocks was first implemented in the ALGOL programming
language.
 They were originally called "compound statements," but
today these blocks of code are known as procedures.
 Once a procedure is defined, it can be used as a single
imperative statement, abstracting the control flow of a
program.
2.2 Imperative Programming
Languages
• Ada • FORTRAN
• ALGOL • Go
• Assembly language • Groovy
• BASIC • Java
• Blue • Julia
• C • Lua
• C# • MATLAB
• C++ • Modula
• COBOL • MUMPS
• D • Nim
2.3 Procedural Language

 Procedural languages are some of the common


types of programming languages used by script and
software programmers.
 They make use of functions, conditional statements,
and variables to create programs that allow a
computer to calculate and display a desired output.
2.3 Procedural Language

 Using a procedural language to create a program


can be accomplished using a programming editor or
IDE (Integrated Development Environment), like
Adobe Dreamweaver, Eclipse, or Microsoft Visual
Studio. .
 These editors help users develop programming code
using one or more procedural languages, test the
code, and fix bugs in the code.
3.1 General-Purpose Language

A general-purpose language is a
programming language that is capable of
creating all types of programs.
 For
example, C is a good example of a
general-purpose language.
3.1 General-Purpose Language

A language that is not a general-purposed


language is called a DSL (domain-specific
language).
 For
example, HTML, logo, MATLAB are
examples of domain-specific languages.
4.1 Object-Oriented Programming

 Coined by Alan Kay, object-oriented


programming, also known as OOP or OO
programming, is a programming language
paradigm.
 In an object-oriented program, the code can
be structured as reusable components, some
of which may share properties or behaviors.
4.1 Object-Oriented Programming

 Object-oriented programming can


improve the developer's ability to
quickly prototype software, extend
existing functionality, refactor the
code, and maintain it as it's developed.
4.1 Object-Oriented Programming
Concepts
When programming in an object-oriented programming language, keep the following

four key concepts in mind.

 Encapsulation - The grouping of related functions and data (variables) together into

an object to help reduce complexity and allow parts of the code to be reused.

 Abstraction - Show only the essentials to reduce the abstract of change.

 Inheritance - Eliminate redundant code by inheriting functions and data from other

classes.

 Polymorphism - Change how an object function depending on the data or class.


5.1 Command

Sometimes referred to as a command script, a command language is used to

execute a series of commands that would otherwise be executed at the prompt.

A good example of a command language is Microsoft Windows batch files.

Although command languages are useful for executing a series of commands,

their functionality is limited to what's available at the command line making

them easier to learn.


5.1 Command

 This is an example of a Perl


script that performs a
similar task as the batch file
example, but with more
sophistication.
 In this example, the script
not only deletes the files,
but creates a log containing
information about each file
deleted.
5.1 Command

 Advantages of command languages


• Very easy for all types of users to write.
• Do not require the files to be compiled.
• Easy to modify and make additional commands.
• Very small files.
• Do not require any additional programs or files
that are not already found on the
operating system.
5.1 Command

 Disadvantages of command languages


• Can be limited when comparing with other
programming languages or scripting languages.
• May not execute as fast as other languages or
compiled programs.
• Some command languages often offer little more
than using the commands available for the
operating system used.
5.2 Compile

 Compile is the creation of an executable program


from code written in a compiled programming
language.
 Compiling
allows the computer to run and
understand the program without the need of the
programming software used to create it.
 When a program is compiled it is often compiled
for a specific platform (e.g., IBM platform) that
works with IBM compatible computers, but not
other platforms (e.g., Apple platform).
5.3 Script

1. A script or scripting language is a computer


language with a series of commands within a file
capable of being executed without being compiled.
 Good examples of server-side scripting languages
include Perl, PHP, and Python.
 Thebest example of a client-side scripting
language is JavaScript.
A full list of scripting languages and other
programming languages are found in our
programming language definition.
5.3 Script

 Advantages of scripts
• Open source, allowing users to view and edit
the script if needed.
• Does not require the file to be compiled, but may be
when necessary.
• Easy to learn and write.
• Easy to port between different operating systems.
• Much faster to develop than an actual program - some
individuals and companies write scripts as a prototype
for actual programs.
5.3 Script

 Disadvantages of scripts
• Open source, allows others to view source code,
which may be prohibited by some companies.
• Requires the user to install an interpreter or
separate program before the script can run.
• In some situations, they may be slower than a
compiled program.
5.3 Script

2. Linux command

3. When referring to HTML, the <script> tag is


used to designate a client-side script on a web
page.
Asynchronous Activities:

 Look for the following Sample Computer


Programs (Source Code) of the following
Programming Languages. Also, please
include its output if there’s any.
1. Machine Language
2. Assembly Language
3. Procedural Language
4. Object Oriented Programming
Rereferences:

 https://www.computerhope.com/jargon/h/highll.htm
 https://www.computerhope.com/jargon/l/lowlangu.htm
 https://www.computerhope.com/jargon/d/declarprog.htm
 https://www.computerhope.com/jargon/i/imp-programming.htm
 https://www.computerhope.com/jargon/p/proclang.htm

You might also like