Unit 4 - Programming

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Unit 4 - Programming

"A language that doesn't affect the way you think about programming, is not worth knowing".
Alan Perlis

Overview
Estos son los objetivos y contenidos de esta unidad

OBJETIVOS

Entender diversos textos escritos sobre lenguajes de programación, programación y bases de datos
Usar la voz pasiva
Diferenciar la voz activa de la pasiva
Utilizar verbos seguidos de preposición
Usar las oraciones condicionales
Usar conectores y conjunciones que indican condición
Traducir frases sencillas sobre lo estudiado en la unidad
Entender vídeos sencillos sobre las bases de datos y programación

CONTENIDOS
Gramática Vocabulario

Voz pasiva Vocabulario relacionado con la programación


Oraciones condicionales Verbos seguidos de preposición
Conectores y conjunciones condicionales

Contents 1. Programming languages

Introduction
Unit 4 - Programming 18/04/2018 Página 1 de 34

Do you already know any programming languages?

Which ones?

What language do you think is best for making Web pages? Games? Text processing?

Did you know that the earliest programming languages predate the invention of the computer and were used to
direct the behavior of machines?

There are thousands of different programming languages in use today. How can you know which ones are
worth learning?

How do you know which ones are the best for your IT field of choice?

Let's start by learning facts about what a programming language is and some basic information about the most
important ones.
Photo:adapted from:wikipedia commons 

What is a programming language?

A programming language can be defined as an artificial language in which


computer programs are written. This language is
used to write instructions that are translated into machine language and then executed
by the computer. Each language has
a unique set of keywords (words that it understands) and a special syntax for organizing program instructions.
Programming languages differ from most other forms of human expression in that they require a greater degree of
precision and completeness.

When we use a natural language to communicate with each other, speakers can be ambiguous and sometimes make errors,
and still expect to be understood. However, figuratively speaking, computers "do exactly what they are told to do",
and
cannot "understand" what code the programmer intended to write. The
combination of the language definition, a program,
and the program's inputs must fully specify the external behavior that occurs when the program is executed, within the
domain of control of that program.

The description of a programming language is usually split into the two components of syntax (form: how the various
symbols of the language may be combined) and semantics (providing meaning to programs: the meaning that the language
constructs).
Most programming languages are purely textual; they use sequences of text including words, numbers, and punctuation,
Unit 4 - Programming 18/04/2018 Página 2 de 34
much like written natural languages. On the other hand, there are some programming languages which are more graphical in
nature, using visual relationships
between symbols to specify a program.

Not all syntactically correct programs are semantically correct. Many syntactically correct programs are ill-formed; and may
result in an error on translation or execution.

The term computer language is sometimes used interchangeably with programming language.
However, the usage of
both terms varies among authors. One usage describes programming languages as a subset of computer languages. In this
way, languages used in computing that have a different goal than expressing computer programs are generically designated
computer languages. For instance, *markup languages are sometimes referred to as computer languages to emphasize that
they are not meant to be used for programming.

There are plenty of technical characteristics with which to compare programming languages:
how many key words,
maximum length of identifier, type-checking facilities, polymorphism, prevalence, and so on. It is almost infinitely
complex. But
the following comparison criteria, which are centered on outcomes, can be very interesting to take into account:

• Ease of learning
• Ease of understanding
• Speed of development
• Help with enforcement of correct code
• Performance of compiled code
• Supported platform environments
• Portability
• Fit-for-purpose

*markup:The collection of tags that describe the specifications of an electronic document, as for formatting.
Adapted from:http://msdn.microsoft.com/en-us/library/cc168615.aspx
http:http://en.wikipedia.org/wiki/Programming_language

Contents 1.1 Related terms


Learn some of the most useful keywords in programming languages

ADT Abstract data type

algorithm A description in precise but natural and mathematical language of how a problem is solved

ASCII The original common character code for computers using 8 bits

binding A relationship between two things, typically an identifier and some one of its properties or attributes

"Beginners
All-purpose Symbolic Insctruction Code", a family of languages developed for teaching
BASIC
programming and given away with early IBM PCs

binary Pertaining to 2. Binary operators have two operands. Binary numbers have base 2 and use 2 symbols (*)

Binary
digit. A bit has one of two values traditionally named 0 and 1. Eight bits make a byte. and four bits a
bit
nibble. So 2 nibbles = 1 byte

byte Eight bits

C Programming Language invented to help develop operating systems

C++ Hybrid child of C with object oriented features and generic functions and classes

COBOL COmmon Business Oriented Language

A term used for both the statements written in any programming language -the source code , and a term
code for the source code after it has been processed by a compiler and made ready to run in the computer: the
object code-

compile Translate source code into executable object code

A program that translates another program written in a high-level language into machine language so that
compiler
it can be executed

debug To search for and eliminate malfunctioning elements or errors


Unit 4 - Programming 18/04/2018 Página 3 de 34
default An item provided in place of an omitted item

formal Something that is abstract or mathematical

FORTRAN FORmula TRANslation

grammar A formal way of defining syntax

HTML HyperText Markup Language. -- used to define pages on the WWW

Java Object-oriented language that has a C-like syntax

lexeme A string of characters in a language that is treated as a single unit in the syntax and semantics

parameter Something that is used in a subprogram that can be changed when the subprogram is called

To convert a sequence of tokens into data structures that can be used to interpret or translate the
parse
sequence

PL Programming Language

protocol Rules for calling a subprogram

A piece of code that has been named and can be referred to by that name (called) as many times as is
subprogram
needed

The
basic component of source code. Character's are categorized as one of five classes of tokens that
token
describe their functions (constants, identifiers, operators, reserved words, and separators)

UNICODE A new 16 bit International code for characters. Used in Java


(*) Here
are the first few binary integers (A member of the set of positive whole numbers {1, 2, 3, . . . }, negative whole
numbers {-1, -2, -3, . . . }, and zero {0}.

BINARY DECIMAL
0 1
1 1
10 2
11 3
100 4
101 5
...  

Self-assessment

Now, it is your turn. Find a correct match of the expressions and phrases related to programming in column A
within column B. If you have any problems, or you want to find out what they are referred to, you can look them up
here.

a. Object-oriented
01. Generation

b. Data
02. Polymorphism

c. Software
03. Detection

d. Code
04. Semantics

e. Dataflow
05. Algorithm

f. Real Time
06. Abstraction

Unit 4 - Programming 18/04/2018 Página 4 de 34


g. Programming
07. Language

h. High Level
08. Paradigm

i. Embedded
09. Analysis

j. Parametric
10. Solving

k. Communication
11. Flow

l. High-order
12. Debugging

m. Levels of
13. System

n. Parallel
14. Engineering

ñ. Problem
15. Optimization

o. Programming Language
16. Language

p. Program
17. Systems

q. Error
18. Error

r. Compilation
19. Protocol

s. Compiler
20. Functions

Senden
  

Contents 1.2 Classifying programming languages


Computer
science has made huge progress since it became recognized as an academic discipline. One of the fundamental
problems it has approached is how to translate the problems that people need solved into a format that computers can
process. A variety of competent and clever solutions have been applied to this problem.
Programming languages are human-engineered languages developed to communicate instructions to machines; they are
based on rules of syntax and semantics. Thousands of different programming languages have been developed, used, and
rejected.

There is no single standard for classifying programming languages,


as it could be expected in an active and developing
field.The area of programming languages is dynamic, even chaotic. As more sophisticated hardware systems appear in the
market new computer applications emerge. These applications produce new languages to solve such applications. Another
trend is the continuous increase in complexity of applications as hardware become more sophisticated and cheaper. The
increase in size of programs needs new methods of dealing with complexity while keeping the cost of program development
low and ensuring correctness of programs.

The task is further complicated by the fact that languages can be classified along multiple lines.
For example, Java is
both an object-oriented language (because it encourages object-oriented organization) and a concurrent language (because
it contains built-in constructs for running multiple threads in
parallel). Python is an object-oriented scripting language.

Dozens of categories exist according to different criteria; some languages are named problem oriented, while others are
classified according to their level of abstraction: low level or high level.

One of the most fundamental ways programming languages are characterized is by programming paradigm. A
programming paradigm provides the programmer's view of code execution.
Adapted from:http://www.giac.org/cissp-papers/97.pdf   /  http://en.wikipedia.org/wiki/Programming_language

Unit 4 - Programming 18/04/2018 Página 5 de 34


A step ahead

Problem oriented languages are designed to solve a narrow class of problems. A user of such a language need
not express in detail the procedure used to solve a problem. Readymade procedures are pre-programmed. The
user merely presents the data in a flexible ‘language'.

Basically a DSL is composed of these elements

Language-Oriented Programming considers the creation of special-purpose languages for expressing problems
a standard part of the problem solving process.
Language oriented programming (LOP) is a style of computer programming in which, rather than solving problems
in general-purpose programming languages, the programmer creates one or more domain-specific languages
(DSLs) for the problem first, and solves the problem in those languages. Examples of DSLs include spreadsheet
macros, YACC for parsing and compilers, Csound, a language used to create audio files, and GraphViz, a
language used to define directed graphs, and create a visual representation of that graph.
DSLs focus on doing one sort of task well. For instance, GraphViz is
designed to create images of graphs in a
variety of formats, but GraphViz lacks the capability to perform some basic tasks, e.g. accessing a network socket,
receiving additional user input, or manipulating strings
Adapted from:http://www.giac.org/cissp-papers/97.pdf

A step ahead

According to their level of abstraction, there are two major types of programming languages. These are Low
Level Languages and High Level Languages.

♦ A low-level programming language


is a programming language that
provides little or no abstraction from a
computer's instruction set architecture
(the part of the computer architecture related to programming).
The word "low" refers to the small or nonexistent amount of abstraction
between the language and machine language; because of this, low-level
languages are sometimes described as being "close to the hardware."
Low-level languages can be converted to machine code without using a
compiler or interpreter, and the resulting code runs directly on the processor. A
program written in a low-level language can be made to run very quickly, and
with a very small memory footprint (which refers to
the amount of main
memory that a program uses or references while running or how much hard
disk space a program takes up). Low-level languages are simple, but are
considered difficult to use, due to the numerous technical details which must be remembered. They are

Unit 4 - Programming 18/04/2018 Página 6 de 34


machine oriented and require extensive knowledge of computer hardware and its configuration.

Low Level languages are further divided in to Machine language and Assembly language.

Machine Language

It is the only language that is directly understood by the computer. It does not need any translator program. We
also call it machine code and it is written as strings of 1′s (one) and 0's (zero).
When this sequence of codes is
fed to the computer, it recognizes the codes and converts it in to electrical signals needed to run it. For example, a
program instruction may look like this:
1011000111101
It is not an easy language to learn because it's difficult to understand. It is efficient for the computer but very
inefficient for programmers. It is considered to be a first generation language.

Assembly Language

It is the first step to improve the programming structure. Assembly languages are similar to machine languages,
but they are much easier to program in because they allow a programmer to substitute names for numbers.
The set of symbols and letters forms the Assembly Language and a translator program is required to translate the
Assembly Language to machine language. This translator program is called `Assembler'. It is considered to be a
second-generation language.


In comparison to low-level programming languages, high-level languages
are simple languages that use
English and mathematical symbols like +, -, %, / etc. for their program construction. They are easier to use and
may automate significant areas of computing systems, making the process of developing a program not so
complicated and more understandable than a
lower level language. The amount of abstraction provided defines
how "high level" a programming language is. Programs written in a high-level language must be translated into
machine language by a compiler or interpreter. Java, C, C++ or Perl are examples of high-level
languages.
Adapted from:http://en.wikipedia.org/wiki/High-level_programming_language 
Photo:freedigitalphotos.net 

Self-assessment

Read the texts above and decide if these statements are TRUE or FALSE
1. It is not an easy task to classify programming languages
True. False.
 
2. DSL are general purpose programming languages
True. False.
 
3. When a programming language has very little or no abstraction from the details of the computer is called high-
level language
True. False.
 
4. The only language which does not require a translator program is machine language
True. False.
 
5. In assembly languages symbols and letters are used
True. False.

Contents 1.2.1 Programming paradigms


Programming languages can be grouped by the number and types of paradigms supported. We use the word paradigm to
mean "any example or model".
What does the word "paradigm" mean? → par·a·digm n. A pattern or model.
Unit 4 - Programming 18/04/2018 Página 7 de 34
[Middle English, example, from Late Latin paradgma, from Greek
paradeigma, from paradeiknunai, to compare: para-,
alongside; see
para-1 + deiknunai, to show; see deik- in Indo-European roots.] (Oxford Dictionary)

A programming paradigm is a general approach, orientation, or philosophy of programming that can be used when a
program is carried out. One paradigm may be generally better for certain kinds of problems than other paradigms are for
those problems, and a paradigm may be better for certain kinds of problems than for other kinds of problems.
If a programming language is adequate (or at least designed to be adequate) for a particular paradigm, the language is said
to be a language of that paradigm. For example, C is considered to be an imperative language, Java is an object-oriented
language, and Prolog is considered to be a logic programming language.

There are four main paradigms: object-oriented, imperative, functional and logic programming.

A programming language can support multiple paradigms. For example, programs written in C++ or Object Pascal
can be
purely procedural, or purely object-oriented, or contain elements of both paradigms. Software designers and programmers
decide how to use those paradigm elements.
In object-oriented programming, programmers can think of a program as a collection of interacting objects, while in functional
programming a program can be thought of as a sequence of stateless function evaluations.

Logic and functional languages are said to be declarative languages.

Just as different groups in software engineering are in favour of


different approaches, different programming languages
favour different programming paradigms. Some languages are designed to support one particular paradigm (Smalltalk
supports object-oriented programming, Lisp supports functional programming), while other programming languages
support multiple paradigms (such as Object Pascal, C++, Java, C#, Visual Basic, Perl, Python, Ruby).

OBJECT-ORIENTED PROGRAMMING (OOP) tries to make programs in a similar way to how people think about and deal
with the world.
We have seen that in other styles of programming, a programmer faced with some problem must identify a computing task
that needs to be performed in order to solve the problem. Programming then consists of finding a sequence of instructions
that will accomplish that task. But at the heart of object-oriented programming, instead of tasks we find objects that have
behaviors, that hold information, and that can interact with one another. Programming consists of designing a set of objects
that model the problem at hand.

Objects are key to understanding object-oriented programming.


Real-world objects (like cars or houses) share two characteristics: they all have state and behavior. For example: cars have
state (gear or brake) and behavior (changing gear, or applying brakes). Identifying the state and behavior for real-world
objects is essential to begin thinking in terms of object-oriented programming.
Software objects are conceptually similar to real-world objects: they are too composed of state and related behavior. An
object stores its state in fields (variables in some programming languages) and exposes its behavior through methods
(functions in some programming languages). Methods operate on an object's internal state and serve as the primary
mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an
object's methods is known as data encapsulation - a fundamental principle of object-oriented programming

Object-oriented programming terms

Languages designed mainly for OOP, but with some procedural elements: C++, Java, C#, VB.NET, Python.

Adapted from:http://math.hws.edu/eck/cs124/downloads/OOP2_from_Univ_KwaZulu-Natal.pdf
- http://en.wikipedia.org/wiki/Object-oriented_programming

Imperative programming is a programming paradigm that describes computation in terms of statements that change a
Unit 4 - Programming 18/04/2018 Página 8 de 34
program state. In much the same way that imperative mood in natural languages expresses commands to take action,
imperative programs define sequences of commands for the computer to perform. An imperative program is a list, or
sequence, of commands or instructions.
The term is used in opposition to declarative programming, which expresses what the program should accomplish without
prescribing how to do it in terms of sequences of actions to be taken.

The 'first do this, next do that' is a short phrase which really describes the spirit of the imperative paradigm. The basic idea is
the command, which has a measurable effect on the program state. The phrase also reflects that the order to the
commands is important. 'First do that, then do this' would be different from 'first do this, then do that'.

When imperative programming is combined with subprograms it is called procedural programming. In either case the
implication is clear. Programs are directions or orders for performing an action.

Keywords and phrases: Assignment, goto, structured programming, command, statement, procedure, control-flow,
imperative language, assertions, axiomatic semantics. state, variables, instructions, control structures.

http://blog.jessitron.com/2012/08/brains-computers-and-problem-solutions.html

This style of programming is directly inspired by assembly programming. It can be found in the earliest general-purpose
programming languages (Fortran, C, Pascal, Basic, Cobol).
Adapted from:http://en.wikipedia.org/wiki/Imperative_programming - http://people.cs.aau.dk/~normark/prog3-03/html/notes/paradigms

Vocabulary exercise

Vocabulary revision: word formation


Find these words in the texts above and write the missing forms stemming from the same root to complete
the table:
For example: PROGRAM (Noun) - PROGRAMMER (Noun) - TO PROGRAM (verb) - PROGRAMMABLE
(Adjective)
NOUN VERB ADJECTIVE

Interact


Funktional

Behavior

Perform


Accomplish

Information

Unit 4 - Programming 18/04/2018 Página 9 de 34



Measurable


Procedural


Declarative


Particular

Support

 
Senden
  

Contents 1.2.1.1 Declarative versus Imperative


Declarative programming
is the opposite way of programming from imperative. When computer programmers use
declarative programming, they are describing what they want to happen, or the desired results of running their program.
Although the results are given, the process to reach those alerts is not. The fact that step-by-step procedures are not
provided is the key difference between declarative programming and imperative programming.
 

Declarative programming is a programming paradigm that expresses the logic of a computation without describing its control
flow. Many languages applying this style attempt to minimize or eliminate side effects by describing what the program should
accomplish, rather than describing how to go about accomplishing it (the how is left up to the language's implementation).
This is in contrast with imperative programming, in which algorithms are implemented in terms of explicit steps.

Common declarative languages include logic programming, and functional programming.

→ Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions
and avoids state changes as much as possible and
works with data flowing between functions. It emphasizes the application
of functions, in contrast to the imperative programming style, which emphasizes changes in state. Functional programming
wants to avoid state.

In functional programming, programs are executed by evaluating expressions, in contrast with imperative programming where
programs are composed of statements which change global state when executed.

Functional programming decomposes a problem into a set of functions. Ideally, functions only take inputs and
produce outputs, and don't have any internal state that affects the output produced for a given input. Well-known functional
languages include the ML family (Standard ML, OCaml, and other variants) and Haskell.

One of the advantages of functional languages is that testing and debugging a functional-style program is easier.

Unit 4 - Programming 18/04/2018 Página 10 de 34


Functional programming languages, especially purely functional ones such as the pioneering Hope, have largely been
taught at university rather than be used in commercial software development. However, prominent functional
programming languages such as Common Lisp or Haskell,
have been used in industrial and commercial applications by a
wide variety of organizations. Functional programming is also supported in some domain-specific programming languages
like Mathematica (symbolic and numeric math).

→ Logic programming languages, of which PROLOG (programming in logic) is the best known, state a program as a set of
logical relations. Such languages are similar to the SQL database language*.
A program is executed by an "inference engine"
that answers a question by searching these relations systematically to make inferences that will
answer a question.

PROLOG has been used extensively in natural language processing and other AI** programs.

Keywords and phrases: Horn clause, inference, modus ponens, modus


tollens, logic variable, unification, unifier, most
general unifier, occurs-check, backtracking, closed world assumption, meta programming, pattern matching. set, relation,
tuple, atom, constant, variable, predicate, functor, arity, term, compound term, ground, nonground, substitution, instance,
instantiation, existential quantification, universal quantification, unification, modus ponens, proof tree, goal, resolvent.

* Structured Query Language, a special-purpose programming language designed for managing data in relational database
management systems (RDBMS).

** Artificial Intelligence: John McCarthy, who coined the term in 1955, defines the term as "the science and engineering of
making intelligent machines."
Adapted from:http://docs.python.org/2/howto/functional.html - http://www.britannica.com/EBchecked/topic/346284/logic-programming-language
-
http://en.wikipedia.org/wiki/Declarative_programming
 

Exercise

Read the texts about programming paradigms and find words or expressions for these synonyms or definitions:

DEFINITION WORD IN TEXT

Specifying exactly what to do and in what order

Example, model

Method, orientation

To behave in a specified way towards ...

To carry out, perform

To be made of or composed

To attain, succeed in getting

To reduce to the smallest possible amount

To stress, point out

Seeking, tracking down

Show Feedback

Unit 4 - Programming 18/04/2018 Página 11 de 34


Contents 1.2.1.2 Vocabulary
Learn vocabulary.

In the previous texts, there were some words (mainly verbs) and the prepositions that normally follow them; based on, or
think of, for example.

Revise this list of common verbs and the prepositions that normally follow them

You can write the translation next to each verb

ACCUSE OF LISTEN TO

APPLY FOR / IN LONG FOR

BASED ON PAY FOR

BELIEVE IN PREVENT FROM

BELONG TO RELY ON

CARE ABOUT SMILE AT

CLASSIFY INTO SPEAK TO

CONSIST OF SUCCEED IN

DEPEND ON TAKE CARE OF

DIE OF THINK OF / ABOUT

DIVIDE INTO WAIT FOR

INSIST ON WRITE TO

He was accused of having hacked the firm's personnel database.

He finally succeeded in altering the text editor to read HTML

Object-oriented programs consist of state and behavior

Vocabulary exercise

In previous texts, there were some verbs followed by a preposition.

Find these combinations of verb + preposition and write the sentence where these verbs are used.

VERB + PREPOSITION SENTENCE

be based on

be composed of

be faced with

consist of

deal with
Unit 4 - Programming 18/04/2018 Página 12 de 34
decompose into

focus on

operate on

split into

think about

think of

translate into

Show Feedback

Contents 1.3 Programming languages ranking


TIOBE Programming Community Index for November 2012

There are only 2 months left before TIOBE will announce the programming language of the year 2012. Objective-C crossed
the 10% border for the first time this month and continues to rise. Other mobile phone application languages such as C, C++
and Java are not rising fast enough
to compete seriously with Objective-C. Another possible competitor for the award, C#,
shows a strong dip this year for some unknown reason. So nothing seems to stop Objective-C to win 2 consecutive years in a
row.

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated
once a month. The ratings
are based on the number of skilled engineers world-wide, courses
and third party vendors. The
popular search engines Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings.
Observe that the TIOBE index is not about the best programming language or the language in which most lines of code have
been written.
The index can be used to check whether your programming skills are still up to date or to make a strategic decision about
what programming language should be adopted when starting to build a new software system. The definition of the TIOBE
index can be found here:

Unit 4 - Programming 18/04/2018 Página 13 de 34


Adapted from:http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html 

Position Position Ratings Delta


Programmierung
Language Status
Nov 2012 Nov 2011 Nov 2012 Nov 2011

1 2 C 19.224% +1.90% A

2 1 Java 17.455% -0.42% A

3 6 Objective-C 10.383% +4.40% A

4 3 C++ 9.698% +1.61% A

5 5 PHP 5.732% -0.36% A

6 4 C# 5.591% -1.73% A

7 7 (Visual)
Basic 5.032% -0.01% A

8 8 Python 4.062% +0.45% A

9 10 Perl 2.182% +0.10% A

10 11 Ruby 1.739% +0.24% A

11 9 JavaScript 1.278% -1.29% A

12 16 Delphi/Object
Pascal 0.995% +0.12% A

13 13 Lisp 0.951% -0.23% A

14 14 Pascal 0.881% -0.11% A

15 23 Visual
Basic .NET 0.769% +0.24% A-

Exercise

Read the text above and answer the questions about it:

1. What program will probably be the programming language of the year 2012?

2. Why is C# dropping this year?

3. Which program won in 2011?

4. How often is TIOBE updated?

5. What does TIOBE not deal with?

6. What does the text suggest you should do if you want to start a new software system?

Show Feedback

Listening practice

Unit 4 - Programming 18/04/2018 Página 14 de 34


Watch this video about programming languages

http://www.softwarecareerlaunch.com

Self-assessment

After listening to the video, choose the best answers:


1.- The first question the person who introduces the video asks is: What is the first programming language I should
learn?
a. he can give you an answer
b. he can't give you an answer

2.- After that, ...


a. he gives some rules you can use to guide your decision
b. he doesn't give you any advice about what language you should start learning

3.- At the end of the video, he


a. recommends some programming languages
b. doesn't recommend any specific programming languages

4.-
The sooner you choose a language to start up, the better. It doesn't matter which one, what matters is how
quickly you do it.
a. This statement is false
b. This statement is true

5.- Learning programming is very complicated, so ...


a. choose a first language which is as tough as real life
b. choose a first language which makes things easier for you

6.- Before picking up a language, make sure ...


a. there are enough websites about the language you are considering learning
Unit 4 - Programming 18/04/2018 Página 15 de 34
b. there are a few jobs available for the language you are considering learning

7.- C# is pronouned ...


a. see sharp
b. see hash

8.- Stackoverflow is ...


a. the best programming language for question-and-answer issues
b. the best programming question-and-answer webpage

10.- He doesn't recommend a complex language to start up because ...


a. it is motivating that as soon as possible you begin building something real from a programming point of
view
b. from a programming perspective, learning a simple language is more important

11.- According to the speaker the most popular language today is ...
a. Object C
b. C#

12. His final advice is:


a. Speed / do a little research / choose an interesting language / find the right training material / get started
today
b. Speed / choose an interesting language / do a little research / find the right material / get started today

Contents 1.3.1 Comparing programming languages

A step ahead

1. C
2. Java 8. Python
C is a general-purpose
Java is a programming language Python is a general-purpose,
programming language which
originally developed by James Gosling interpreted high-level programming
was initially developed by
at Sun Microsystems and released in language. It supports multiple
Dennis Ritchie between 1969
1995. Java is a general-purpose, object- programming paradigms, primarily
and 1973 for use in the UNIX
oriented language that is specifically but not limited to object-oriented,
operating system. C is an
designed to have as few imperative and, to functional
imperative (procedural)
implementation dependencies as programming styles. It was written
language. It was designed to
possible. It is intended to let application by Guido van Rossum in the late
be compiled using a
developers "write once, run anywhere" 1980's and was intended for
relatively straightforward
(WORA), meaning that code that runs general programming purposes.
compiler. C was useful for
on one platform does not need to be Python was not named after the
many applications that had
recompiled
to run on another. Java is snake but actually after the Monty
formerly been coded in
one of the most popular programming Python comedy group. Python is
assembly language, such as
languages in use. Programs written in characterized
by its use of
in system programming.
Java can run on many different indentation for readability, and its
Although C is a relatively old
computer architectures and operating encouragement for elegant code by
language, it is still widely
systems because of the use of the JVM making developers do similar things
used for system
(Java virtual machine). Java is the in similar ways. Python is used as
programming, writing other
language most likely to be taught in the main programming choice of
programming languages, and
university computer science classes. both Google and Ubuntu.
in embedded systems.

Unit 4 - Programming 18/04/2018 Página 16 de 34


C JAVA PYTHON
Strong Excellent readability and overall
Speed WORA, popularity
Points philosophy

Weak Memory management can be Slower than natively compiled


difficult to master None
Points languages

Notice the verbs in bold, they are passive forms


Adapted from:http://www.eweek.com/c/a/Application-Development/Top-10-Programming-Languages-to-Keep-You-Employed-719257/

Multiple choice exercise


Read the texts above and then, choose the best alternative for each question.
WHICH ONE ...?

1. It's the main programming language for Google and Ubuntu

a. C
b. Java
c. Python

2.It is quite probable to learn it at University


a. C
b. Java
c. Python

3. Programs written in this language can run on many different computer architectures and operating systems.
a. C
b. Java
c. Python

4. ...is the oldest ?


a. C
b. Java
c. Python

5. It's quite frequent to be found in embedded systems.


a. C
b. Java
c. Python

Unit 4 - Programming 18/04/2018 Página 17 de 34


6. It's more than a language: it's also a philosophy.
a. C
b. Java
c. Python

7. ...is the fastest?


a. C
b. Java
c. Python

8. Many of its software components can be reused


a. C
b. Java
c. Python

Contents 1.3.2 The passive voice


THE PASSIVE VOICE
The passive voice is frequently used in IT English because the form is impersonal and objective. The action is felt to be more
important than the agent or the performer of the action.

ACTION: The program was written

AGENT: by Guido van Rossum

Because IT English is usually written in an impersonal style, and


information and facts are more important than personal
opinions or attitudes, the passive voice is broadly used. It is also used to put a certain distance between the writer and the
arguments proposed and so they appear to be more objective. The passive voice also adds formality.
Examples:

Personal / Informal Personal / Formal

We can develop a new procedural language A new procedural language can be developed

In the current article I want to ... The current article is intended to convey ...

They teach Java at university Java is taught at university

The conclusions regard these data are ... These data are regarded to be ...

As we would like to assess ... In order to assess...

I assume that ... It is assumed that ...

REMEMBER:

The passive voice in English is composed of two elements:


the correct form of the verb 'to be' + the past participle of the verb in question:

Subject Verb 'to be' Past participle

The program was written in 1992.

More data have been added by the programmer

The Web page is updated every month.


 

We can use the passive in any tense. To make different tenses we change the verb to be.

The part of the sentence introduced by by is called the agent.


Unit 4 - Programming 18/04/2018 Página 18 de 34
The agent is only expressed when it is important to say who or what
something is done by. In most passive sentences,
there is no agent.

REMEMBER:

The passive is used more often in English than in Spanish, where we use other structures.

For example: "All the files can be viewed but they cannot be modified" → Se pueden ver todos los ficheros pero no se
pueden modificar

"The solution must be converted into the proper syntax of a programming language" → Se debe
convertir la solución en una adecuada sintáxis de un lenguaje de programación

Review

EXAMPLES OF SENTENCES WITH DIFFERENT TENSES USING PASSIVES

C is still widely used for system programming Present simple


C was developed in 1972 by Dennis Ritchie Past simple
Present
The program is being updated at the moment
continuous
The programming language of the year has been announced Present perfect
Once data had been specified, the machine was instructed to perform operations Past perfect
In the near future one programming language will be designed to serve all purposes Future simple
Natural language processors are going to be proposed to eliminate the need for a
"Going to" form
specialized language
We have made a decision about what programming language should be adopted Modal verbs
Java is the most likely language to be taught in university computer science classes. Infinitive
It is believed that the course is very interesting for undergraduates. Impersonal
 

Self-assessment

Check your knowledge of passives.

Which sentence has a passive form?


1. The programmer designed the most appropriate program for the client
True. False.
 
2. The browser window was closed
True. False.
 
3. The term computer language is sometimes used interchangeably with programming language
True. False.
 
4. Most programming languages describe computation in an imperative style
True. False.
 
Unit 4 - Programming 18/04/2018 Página 19 de 34
5. Thousands of different programming languages have been created, mainly in the computer field
True. False.
 
6. Most programming languages use sequences of text including words, numbers, and punctuation
True. False.

Practice

Exercise

Make a passive sentence from the words in brackets.

For example: This computer is very old. (When / it / make?)

→ When was it made?

1. Is Java very popular? Yes, (it / use / a lot of programmers)

2. There was nothing else to do, so (the computer / shut off)

3. Jason has got a new job. (He / hire / an important company)

4. The syntax is one of the two components of any programming language. (It / can /specify using a Type-2
grammar)

5. There are many programming languages, and (many / design / from the very beginning)

6. Everyone believes that the course will be very useful for students. (It / teach / Professor Daniels)

7. There are two major types of programming languages: Low Level Languages and High Level Languages. (Low
Level languages / divided / into Machine language and Assembly language)

8. I can't print the document, there's something wrong with the printer. How often (it / clean?)

9. In case you have a problem, (the Internet Service provider / must / contact)

10. Before installation, (the antivirus / should / disable)

Unit 4 - Programming 18/04/2018 Página 20 de 34


 

Show Feedback

Self-assessment

Read the text below and fill in the missing words. Choose from the list below

WRITTEN RECOGNIZED REMEMBERED BUILT DIVIDED DEBUGGED UNDERSTOOD

CALLED CONSIDERED REQUIRED NEEDED LEARNED CONVERTED UNDERSTOOD


 
There are two major types of programming languages. These are Low Level Languages and High Level
Languages. Low Level languages are further
in to Machine language and Assembly language.
Low Level Languages

The term low level means closeness to the way in which the machine has been
. Low level languages
are machine oriented and require extensive knowledge of computer hardware and its configuration.

Machine Language

Machine Language is the only language that is directly


by the computer. No translator

program is
. It is also
machine code and it is
as strings of 1's (one)

and 0's (zero). When this sequence of codes is fed to the computer, the codes are
and


into electrical signals needed to run it. For example, a program instruction may look like this:
1011000111101
It is not an easy language to be
because it is difficult to be
. It is efficient

for the computer but very inefficient for programmers. It is


to be the first generation
language. It is also difficult to debug the program written in this language.

Advantage

The only advantage is that programs of machine language run very fast because no translation program is

for the CPU.

Disadvantages

1. It is very difficult to program in machine language. The programmer has to know details of hardware to write
a program.
2. A lot of codes have to be
to write a program which results in program errors.
3. The program is difficult to be

Adapted from:http://www.itsavvy.in/programming-languages

Get score
  
Show/Clear Answers

Practice

Translation

Unit 4 - Programming 18/04/2018 Página 21 de 34


Take a look at this link if you still have problems with the passive.

Now, translate these sentences:

1. PHP is the Web's most common programming language and it has been proved to be powerful and robust.

2. Code for the emulation programm should be written in open source, in a standard programming language with
good prospects for longevity and future compatibility

3. Reducativa (Educatenet) has been developed entirely in Java, a programming language oriented towards
objects, robust, portable y
versatile, which has become the new Standard worldwide-

4. Javascript is a scripting language with which web pages can be programmed


with animated Web 2.0
applications. Unlike HTML programming language, you can offer interactive web page content on your web site.

5. Like the BASIC programming language, Visual Basic was designed to be easily learned and used
by
beginner programmers. The language not only allows programmers to create simple GUI applications, but to also
develop complex applications.

6. The Java language project was initiated by James Gosling, Mike Sheridan, and Patrick Naughton in June
1991. Java was originally designed for interactive television, but it was too advanced for the digital cable
television industry at the time. The language was initially called Oak after an oak tree that stood outside Gosling's
office; it went by the name Green later, and was later renamed Java, from Java coffee, said to be consumed in
large quantities by the language's creators.

7. C++ is one of the most popular programming languages and is implemented


on a wide variety of hardware and
operating system platforms. As an efficient compiler to native code, its application domains include systems
software, application software, device drivers, embedded software, high-performance server and client
applications, and entertainment software such as video games.

8. All these languages follow the procedural paradigm. That is, they describe, step by step, exactly the procedure
that should, according to the particular programmer at least, be followed
to solve a specific problem. The efficacy
and efficiency of any such solution are both therefore entirely subjective and highly dependent on that
programmer's experience, inventiveness and ability.

9. Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics
and strong static typing. It is named after the American logician Haskell Curry. In Haskell, "a function is a first-
class citizen" of the programming language. As a functional programming language, the primary control construct
is the function.

10. Following the release of Miranda in 1985, interest in functional languages grew: by 1987, more than a dozen
non-strict, purely
functional programming languages existed. Of these, Miranda was the most widely used,
but
was not in the public domain. At the conference on Functional Programming Languages and Computer
Architecture (FPCA '87) in Portland, Oregon, a meeting was held during which participants formed a strong
consensus that a committee should be formed
to define an open standard for such languages. The committee's
purpose was to consolidate the existing functional languages into a common one that would serve as a basis for
future research in functional-language design.

Show Feedback

Rephrasing

Write a passive sentence instead of using "somebody", "they" or "people".

e.g.: Somebody asked me how to debug the program → I was asked how to debug the program

a. They cancelled the meeting because of the strike

Unit 4 - Programming 18/04/2018 Página 22 de 34


b. Many people attribute the invention of the video game to William Higingotham.

c. They also shape programming languages by pragmatic considerations.

d. People warned us about hackers.

e. Peope know programming errors as 'Bugs' in computer programming.

f. Somebody is writing a new version of that program

g. People often ask me how to update the program

h. They have given me the job.

i. Somebody is going to make a big mistake.

j. They will find a solution sooner or later

Show Feedback

Contents 2. Computer programming


To program is to think of the most logical and direct solution to a problem, and then expressing it in a code language,
which a computer can interpret and execute accordingly. Just like we humans have a language with a specific syntax and
words with meanings to
convey thought, so do computers have languages, which you must learn, in order to effectively
communicate and instruct them to accomplish various tasks. The first task of every programmer is to come up with a
flowchart of logic, which is a sketch of the solution to the problem at hand. Then the solution must be converted into the
proper syntax of a programming language. Every program you use on your computer is written in code first and then
compiled to create a machine readable 'executable' file. The process of writing source code
often requires expertise in
many different subjects, including knowledge of the application domain, specialized algorithms and formal logic.

The process of creating programs is procedural.


For larger programs, more bureaucratic steps are needed
because there is
usually a team of professionals working on it. But for
a simple program, the programmer defines the problem, determines
the
specifications, creates a design, implements the design and then tests/debugs
the program. Implementing the design is
when programmers deploy the
program after they have designed the user interface and the code. The
code and design
aspects are compiled into an executable file
format (.exe). There will almost always be errors; this is when the
testing and
debugging phase begins. The programmer goes through ever
possible scenario in the program, literally trying to break it. This
is
the only way they will know of possible problems down the road and how
to prepare for them. Once the program passes
Unit 4 - Programming 18/04/2018 Página 23 de 34
the test and debug phase,
the programmer only needs to distribute it and maintain it. Maintaining
programs includes any
upgrades and updates that are needed.

To write a program you have to follow the steps below:

Defining the problem; take into account what the future users will need it for.
Designing the solution to the problem above. Troubleshooting is essential.
Coding the program, choosing the most suitable programming language.
Checking and debugging the program: this means you have to run your
program to see if it makes the computer do
what you wanted it to. If not, fix the program and compile and run it again.
Adapted from:http://www.ehow.com/how-does_4866883_writing-simple-computer-programs.htm

Self-assessment

Match these words from the text with their definitions

WORD   DEFINITIONS

1. upgrade a. to look for and remove mistakes from a computer program so that it works correctly

2. update b. Improve, enhance

3. procedural c. Carry out, put into practice, put into effect

4. compile d. Modernize, renew

5. implement
e. Convert a program into a lower-level form in which the program can be executed

6. debug
f. In the established way of doing it

Senden
  

"To err is human, to really foul things up requires a computer."


Bill Vaughan

Software bugs are errors, mistakes, failures, or faults in a computer


program or system that produce an incorrect or unexpected result, or
causes it to behave in unintended ways. Most bugs arise from errors made
in either a program's source code or its design, and a few are caused by
compilers producing incorrect code.

Unit 4 - Programming 18/04/2018 Página 24 de 34


Programming errors can have disastrous consequences because
machines are
increasingly being used in automated mode, with embedded
systems or computers controlling their functioning. For example, in 1996,
the European Space Agency's US$1 billion prototype Ariane 5 rocket was
destroyed less than a minute after launch, due to a bug in the on-board
guidance computer program. Consequently, errors need to be taken very
seriously as we increasingly rely on computers.

 Common Types of Computer Bugs

Computer programming is a huge field with hundreds of languages and millions of applications, and so is the range for
making programming errors of various kinds!

Logic Errors. These errors are related to the program execution: When a program written in any language compiles
and runs properly but it provides incorrect output. This is primarily due to a poor understanding of a problem, to
inaccurate translation of the algorithms into the program and lack of hierarchy of operation.This may be the most
serious of all errors.

Syntax Errors. Every programming language has a specific syntax in which code needs to be written. Any violation of
rules of the language result comes under syntax error. The compiler can detect and isolate these types of errors. If
syntax errors are present in the program, then compilation fails.

Compilation Errors. They are errors that prevent your program from running. They often occur because of syntax
errors. These errors are rectifiable in the development phase.

Run-Time Errors. Run-time errors occur while your program runs. These typically occur when your program attempts
an operation that
is impossible to carry out.The program code has compiled successfully and an executable file has
been created. But when the program is run to be tested, you find an error. This is a 'Run Time Error'. If you want these
to be rectified, then go back to the coding phase.

Finding and fixing bugs, or "debugging", has always been a major part of computer programming. As computer programs
grow more complex, bugs become more common and difficult to fix. Often programmers spend more time and effort finding
and fixing bugs than writing new code. Software testers are professionals whose primary task is to find bugs, or write code to
support testing. On some projects, more resources can be spent on testing than in developing the program.
Adapted from:http://en.wikipedia.org/wiki/Software_bug - http://www.buzzle.com/articles/computer-programming
Photo:freedigitalphotos.net

Revision exercise

Read the text again and find:


1. An example of a verb + preposition

2. A time clause

3. An imperative

4. A conditional sentence

5. A passive sentence using the present continuous

6. An example of a phrasal verb

7. An example of premodification

Unit 4 - Programming 18/04/2018 Página 25 de 34


8. A modal verb indicating probability

Show Feedback

Contents 2.1 Conditional sentences

A step ahead

Structured programming is a programming paradigm aimed on improving the clarity, quality, and development
time of a computer program.

At a low level, structured programs are often composed of simple, hierarchical program flow structures. These are
sequence, selection, and
repetition:

Sequence refers to an ordered execution of statements.

Selection refers to one of a number of instructions executed depending on the state of the program;
conditional instructions are used: if one condition is true, then process such instruction (if X, then Y). To
indicate the way a conditional structure is going to process data, we use decision tables.

Repetition refers to a statement executed until the program reaches a certain state, or operations have
been applied to every element of a collection. Loop instructions are used: instructions are processed
again and again until or while a particular condition is true or false. Flowcharts are broadly used here.
Adapted from:http://en.wikipedia.org/wiki/Structured_programming

REVISE: IF-SENTENCES

Conditional Sentences are used to express that the action in the main clause (without if) can only take place if a certain
condition (in the
clause with if) is fulfilled. There are four types of Conditional Sentences.

Conditional Sentence Type 0


In 'zero' conditional sentences, the tense in both parts of the sentence is the simple present:

'IF' CLAUSE MAIN CLAUSE

If + simple present
simple present

f you mix red and blue you get purple


If you press Print Screen you can make a copy of the screen

In these sentences, the situation is real and possible.


They are used to speak of things that usually happen or to show a
logical consequence.They often refer to general truths, such as
scientific facts.

First Conditional

In first conditional sentences, the tense in the 'if' clause is the simple present, and the tense in the main clause is the
simple future

'IF' CLAUSE MAIN CLAUSE

If + simple present
simple future

If he arrives late his boss will be angry


If you don't find a solution you will get into trouble

In these sentences, the time is the present or future and the situation is real.
They refer to a possible condition and its
probable result. They are
based on facts, and they are used to make statements about the real
world, and about particular
Unit 4 - Programming 18/04/2018 Página 26 de 34
situations. When we use this type of
conditional we mean that what we say will probably happen

There are other possibilities of verb tense combination:

Condition: present - Main clause: may, can or imperative instead of WILL: "Don't go out this evening if you have an exam
tomorrow" / "He may stay overnight if he doesn't have to work" tomorrow

Second Conditional

In second conditional sentences, the tense in the 'if' clause is the simple past, and in the main clause we use: would /
could / might + infinitive

'IF' CLAUSE MAIN CLAUSE

If + simple past
would / could / might + infinitive

If he dropped the mouse it would stop working


If I had a better laptop I could work more efficiently

In these sentences, the time is present or any time, but the situation is unreal.
They are not based on facts, and they refer
to an unlikely or
hypothetical condition and its probable result. We use this conditional
to speak about very unlikely or
improbable situations

Third Conditional

The tense in the 'if' clause is the past perfect, and the tense in the main clause is the perfect conditional (would /could /
might + have + past participle)

IF' CLAUSE MAIN CLAUSE

If + past perfect
perfect conditional

If you had studied harder you would have passed the exam
If I had had a better computer I could have run the program

In these sentences, the time is past, and the situation is contrary to reality.
The facts they are based on are the opposite
of what is expressed.
Things cannot be changed because they happened in the past. This can
also be used to express regret
about something or to reproach somebody
for something.

Practice

Self-assessment

Write the right tense of the verb in brackets to make conditional sentences
 
1. If the network is down, we (access)

our files

2. What will happen if he (not get)



the software?

3. If she (have)

enough money, she would have bought the computer.

4. If he (not start)

at once, he'll be late for the meeting.

5. If you come late to work, they (not let)



you in.

6. If I knew his e-mail address I (send)



him the procedures in advance.

7. He (not make)

so many mistakes if he worked more slowly.

8. More students (come)



to this university if it were cheaper.

9. If I (go)
to university, I would enroll in computer science.

10. If she (do)


her project differently, she might convince her tutor.

11. If you (forget)


to save regularly, you may lose data.

Unit 4 - Programming 18/04/2018 Página 27 de 34


12. You (install)


the firewall if you had got the software.

13. If you (be)



here last week, you would have accomplished the last report.

14. If he had enough time, he (back up)



up the files.

15. If I (know)

you were a slow worker, I wouldn't have worked with you.

Senden
  

Self-assessment

Read the following sentences and choose the best explanation:


 
1. 1. If I knew his email, I would give it to you
a. I don't know his email
b. I can give you his email

2. If I had installed a suitable anti virus, my computer wouldn't have been infected with a virus
a. I didn't install a suitable anti virus, so my computer was infected with a virus
b. I installed a suitable anti virus but my computer was infected with a virus

3. If I were you, I wouldn't tell anybody what happened


a. I have told someone what happened
b. You don't think it is a good idea that she tells someone what happened

4. He won't learn programming languages if he doesn't find a course to take


a. He won't learn programming languages
b. He may not learn programming languages

5. If the student hadn't designed a Web page for his project, he wouldn't have got such good marks
a. He didn't get good marks
b. He got good marks

A decision table

A step ahead

A decision
table represents all possible conditions and actions. The table is divided into
columns which contain
the conditions, actions and rules. Rules may be
represented with ticks and crosses or with YES/NO
words/symbols. To see which action
to take, the user locates a tick or YES (true) in a row corresponding to a
condition. If we read the column down to the lower section, which lists action,
a tick / Yes in the row corresponding
to
a particular action indicates the action to be carried out:

Printer troubleshooter

  Rules
Unit 4 - Programming 18/04/2018 Página 28 de 34
Printer does not print Y Y Y Y N N N N

Conditions
A red light is flashing Y Y N N Y Y N N
 

Printer is unrecognized Y N Y N Y N Y N

Check the power cable X

Check the printer-computer cable X X

Actions
Ensure printer software is installed X X X X
 

Check/replace ink X X X X

Check for paper jam X X

Examples: if the printer doesn't print, then (you'll have to) check the
printer-computer cable

if a red light is flashing, then (you will have to) check ink.
Adapted from:http://en.wikipedia.org/wiki/Decision_table

Contents 3. Database
Database
 

freedigitalphotos.net

What is a database? A database is a useful tool in helping you store


and retrieve information. If you have ever used a
spreadsheet program, such as Microsoft Excel, a database is a similar idea, except that your data storage capabilities are
much greater with a database.
Often abbreviated DB, it is a structured collection of data. The data are typically organized to model relevant aspects of
reality.

Traditional databases are organized by fields, records, and files.


A field is a single piece of information; a record is one
complete set of fields; and a file is a collection of records. For example, a telephone book is analogous to a file. It contains a
list of records, each of which consists of three fields: name, address, and telephone number.

A way to classify databases involves the type of their contents, for example: bibliographic, document-text, statistical, or
multimedia objects. Another way is by their application area, for example: accounting, music compositions, movies, banking,
manufacturing, or insurance.
Unit 4 - Programming 18/04/2018 Página 29 de 34
An alternative concept in database design is known as Hypertext. In a Hypertext database, any object, whether it be a piece
of text, a picture, or a film, can be linked to any other object. Hypertext databases are particularly useful for organizing large
amounts of disparate information, but they are not designed for numerical analysis.

To access information from a database, you need a database management system (DBMS). This is a collection of
programs that enables you to enter, organize, and select data in a database.

Well known DBMSs include Oracle, FoxPro, IBM DB2, Linter, Microsoft Access, Microsoft SQL Server, MySQL, PostgreSQL
and SQLite. A database is not generally portable across different DBMS, but different DBMSs
can inter-operate to some
degree by using standards like SQL and ODBC together to support a single application built over more than one database. A
DBMS also needs to provide effective run-time execution to properly support (e.g., in terms of performance, availability, and
security) as many database end-users as needed.

Increasingly, the term database is used as shorthand for database management system.
Adapted from:
Adapted from:http://en.wikipedia.org/wiki/Database#Database_languages - http://www.webopedia.com/TERM/D/database.html

Exercise

Read the text and answer the questions about it

1. Fields, records and files: which are "bigger"?


2. What's the main characteristic of a Hypertext?
3. What does DBMS stand for?
4. What is DBMS?

Show Feedback

Reading activity

Database languages
Database languages are dedicated programming languages, shaped and used to:

define a database (i.e., its specific data types and the relationships among them),
manipulate its content (e.g., insert new data occurrences, and update or delete existing ones), and
query it (i.e., request information: compute and retrieve any information based on its data).

Database languages are data-model-specific, i.e., each language assumes and is based on a certain structure
of the data (which typically
differs among different data models). They typically have commands to instruct
execution of the desired operations in the database. Each such command is equivalent to a complex expression
(program) in a regular programming language, and thus programming in dedicated (database) languages
simplifies the task of handling databases considerably. An expression in a database language is automatically
transformed (by a compiler or interpreter) to a proper computer program that runs while accessing the database
and providing the needed results. The following are notable examples:

SQL (Structured Query Language) for the Relational model

A major Relational model language supported by all the relational DBMSs and a standard. SQL
was one of the
first commercial languages for the relational model. It has become the most widely used database language.
Though often described as, and to a great extent is a declarative language, SQL also includes procedural
elements. SQL
became a standard of the American National Standards Institute (ANSI) in 1986, and of the
International Organization for Standards (ISO)
in 1987. Since then the standard has been improved several times
with added features. However, issues of SQL code portability between major RDBMS products still exist due to
lack of full compliance with, or different interpretations of the standard. Among the reasons mentioned are the
large size, and incomplete specification of the standard, as well as vendor lock-in.

Unit 4 - Programming 18/04/2018 Página 30 de 34


OQL (Object Query Language) for the Object model

An object model language standard (by the Object Data Management Group) that has influenced the design of
some of the newer query languages, though they cannot be considered really different from OQL.

XQuery for the XML (Extensible Markup Language) model

XQuery is an XML based database language. SQL/XML combines XQuery and XML with SQL.
Adapted from:http://en.wikipedia.org/wiki/Database#Database_languages

After reading the text, decide if the statements are TRUE or FALSE
 
1. Databases use specifically designed programming languages
True. False.
 
2. Database languages use a set of instructions to execute the operations in the databalse
True. False.
 
3. Database languages do not need compilers to supply the final result
True. False.
 
4. OQL is the most commonly used language in databases
True. False.

DBMS, SQL, OQL, or XML


are acronyms. Acronyms and initialisms are abbreviations formed from the initial components in a
phrase or name. An abbreviation (from Latin brevis, meaning short) is a shortened form of a word or phrase. For example, the
word abbreviation can itself be represented by the abbreviation abbr., They are every common both in everyday English and
not to mention in English for IT:

DNS Domain Name Service

FAQ Frequently Asked Questions


HTML HyperText Markup Language

HTTP HyperText Transfer Protocol

ICT Information and Communication Technology

POP3 Post Office Protocol, Version 3

RAM Random Access Memory

ROM Read-Only Memory

USB Universal Serial Bus

VGA Video Graphics Array/Adapter

WLAN Wireless Local Area Network

WWW World Wide Web

URL Uniform Resource Locator


Here you can find a complete list of computing and IT abbreviations.

Listening practice
Watch this video about Databases

Unit 4 - Programming 18/04/2018 Página 31 de 34


http://www.gcflearnfree.org/access2010

Self-assessment

After watching the video, do this exercise: choose the best answer:
 
1. A Database is a ...
a. collection of information stored on a computer, which allows you to enter, access and analyze it.
b. collection of lists on a computer, which you can organize and analyze.

2. A database ...
a. works from the simplest to the most complicated things
b. only works for simple things

3. If you were a professional baker, ...


a. your database will include more lists
b. your database would include more lists

4. What other important information does the baker have in his database?
a. who has an egg allergy
b. who has a nut allergy

5. What is Access better at?


a. storing and organizing numbers?
b. analyzing and connecting other types of data?

6. A relational database is known for:


a. its ability to understand relationships
b. its ability to understand tables

Contents 4. The final program

A step ahead

Unit 4 - Programming 18/04/2018 Página 32 de 34


Quality Requirements

Whatever the approach to software development may be, the final program must satisfy some fundamental
properties. The following properties are among the most relevant:

Reliability: how often the results of a program are correct.


This depends on conceptual correctness of
algorithms, and minimization of programming mistakes, such as mistakes in resource management (e.g.,
buffer overflows and race conditions) and logic errors (such as division
by zero or off-by-one errors).

Robustness: how well a program anticipates problems not due to programmer error. This includes
situations such as incorrect, inappropriate or corrupt data, unavailability of needed resources such as
memory, operating system services and network connections, and user error.

Usability: the ergonomics of a program: the ease with which a


person can use the program for its intended
purpose, or in some cases even unanticipated purposes. Such issues can make or break its success even
regardless of other issues. This involves a wide range of textual, graphical and sometimes hardware
elements that improve the clarity, intuitiveness, cohesiveness and completeness of a program's user
interface.

Portability: the range of computer hardware and operating system platforms on which the source code of a
program can be compiled/interpreted and run. This depends on differences in the programming facilities
provided by the different platforms, including hardware and operating system resources, expected
behaviour of the hardware and operating system, and availability of platform specific compilers (and
sometimes libraries) for the language of the source code.

Maintainability: the ease with which a program can be modified by its present or future developers in order
to make improvements or customizations, fix bugs and security holes, or adapt it
to new environments.
Good practices during initial development make the
difference in this regard. This quality may not be
directly apparent to
the end user but it can significantly affect the fate of a program over
the long term.

Efficiency/performance: the amount of system resources a program consumes (processor time, memory
space, slow devices such as disks, network bandwidth and to some extent even user interaction): the less,
the better. This also includes correct disposal of some resources,
such as cleaning up temporary files and
lack of memory leaks.
Adapted from:http://en.wikipedia.org/wiki/Computer_programming

Translate

Read the text again and translate it

Show Feedback

Unit 4 - Programming 18/04/2018 Página 33 de 34


Unit 4 - Programming 18/04/2018 Página 34 de 34

You might also like