COS 333: Chapter 1, Part 1

Willem van Heerden
5 Aug 202054:08

Summary

TLDRThis lecture introduces key concepts of programming languages, emphasizing their importance for understanding language features and making informed choices for projects. It covers evaluation criteria like readability, writability, reliability, and cost, and discusses trade-offs between them. The lecture also explores the significance of studying programming languages in various domains such as scientific computing, business applications, and artificial intelligence, highlighting the unique requirements and evolution of each domain.

Takeaways

  • 📘 The first chapter of the textbook lays the groundwork for understanding programming languages, emphasizing its importance for the entire course and for preparing for exams and tests.
  • 🔍 The chapter introduces language evaluation criteria, which are critical for discussing the pros and cons of different language features throughout the textbook and on exams.
  • 🤔 The importance of studying programming languages is justified through six reasons, including enhancing idea expression, aiding in language selection for projects, and facilitating the learning of new languages.
  • 📚 Studying programming languages helps in understanding lower-level implementations, which can improve the way languages are used, reduce bugs, and inform about efficiency trade-offs.
  • 🛠️ The ability to simulate features from known languages in a dictated language can be beneficial when certain features are missing, as illustrated by the example of using Visual Basic without object-oriented features.
  • 💡 The evolution of programming languages is influenced by a programmer's familiarity and the popularity of languages, which may not always align with the most technically advanced options.
  • 🔑 Understanding language concepts allows for better use of known languages by exploiting features that may not be commonly used, such as C++'s template programming.
  • 🌐 The study of programming languages contributes to the advancement of computing by enabling more informed choices in language selection for projects, potentially improving the overall standard of programming languages.
  • 📈 The textbook focuses on four main evaluation criteria for programming languages: readability, writability, reliability, and cost, each with its own factors and trade-offs.
  • 🔄 Trade-offs between language evaluation criteria, such as between reliability and execution cost or between readability and writability, are common and must be considered in the context of specific programming languages.
  • 🌟 Different programming domains, such as scientific, business, artificial intelligence, systems programming, and web software, have specific requirements that influence the design and use of programming languages.

Q & A

  • Why is Chapter One of the textbook considered important for the course?

    -Chapter One is important because it discusses preliminary concepts related to programming languages that are used throughout the course and are crucial for understanding the material in semester tests and the final exam.

  • What are language evaluation criteria?

    -Language evaluation criteria are standards used to assess the features of programming languages, discussing their pros and cons, and are central to the textbook's analysis of language features.

  • Why is it beneficial to study general concepts of programming languages?

    -Studying general concepts increases our ability to express ideas, helps choose appropriate languages for projects, makes learning new languages easier, improves understanding of lower-level implementations, allows better use of known languages, and contributes to the advancement of computing.

  • How does a programming language's ability to express ideas relate to cognitive sciences and linguistics?

    -The concept that one cannot express what one cannot describe is related to research in cognitive sciences and linguistics, suggesting that the absence of a word for a concept makes it difficult to think about it, paralleled by the limitations programming languages impose on structures usage.

  • What is the significance of the trade-offs related to language evaluation criteria in high-level programming languages?

    -Trade-offs are important because they often dictate the design and use of programming languages, balancing factors like readability, writability, reliability, and cost against each other to achieve an optimal language for specific applications.

  • Why is readability an important criterion for evaluating a programming language?

    -Readability is important because it determines how easily someone can read and understand a program, affecting maintainability, error reduction, and the ability to collaborate with other programmers.

  • What is the relationship between a programming language's simplicity and its readability?

    -A programming language's simplicity contributes to its readability by having a manageable set of features and constructs, reducing the potential for confusion and making programs easier to understand.

  • How does the concept of orthogonality in programming languages affect readability and writability?

    -Orthogonality, where a small set of constructs can be combined in various legal ways, improves both readability and writability by making the language context-independent and reducing confusion for the reader and writer.

  • What factors contribute to the writability of a programming language?

    -Writability is influenced by the language's simplicity and orthogonality, support for abstraction, and overall expressivity, which together determine how easily a programmer can construct a program.

  • How does the support for exception handling in a programming language impact its reliability?

    -Exception handling mechanisms allow a programming language to intercept and recover from runtime errors, thus improving reliability by preventing crashes and unexpected behavior.

  • What are some of the trade-offs between different programming language evaluation criteria?

    -Trade-offs can occur between reliability and execution cost, readability and writability, and flexibility versus reliability, with languages often needing to balance these factors based on their intended use and design goals.

  • Why is understanding the cost of using a programming language important?

    -Understanding the cost is important as it includes factors like training, writing, compiling, executing, implementing, maintaining programs, and reliability, all of which affect the overall efficiency and economics of software development.

  • What are some additional factors that might influence the cost of maintaining programs in a programming language?

    -Factors influencing the cost of maintaining programs include the language's readability, writability, reliability, and the existence of robust documentation and community support.

  • How do different programming domains influence the design and features of programming languages?

    -Programming domains dictate the intended application area for a language, influencing its design to prioritize features beneficial for that domain, such as efficiency for systems programming or support for symbols manipulation in AI.

Outlines

00:00

📚 Introduction to Programming Language Concepts

The script begins by emphasizing the importance of understanding preliminary concepts in programming languages, as they are fundamental to the entire textbook and relevant for semester tests and exams. The lecture will cover the reasons for studying programming languages, language evaluation criteria, trade-offs related to these criteria, and the application of high-level programming languages in various domains. The first reason discussed is the enhancement of idea expression through language constructs, drawing a parallel with George Orwell's '1984' to illustrate the concept of linguistic relativity.

05:01

🔍 Choosing the Right Programming Language

This paragraph delves into the second reason for studying programming language concepts, which is to assist in selecting the appropriate language for a project. It acknowledges that programmers' choices may be limited by their familiarity with certain languages or by company requirements. The paragraph also highlights the importance of general language knowledge in making informed decisions about language features that are directly supported versus those that need to be simulated.

10:03

🚀 Accelerated Learning of New Programming Languages

The third reason for studying programming language concepts is to improve the ability to learn new languages quickly. As the field of programming is relatively young and continuously evolving, understanding general concepts helps in adapting to new languages and interpreting their features effectively. This knowledge also aids in deciding whether to adopt a new language based on its feature set.

15:04

🛠 Understanding Lower-Level Implementations

Studying programming language concepts also provides a deeper understanding of how languages are implemented at a lower level. This comprehension allows for the intended use of languages, potentially streamlining development, reducing bugs, improving debugging, and understanding efficiency trade-offs. The script mentions that while these topics are important, the course will not focus extensively on compiler construction details.

20:05

💡 Enhancing Familiar Language Usage

The fifth reason discussed is the enhancement of using programming languages that one already knows. Modern languages are complex, and programmers often only utilize a subset of features they are familiar with. Understanding additional features within a known language can lead to more effective exploitation of its capabilities, such as using templates in C++ for compile-time operations.

25:07

🌐 Advancing Computing Through Language Concepts

The final reason for studying programming language concepts is altruistic, focusing on the advancement of computing as a whole. Understanding language design issues can lead to better language choices in projects, promoting the evolution of better programming languages over time. The paragraph also introduces programming language evaluation criteria: readability, write-ability, reliability, and cost, which are central to the textbook and course.

30:08

📖 The Importance of Readability

This paragraph examines the first language evaluation criterion, readability, which is about how easily one can understand a program. It discusses factors contributing to readability, such as simplicity, minimal feature multiplicity, and operator overloading. The concept of orthogonality is introduced as a significant factor affecting readability, with examples of how it can lead to confusion if overused, as seen in ALGOL 68.

35:08

🔑 Readability Factors: Syntax and Data Types

The paragraph continues the discussion on readability, focusing on syntactic considerations such as identifier forms, special words, compound statements, and the form and meaning of syntactic features. It also touches on the importance of having an adequate set of predefined data types and structures to avoid confusion and enhance readability.

40:08

🛠️ Write-ability: Simplicity and Abstraction

The focus shifts to write-ability, the ease of constructing a program in a language. Factors such as simplicity, orthogonality, support for abstraction through sub-programs and object-oriented programming, and the expressivity of the language are discussed. The paragraph explains how these elements can make a language more writable, although there is often a trade-off with simplicity.

45:09

⚔️ Reliability: Type Checking and Exception Handling

Reliability is the third evaluation criterion, which involves the language's ability to prevent errors. The paragraph discusses the importance of compile-time type checking, support for exception handling, and the implications of aliasing through pointers or references. It also connects readability and writability to reliability, suggesting that natural expression in a language contributes to fewer errors.

50:11

💰 Cost: Training and Execution

The final evaluation criterion from the textbook, cost, is explored in this paragraph. It includes the costs associated with training programmers, writing and compiling programs, and the language implementation system. The script also invites the audience to consider how the previously discussed criteria might affect the cost of maintaining programs and to contemplate other potential cost-influencing factors.

🔄 Trade-offs and Programming Domains

The paragraph concludes the lecture by discussing trade-offs between different programming language evaluation criteria, such as reliability versus execution cost, and readability versus writability. It also introduces the concept of programming domains, explaining how different languages are designed for specific application areas like scientific computing, business applications, artificial intelligence, systems programming, and web software development.

Mindmap

Keywords

💡Programming Languages

Programming languages are formal languages designed to communicate instructions to a computer. They are the core of software development, allowing humans to create complex applications and systems. In the video, the study of programming languages is emphasized as crucial for understanding how to express ideas, choose appropriate languages for projects, and learn new languages efficiently.

💡Language Evaluation Criteria

Language evaluation criteria are standards used to assess the quality and effectiveness of programming languages. The video discusses criteria such as readability, writeability, reliability, and cost, which are pivotal for evaluating the suitability of a language for particular tasks or projects.

💡Readability

Readability refers to the ease with which a person can understand a written program. The script highlights factors contributing to readability, such as simplicity, orthogonality, and the support for data types, which are essential for the comprehensibility of code.

💡Writeability

Writeability is the ease with which programmers can construct programs in a language. The video script notes that a language's simplicity and orthogonality can improve writeability, allowing for more natural and less error-prone programming.

💡Reliability

Reliability in programming languages pertains to their ability to perform as expected under all conditions. The script discusses the importance of type checking and exception handling in achieving reliability, ensuring that programs behave predictably and errors are managed effectively.

💡Cost

Cost in the context of programming languages encompasses not only monetary expenses but also time and resource investments. The video script addresses the costs associated with training, writing, compiling, executing, and maintaining programs, emphasizing the balance between these costs and the language's utility.

💡Orthogonality

Orthogonality in programming languages is the property where a small set of constructs can be combined in various ways without exceptions. The script explains that orthogonality can enhance both readability and writability but also cautions that too much orthogonality can reduce readability due to complexity.

💡Abstraction

Abstraction allows programmers to handle complexity by hiding details and focusing on higher-level operations. The video script mentions process abstraction through sub-programs and data abstraction through object-oriented programming, which are vital for efficient and manageable code development.

💡Expressivity

Expressivity is the capacity of a programming language to provide a rich set of operators and functions that enable concise and powerful expression of ideas. The script contrasts expressivity with simplicity, noting that while a highly expressive language can be powerful, it may also complicate the language's overall structure.

💡Portability

Portability is the ability to transfer a program from one environment to another with minimal changes. The script uses Java as an example of a portable language, which can be easily migrated across different platforms without recompilation.

💡Programming Domains

Programming domains refer to the specific application areas for which programming languages are designed or used. The video script outlines various domains such as scientific, business, artificial intelligence, systems programming, and web software development, each with unique requirements and characteristics.

Highlights

Chapter one emphasizes the importance of understanding preliminary concepts in programming languages for their application throughout the course and in exams.

Language evaluation criteria are crucial for discussing the pros and cons of different language features and are frequently tested.

Studying programming languages can enhance the ability to express ideas, supported by cognitive science and linguistic research.

The novel '1984' by George Orwell is used as an analogy to explain the limitation of expression without specific language constructs.

Knowledge of programming language features can allow for simulating missing features in a dictated language, as illustrated with Visual Basic.

Understanding language concepts aids in choosing the appropriate programming language for a project.

General knowledge of programming languages is beneficial for making informed choices when a programmer has language options.

Studying programming languages accelerates the learning of new languages and interpreting their literature.

A deeper understanding of language concepts improves the use of known languages and exploits their full potential.

Studying language concepts contributes to the advancement of computing by enabling better language evolution and selection.

Readability is defined by the ease of understanding a program and is influenced by language simplicity and constructs.

Orthogonality in programming languages allows for a small set of constructs to be combined legally in various ways.

Support for data types and syntactic considerations, such as identifier forms, affect a language's readability.

Writeability is the ease of creating programs and is often in opposition to readability, yet both benefit from language simplicity and orthogonality.

Reliability of a programming language is determined by type checking, exception handling, and the language's overall safety.

The cost of using a programming language includes training, writing, compiling, executing, and maintaining programs.

Trade-offs between language evaluation criteria, such as reliability versus execution cost, are common in language design.

Different programming domains, such as scientific, business, AI, systems, and web software, dictate the intended use and features of a language.

Transcripts

play00:01

we'll begin with chapter one which

play00:03

discusses

play00:04

some preliminary concepts related to

play00:07

programming languages now this chapter

play00:10

is

play00:10

very important and the concepts

play00:12

discussed here are used throughout all

play00:15

of the remaining chapters

play00:17

of the textbook that we will be

play00:19

discussing through this course

play00:21

but are also very important for

play00:24

questions that you

play00:25

will see in semester tests as well as

play00:28

the exam

play00:30

so please pay very careful attention to

play00:32

this chapter

play00:33

and make sure that you understand all of

play00:35

the concepts that are discussed

play00:39

these are the topics that we will be

play00:41

discussing through the course

play00:42

of this lecture so we'll begin

play00:45

with a discussion on why we are

play00:49

in fact studying concepts of programming

play00:52

languages

play00:53

in the first place and we'll then move

play00:56

on to a discussion on a number of

play00:59

language evaluation criteria

play01:01

and these language evaluation criteria

play01:04

are used throughout the

play01:05

rest of the textbook in order to discuss

play01:08

language features and the pros and cons

play01:11

associated with

play01:13

different ways of adding these features

play01:16

to high-level programming languages

play01:18

now these language evaluation criteria

play01:21

are probably the most important part

play01:24

of the first chapter and they definitely

play01:27

will come

play01:28

up repeatedly within semester tests and

play01:31

the exam so please pay a lot of

play01:33

attention

play01:34

to these language evaluation criteria

play01:37

we'll then be

play01:38

looking at some trade-offs related to

play01:41

the language evaluation criteria that

play01:43

are very often seen within

play01:45

high-level programming languages and

play01:47

then we'll finish off this lecture with

play01:50

a discussion on programming domains

play01:53

within which

play01:54

high-level programming languages are

play01:56

used

play01:57

so to begin with i'd like you to pause

play02:00

the video at this point

play02:03

and consider why

play02:06

you think it is important to study

play02:09

general concepts

play02:10

related to programming languages

play02:15

so the textbook for this course

play02:18

discusses

play02:19

reasons for studying general concepts

play02:22

related to programming languages

play02:25

under six separate headings which you

play02:28

can see

play02:28

summarized over here so we'll be looking

play02:32

at each of these reasons in some detail

play02:34

in the coming slides

play02:38

the first reason for studying concepts

play02:41

within programming languages is that it

play02:44

increases our ability to express

play02:46

ideas and this is related to the concept

play02:51

that one cannot express what one cannot

play02:54

describe

play02:55

so this is related to some fairly

play02:57

interesting research within the

play02:59

cognitive sciences

play03:00

as well as linguistics where the idea

play03:04

is that if one doesn't have a word for a

play03:07

particular concept

play03:09

it's very difficult to even think about

play03:11

that concept

play03:13

so this is illustrated relatively nicely

play03:16

in the novel

play03:16

1984 by george orwell in which

play03:20

a totalitarian government essentially

play03:22

outlaws

play03:23

certain words related to standing up

play03:26

against the government

play03:27

and challenging it and what this results

play03:30

in

play03:31

is a populace that is really unable to

play03:34

even

play03:35

form the concept of rising up against

play03:39

the

play03:39

government so in a similar fashion

play03:42

a programming language limits the

play03:45

structures that one

play03:47

can use so a fairly simple example of

play03:50

this

play03:50

would be a programming language that

play03:52

doesn't provide

play03:54

any object-oriented programming related

play03:57

features

play03:58

and in this case you wouldn't then be

play04:00

able to use

play04:01

those features to for example build

play04:05

fairly complex data structures

play04:08

however in certain situations the

play04:11

language that one uses

play04:13

is dictated so for example if you are

play04:16

working for a company

play04:18

and they require the use of a particular

play04:20

programming language

play04:22

for a certain project and so in this

play04:25

case

play04:26

the dictated language may then not

play04:28

provide

play04:29

certain features and certain structures

play04:32

however if you know about how those

play04:35

features

play04:36

are implemented in other programming

play04:37

languages it may then be possible for

play04:40

you to

play04:41

simulate them using the features that

play04:44

are provided within the language

play04:46

so for example i was

play04:49

involved in a software development

play04:52

project

play04:53

shortly after graduating

play04:56

from my undergraduate degree and in that

play04:59

project

play05:00

we were forced to use the visual basic

play05:04

programming language now at that stage

play05:06

visual basic didn't support

play05:08

any object-oriented programming concepts

play05:11

however because we knew about

play05:13

object orientation we could use in the

play05:16

structures that were provided

play05:18

within visual basic to construct an

play05:21

object-like

play05:22

environment which then facilitated the

play05:25

development

play05:25

of our project

play05:29

the second reason for studying

play05:31

programming language concepts

play05:33

is that they help us choose appropriate

play05:36

programming languages

play05:38

for a particular project now this of

play05:40

course is

play05:41

only applicable in a situation where a

play05:44

programmer actually has a choice

play05:46

of a programming language to use for a

play05:49

project

play05:50

now very often in a real-world situation

play05:54

a programmer may be limited in terms of

play05:57

the number of programming languages

play05:59

and that they are familiar with this may

play06:02

be because the programmer received

play06:04

in-house

play06:05

training by a company and in that case

play06:08

the training would only have covered

play06:10

the specific programming languages that

play06:12

are used

play06:13

within the company alternatively a

play06:15

programmer may have been formally

play06:17

trained very long time ago

play06:19

and of course as time progresses new

play06:22

programming languages

play06:23

are developed and these languages might

play06:25

be more appropriate for

play06:27

a particular project than the language

play06:29

that the programmer

play06:30

is familiar with and so if

play06:34

in this situation the programmer has a

play06:36

general

play06:37

knowledge of language concepts

play06:41

then it will allow the programmer to

play06:43

make an informed choice

play06:45

in terms of which programming language

play06:48

would be used for a particular

play06:49

project and this is important because it

play06:52

is obviously better to use

play06:54

a directly supported feature than

play06:57

attempting to

play06:58

simulate a feature so for example if you

play07:01

know that a project

play07:02

is going to require complex data

play07:04

structures

play07:05

you would then focus the selection

play07:08

of your programming language that you

play07:11

would use for that

play07:12

project and specifically on programming

play07:15

languages that have good support

play07:17

for object-oriented programming concepts

play07:21

the third reason for studying

play07:24

programming language concepts

play07:26

is that it increases our ability to

play07:29

learn

play07:30

new programming languages so programming

play07:34

is still a very young discipline the

play07:36

very first high-level programming

play07:37

language was developed

play07:39

in the 1950s and this may seem like a

play07:42

very long time ago but in comparison

play07:45

to other sciences this is in fact a very

play07:48

short

play07:49

period of time so what this means

play07:52

is that new programming languages are

play07:54

constantly evolving

play07:55

new languages are being developed every

play07:58

few years

play07:59

and also usage patterns of existing

play08:02

programming languages constantly change

play08:04

so for example when i was undergraduate

play08:07

java was

play08:08

the big up-and-coming language and these

play08:11

days with the

play08:12

rise of data science scripting languages

play08:15

such as python and r

play08:17

have become much more popular so

play08:20

understanding then general concepts

play08:24

related to programming languages will

play08:27

help us

play08:27

reduce the time that it will take us to

play08:30

learn

play08:31

a new programming language

play08:34

also it will help us to interpret

play08:37

literature on new programming languages

play08:40

so we will be able to read about the

play08:43

feature set provided by a new

play08:45

programming language

play08:46

and this will allow us then either to

play08:50

decide to learn this programming

play08:52

language or

play08:53

discard the programming language because

play08:55

it doesn't support features

play08:56

that we are interested in

play09:00

the fourth reason for studying concepts

play09:04

within programming languages is that it

play09:07

gives us a better understanding

play09:09

of the lower level implementation of

play09:12

these programming languages

play09:14

so this allows us thing to understand

play09:16

why programming languages work the way

play09:18

that they do

play09:20

and the knock-on effect of this is

play09:23

that it will allow us to use programming

play09:25

languages

play09:26

as they were intended to be used there

play09:29

are many benefits to this

play09:31

for example it may streamline the

play09:34

development process and make it easier

play09:37

it might also cut

play09:38

down on bugs that might

play09:41

result from using language features in a

play09:43

way that they were not

play09:44

meant to be used and also allows us to

play09:48

understand

play09:49

low-level bugs better and obviously that

play09:51

will help

play09:52

us in our debugging efforts

play09:56

and finally it will also help us to

play09:59

understand

play10:00

efficiency trade-offs so for example if

play10:03

we know

play10:04

that support for object-oriented

play10:06

programming concepts

play10:09

results in a performance hit on a

play10:11

programming language

play10:13

then we will be better equipped to

play10:15

decide whether we should use an

play10:17

object-oriented

play10:18

programming language or not now

play10:21

this being said we won't be focusing too

play10:24

much

play10:25

on lower level implementation details

play10:29

and there are a number of sections and

play10:32

chapters included

play10:33

within the textbook that discuss these

play10:36

concepts in more detail

play10:38

but because this relates more to

play10:41

compiler construction

play10:42

we're going to be skipping over these

play10:44

sections

play10:46

within this course as i will be

play10:48

presenting it

play10:51

the second last reason for studying

play10:54

programming language concepts

play10:56

is that it allows us to better use the

play11:00

programming languages that we

play11:01

already know and are familiar with so

play11:05

modern programming languages are

play11:07

incredibly large

play11:08

and very complex for example if we look

play11:12

at c

play11:12

plus the language specification is over

play11:15

1

play11:16

300 pages long so what this means

play11:20

is that many programmers will only use

play11:23

a subset of features within the

play11:26

languages

play11:27

that they know and those would be the

play11:30

features that they

play11:31

are familiar with that possibly they

play11:33

were taught during their degrees

play11:36

or they learned during in-house training

play11:39

so if one knows then about

play11:43

features within the programming language

play11:46

that you are using

play11:47

then it will allow you to exploit those

play11:50

features

play11:50

so for example in c plus

play11:54

there is support for generic programming

play11:57

by means of templates um

play12:00

so of course if you don't know about

play12:03

templates

play12:04

you won't be able to use them but

play12:07

knowing about template programming

play12:09

allows you then

play12:10

to leverage that feature and it allows

play12:12

you

play12:13

to construct code that can do

play12:16

things at compile time which you would

play12:18

not be able to do

play12:20

via any other means the final reason

play12:25

for studying programming language

play12:27

concepts is

play12:28

probably the most noble and altruistic

play12:31

of the

play12:32

six reasons and this is because it

play12:35

doesn't

play12:35

directly relate to a programmer's

play12:38

day-to-day job

play12:40

so understanding these concepts then

play12:43

allows for the overall advancement

play12:48

of computing in general

play12:51

so language evolution is incredibly

play12:54

complex and we'll talk about this in

play12:56

more detail

play12:57

within chapter two however languages

play13:00

evolve from

play13:01

one another they take inspiration from

play13:03

other languages

play13:04

some programming languages are mashups

play13:07

of

play13:08

a variety of different features from a

play13:11

number of different programming

play13:13

languages

play13:14

so very often what we see

play13:18

during this evolutionary process is that

play13:20

language popularity

play13:22

is often not very well founded

play13:25

so a good example of this which we'll

play13:28

discuss in more detail in chapter 2

play13:31

is the language algol 60 versus

play13:34

fortran so fortran was the very first

play13:37

high-level programming language

play13:39

algol 60 came out a little while after

play13:43

fortran had been released and accepted

play13:47

by most of the programming industry

play13:49

and alcohol 60 introduced a large number

play13:53

of

play13:53

very important features which we see

play13:56

in every modern programming language

play13:58

today very notably for example

play14:01

algol 60 was the first high-level

play14:03

programming language to

play14:04

introduce support for recursion

play14:08

whereas fortran didn't support recursion

play14:10

at that stage

play14:11

however largely because fortran was

play14:15

so popular to begin with and it was

play14:18

used by many people within the computing

play14:22

industry most of

play14:25

these programmers stuck with fortran

play14:29

many of them didn't understand the

play14:32

features that were introduced within

play14:34

algol 60. so this in effect

play14:37

really held back the evolution

play14:41

of programming languages and computing

play14:44

in a general sense

play14:46

so if people then had a better

play14:48

understanding

play14:49

of the underlying issues related to

play14:52

programming language design

play14:54

then the people in charge for example

play14:57

project managers

play14:58

would be able to choose better

play15:01

programming languages for their projects

play15:04

and so over time better and better

play15:07

languages would eventually dominate

play15:09

and this would result in an overall

play15:12

improvement

play15:13

in the standard of programming languages

play15:17

that are available

play15:20

so now that we have justified why we

play15:23

are studying general programming

play15:25

language concepts

play15:26

we will move on to the programming

play15:29

language evaluation criteria

play15:31

so as i've previously mentioned this is

play15:34

the most important part

play15:35

of the first chapter and it is possible

play15:39

for us to divide

play15:40

define a large variety of different

play15:43

evaluation criteria

play15:45

however the criteria that the textbook

play15:48

focuses on

play15:50

are readability write-ability

play15:52

reliability and cost

play15:54

so the readability criterion defines

play15:58

how easy it is for

play16:01

someone to read and understand a

play16:04

program or a program feature

play16:08

writeability on the other hand is

play16:10

essentially the opposite of readability

play16:13

so this defines how easy it is

play16:16

for a programming language or a

play16:18

programming language feature

play16:20

to be used in order to create a program

play16:24

and what we will see is that very often

play16:27

readability and writeability

play16:29

are at odds with one another the third

play16:32

criterion

play16:33

is reliability so this specifies whether

play16:36

the language or language feature

play16:37

performs according to its specifications

play16:40

under all conditions and then finally we

play16:43

have the cost

play16:44

criterion which is the ultimate total

play16:47

cost

play16:48

of using a language or a language

play16:50

feature

play16:51

now cost is not necessarily

play16:55

a monetary cost although it very often

play16:57

is

play16:58

it may entail other kinds of costs for

play17:01

example

play17:01

a time cost so we will be

play17:05

looking at these language evaluation

play17:07

criteria in more detail

play17:09

in the following slides let's first

play17:13

take a look at the language evaluation

play17:15

criterion

play17:16

of readability so here we are talking

play17:19

about

play17:20

the ease with which somebody can read

play17:23

and understand

play17:24

a program written in a particular

play17:26

language

play17:27

now there are a lot of different

play17:28

features that contribute to the overall

play17:30

readability of a programming language

play17:33

and one very important one is the

play17:35

overall simplicity

play17:37

of the language and its constructs so

play17:40

what we want for a programming language

play17:42

to be readable

play17:43

is that it should have a manageable set

play17:46

of features

play17:47

and constructs if you have

play17:50

a relatively small set of features it

play17:53

means that the reader is less likely to

play17:56

be

play17:56

confused by a program written in that

play17:58

language

play18:00

we also want minimal feature

play18:02

multiplicity so

play18:03

this means that we want to have as few

play18:06

ways as possible

play18:08

of doing one particular thing within the

play18:11

language

play18:12

so for example if we consider languages

play18:15

like c

play18:16

c plus plus and java we see that

play18:20

incrementing a value has a number of

play18:22

different ways in which this can be

play18:24

achieved so for example we can just use

play18:27

a standard assignment operator

play18:29

we can use a pre-increment or a post

play18:32

increment

play18:32

and we can use the plus equals operator

play18:36

so here we have then one single

play18:38

operation

play18:39

incrementing a value that has a number

play18:41

of different ways to achieve that

play18:43

and again this will potentially lead to

play18:46

greater confusion

play18:47

on the part of anybody reading a program

play18:49

written in this language

play18:51

we also want minimal operator

play18:53

overloading so we don't want to use the

play18:55

same

play18:56

operator to mean a number of different

play18:58

things

play18:59

so a good example of this is in c

play19:02

plus where we have the asterisk operator

play19:06

and this in one context means that we

play19:09

are multiplying

play19:10

two values by one another in another

play19:13

context it means

play19:14

that we are defining a pointer in other

play19:17

words defining a memory address

play19:19

and in another context it means that we

play19:21

are dereferencing the points

play19:23

in order to get its value so this

play19:26

obviously

play19:27

then increases the potential for

play19:30

confusion on the part of somebody

play19:32

reading a program

play19:34

however we don't want too much

play19:36

simplicity

play19:38

because this can also be bad for

play19:39

readability

play19:41

and the reason for this is if a language

play19:43

is too simple it has too few constructs

play19:46

it means that programs then will

play19:49

generally

play19:50

have to become longer in order to

play19:52

achieve more complex operations

play19:55

and a longer program is more difficult

play19:57

to understand than a shorter program

play20:00

now the next contributor to the

play20:03

readability of a programming language

play20:05

is orthogonality and this is a very

play20:07

important concept to understand

play20:09

it will definitely come up several times

play20:12

during

play20:13

the semester tests and the exam for this

play20:15

course

play20:16

so when we're talking about

play20:18

orthogonality

play20:20

we are talking about a degree of

play20:22

orthogonality there's no

play20:24

such concept as a perfectly orthogonal

play20:27

language

play20:27

or a perfectly non-orthogonal

play20:30

programming language

play20:32

now for a programming language or a

play20:34

feature to be

play20:35

orthogonal we want a relatively small

play20:38

set

play20:38

of primitive constructs that can be

play20:41

combined in a relatively small number of

play20:43

ways

play20:44

and every possible combination is legal

play20:47

now the important thing to understand

play20:49

here is that the focus of this

play20:50

definition

play20:51

is not so much on the number of

play20:54

primitive constructs that we have within

play20:56

a programming language

play20:58

it's more focused on whether the

play21:00

combinations in which these primitive

play21:02

constructs can be used

play21:03

are all legal so an orthogonal

play21:07

programming language

play21:08

feature then is also context independent

play21:12

and a lack of orthogonality can be

play21:14

identified by

play21:16

means of exceptions within the use

play21:19

of the primitive constructs in a

play21:20

programming language

play21:22

so a good example of this then

play21:26

might be for example a multiplication

play21:28

operator

play21:30

if multiplication uses the

play21:33

same operator for integer multiplication

play21:37

as well as all of the various floating

play21:39

point

play21:40

multiplication operations then we have a

play21:43

very

play21:44

orthogonal multiplication operator

play21:47

if however as was the case in very early

play21:49

programming languages

play21:51

and we have a different operator for

play21:53

integer multiplication

play21:55

versus floating point multiplication

play21:59

because these operations are

play22:00

fundamentally different on a machine

play22:02

level

play22:03

then we have a breakdown of

play22:06

orthogonality

play22:07

and this is because the combination of

play22:10

multiplication

play22:12

operators does not work in every single

play22:15

case we

play22:16

cannot for example multiply an integer

play22:19

with a floating point value

play22:22

related to exceptions if we

play22:25

have for example a situation

play22:29

where we have functions supported within

play22:31

our programming language

play22:33

and functions can return certain values

play22:36

but not

play22:37

other values so for example if a

play22:38

function is restricted in terms

play22:40

of being able to return an array

play22:44

then in this case we have an exception

play22:47

that occurs in terms

play22:48

of what is allowed by means of the

play22:51

return value of a function

play22:52

and this then indicates that we have a

play22:55

breakdown

play22:56

of orthogonality if any value supported

play22:59

within the programming language can be

play23:00

returned by a function

play23:02

then we have very high orthogonality

play23:06

now orthogonality is not always a good

play23:09

thing

play23:10

if there's too much orthogonality in a

play23:12

programming language then this can be

play23:13

very bad for readability

play23:15

now this isn't so much an issue with

play23:18

modern programming languages

play23:19

but if we look at alcohol 68 which we'll

play23:22

speak about

play23:23

in chapter 2 then we see that this

play23:27

language was designed

play23:28

with very high orthogonality in mind

play23:32

so for example almost every single

play23:35

construct in algol 68

play23:38

can produce a value as a result

play23:41

so what this means is it is then

play23:43

possible to create

play23:45

constructs within the programming

play23:47

language that allow you to for example

play23:50

assign to a selection statement an if

play23:52

statement

play23:53

now obviously due to this very high

play23:55

level of orthogonality

play23:57

the meaning of these kinds of

play23:58

assignments

play24:00

are not necessarily very clear

play24:03

and this then of course leads to

play24:05

potential confusion which means that the

play24:07

language is then

play24:08

less readable

play24:12

another factor that affects the

play24:14

readability of a programming language

play24:16

is the support for data types within

play24:19

that language

play24:20

so what we want in order for a

play24:23

programming language to be readable

play24:25

is an adequate set of predefined data

play24:28

types

play24:29

and data structures and the reason for

play24:32

this

play24:32

is that if a type that we need within

play24:36

the programming language

play24:38

is missing then we need to simulate that

play24:40

type

play24:41

somehow so a good example of this would

play24:44

be

play24:45

a language that doesn't directly support

play24:48

boolean types

play24:49

which was the case in some of the

play24:50

earliest

play24:52

programming languages and in this case

play24:55

in order to

play24:56

simulate a boolean value you would need

play24:58

to use some sort

play24:59

of integer value this of course then

play25:02

leads to

play25:03

confusion because you now need to know

play25:07

which values map to true values and

play25:09

which values map to

play25:10

false values and so this potentially

play25:13

then

play25:14

increases confusion and breaks down the

play25:16

readability of the programming language

play25:19

then a final factor that affects

play25:22

readability

play25:23

is syntactic considerations within the

play25:26

programming language

play25:27

so there are a variety of factors

play25:31

that might be related to the readability

play25:33

of syntax

play25:35

first of all the form of identifiers

play25:38

within the programming language so when

play25:40

we're talking about

play25:41

identifiers we're talking about the

play25:43

names of

play25:44

variables or the names of sub-programs

play25:48

such as functions

play25:49

or methods or routines or whatever they

play25:51

are called in

play25:52

the particular programming language you

play25:54

are considering

play25:56

so some languages then have naming

play25:59

restrictions

play26:00

others have very relaxed naming

play26:03

restrictions or no restrictions at all

play26:06

and if you of course then have a lack of

play26:10

naming restrictions then this means that

play26:12

you can create

play26:13

very descriptive names which then of

play26:15

course improves the ability

play26:18

of someone to understand the program

play26:21

code that you've written

play26:23

so a good example of where this might

play26:26

break down would be

play26:27

in the early versions of fortrans and

play26:30

the first released version of fortran

play26:32

identify names were limited to six

play26:34

characters

play26:36

and in the initial specification of the

play26:39

language it was even fewer characters

play26:41

a maximum of two characters were allowed

play26:44

per

play26:44

identifier so of course these kinds of

play26:47

restrictions then mean that you can't

play26:48

have very descriptive

play26:50

identifiers which means that you have to

play26:52

use abbreviations

play26:53

which might be then unreadable

play26:57

next the use of special words within the

play27:01

programming language can also affect

play27:03

readability

play27:04

so what we want here is a sensible

play27:09

set of special words which will then be

play27:12

more readable

play27:13

so we want our special words typically

play27:16

to reflect

play27:17

exactly what their purpose is within the

play27:20

programming language

play27:22

so for example it might be argued

play27:25

that a while loop construct is possibly

play27:28

less readable

play27:29

than something like a repeat until

play27:32

or repeat while particular condition

play27:36

holds

play27:38

and then compound statements in other

play27:40

words blocks

play27:42

might also affect the readability of

play27:45

a programming language so for example if

play27:48

we look

play27:48

at languages like c c plus plus java c

play27:52

sharp and so on compound statements

play27:56

are indicated by means of braces and as

play27:59

i'm sure

play28:00

a lot of you have experienced in

play28:04

the past it becomes relatively difficult

play28:07

in certain situations to match the

play28:09

beginning and the end of a block

play28:11

if braces simply are used some other

play28:14

programming languages go for a slightly

play28:16

more

play28:17

verbose kind of notation so for example

play28:20

we might have for an if statement and

play28:23

end if which would close off the

play28:25

body of the if statement and for a while

play28:28

loop we might have an end

play28:29

while or end loop statement arguably

play28:32

these more verbose

play28:34

statements then are much clearer at

play28:37

indicating

play28:38

where the end of a particular block is

play28:41

because

play28:41

they match more descriptively with the

play28:44

beginning of the block

play28:47

then the form and meaning of

play28:50

syntactic features within a programming

play28:52

language may also affect

play28:54

readability so we generally want

play28:58

um self-descriptive constructs and

play29:01

meaningful keywords

play29:03

um and we want to avoid language

play29:05

constructs that have the same name

play29:07

but have a different meaning depending

play29:10

on the context

play29:11

so a good example of this would be in c

play29:14

plus where if we are considering

play29:17

object-oriented

play29:18

programming constructs the special word

play29:22

static is used to indicate a class level

play29:25

variable

play29:26

however static can also be used in the

play29:28

context

play29:29

of a static local variable within a

play29:32

function

play29:33

these two uses of the keyword static in

play29:36

fact mean

play29:37

completely different things and

play29:39

therefore this could lead

play29:40

to confusion and therefore a breakdown

play29:44

in the readability of programs written

play29:47

in c

play29:47

plus now that we've discussed

play29:51

the readability evaluation criterion

play29:55

we will move on to write ability of a

play29:58

programming language

play29:59

so here we are considering how easy it

play30:02

is for a programmer to construct a

play30:05

program

play30:05

within the programming language under

play30:07

consideration

play30:09

again there are a number of factors that

play30:11

can affect writability

play30:13

the first of which is the general

play30:15

simplicity

play30:16

and orthogonality of the programming

play30:18

language

play30:19

so if a programming language has a

play30:22

fairly small set of constructs a small

play30:26

number of primitives

play30:27

and then a small set of rules

play30:31

for combining these various primitives

play30:34

and

play30:34

constructs in a uniform

play30:36

context-independent manner

play30:39

then we are likely to have a more

play30:42

writable programming language

play30:44

so what we see here then is that

play30:46

simplicity and orthogonality

play30:48

can improve both the readability and the

play30:51

writability of

play30:52

a programming language and the reason

play30:55

that

play30:55

it improves the writability of a

play30:57

programming language

play30:59

is that the programmer will be less

play31:02

likely to be confused

play31:04

by the operators and primitives

play31:07

and constructs and how they can be

play31:10

combined

play31:10

which means that they can program in a

play31:13

fairly natural way

play31:14

meaning that the language is then more

play31:17

writable

play31:19

secondly we have the support for

play31:21

abstraction that is provided by

play31:23

a programming language or features

play31:25

within the programming language

play31:27

and what we're talking about here is the

play31:30

ability to define

play31:31

and use complex structures or operations

play31:35

in ways that allow details to be ignored

play31:38

so you should have realized by now

play31:42

through the course of your studies that

play31:44

abstraction is a fairly core

play31:46

concept within programming in general

play31:49

and the broadly speaking two kinds of

play31:52

abstraction

play31:53

that we can define firstly there's

play31:54

process abstraction which is provided by

play31:57

means of

play31:58

sub-programs so here we have a situation

play32:01

where we could

play32:02

for example write a sub program in other

play32:04

words a

play32:05

function or a method or a procedure

play32:08

that might for example sort an array of

play32:11

values

play32:12

once we've defined this subprogram we no

play32:15

longer

play32:16

need to worry about how sorting takes

play32:19

place

play32:20

we simply use this other program that

play32:22

we've written

play32:23

then secondly we have data abstraction

play32:26

and this is supported by means of

play32:28

object-oriented programming concepts

play32:31

so things like classes and inheritance

play32:34

and then to go hand-in-hand with those

play32:37

we have

play32:37

support for pointers and dynamic memory

play32:40

management so

play32:42

of course the support for object

play32:44

oriented programming also allows us to

play32:46

abstract details away

play32:48

we can define a class and then once

play32:51

we've defined that class we don't need

play32:53

to worry about how the class actually

play32:55

functions we just simply need to know

play32:57

what the class

play32:58

does then finally we have the overall

play33:02

expressivity of our programming language

play33:05

now expressivity is oftentimes

play33:08

in opposition to simplicity

play33:11

and what we're talking about when we are

play33:14

discussing the expressivity of a

play33:16

programming language

play33:17

is that we want a set of relatively

play33:19

convenient ways

play33:21

of specifying operations and this

play33:24

relates

play33:24

to the overall strength and the

play33:28

number of operators and predefined

play33:31

functions that the programming language

play33:33

provides

play33:34

so if we have a very rich programming

play33:37

language that provides a large number of

play33:39

operators and different ways of

play33:41

achieving

play33:42

specific operations it provides a lot of

play33:45

predefined functions for doing things

play33:47

like creating data structures sorting

play33:50

values in arrays or lists and that sort

play33:53

of thing

play33:54

then we have an incredibly expressive

play33:57

language this allows

play33:58

the programmer then to use a number of

play34:02

concepts to create

play34:03

a very rich program that

play34:08

has a lot of power in terms of what it

play34:11

can do

play34:12

but of course providing a very rich set

play34:15

of operators and predefined functions

play34:17

is in contradiction to the overall

play34:20

simplicity of the programming language

play34:22

so oftentimes a high-level programming

play34:25

language

play34:26

needs to strike a balance between the

play34:29

expressivity

play34:30

and the simplicity of the programming

play34:32

language in order to

play34:34

achieve a high level of writability

play34:38

the third language evaluation criterion

play34:41

that we'll consider

play34:42

is the overall reliability of a

play34:44

programming language

play34:46

or a feature within a programming

play34:48

language again

play34:49

there are a variety of different factors

play34:51

that interact in order to

play34:53

either increase or decrease the

play34:55

reliability of a programming language

play34:57

and the first and possibly one of the

play35:00

most important

play35:01

of these factors is the type checking

play35:04

supported by

play35:05

a programming language so here we're

play35:07

talking about

play35:09

the ability of a programming language to

play35:11

test for type errors

play35:13

for example in assignments checking to

play35:16

see whether the value being assigned

play35:18

is compatible with the type of the

play35:21

variable that is being assigned

play35:22

to and we'll be talking about type

play35:25

checking in quite a lot of detail

play35:27

in the coming lectures

play35:30

however in general compile time type

play35:33

checking is usually preferable to

play35:35

runtime type checking

play35:37

and the reason for this is that runtime

play35:39

type checking can cause unpredictable

play35:41

errors

play35:42

while the program is executing whereas

play35:44

compile time type checking will turn up

play35:47

the type errors before the program is

play35:49

run

play35:50

secondly we have support for exception

play35:53

handling within a programming language

play35:56

and as you should know by now exception

play35:59

handling is a mechanism provided by a

play36:01

programming language in order to

play36:03

intercept

play36:03

areas that occur at runtime and then

play36:06

take some kind of corrective action

play36:09

in order to recover from these errors

play36:11

obviously

play36:13

good support for exception handling is

play36:16

preferable in terms of reliability

play36:18

because it gives

play36:18

us more tools in order to recover

play36:21

from errors that might occur during

play36:24

execution then we have

play36:27

support for aliasing within a

play36:29

programming language

play36:30

so here we are talking about the ability

play36:33

of a programming language

play36:34

to have two or more distinct referencing

play36:38

names for the same

play36:39

memory location now usually aliasing is

play36:43

supported by means of either pointers

play36:45

or references and generally speaking

play36:50

aliasing is considered to be a

play36:52

relatively dangerous feature if it's not

play36:54

used correctly

play36:55

particularly in the case of pointers in

play36:58

terms

play36:59

of your experience with programming

play37:01

languages like c

play37:02

plus you should at this stage be fairly

play37:05

familiar

play37:06

with issues like dangling pointers and

play37:09

memory leaks

play37:10

and these are all facilitated by the

play37:12

support that c

play37:13

plus provides for aliasing

play37:16

then we also have an overall

play37:19

contribution

play37:20

of the programming language's

play37:21

readability and writability which

play37:23

can also affect the reliability of the

play37:26

programming language

play37:28

and this basically boils down to whether

play37:31

the language supports

play37:32

natural ways of expressing algorithms

play37:36

written

play37:36

in that language natural ways

play37:40

will typically be very readable as well

play37:42

as very writable

play37:44

and if natural methods for expressing

play37:48

these ideas are not provided by

play37:50

programming language

play37:52

then the programmer will be forced to

play37:53

use an unnatural approach

play37:56

which will then negatively affect

play37:59

reliability

play38:00

and because these unnatural approaches

play38:02

will typically be

play38:03

more error-prone

play38:07

the final evaluation criterion that the

play38:09

textbook focuses on

play38:11

is the overall cost of using a

play38:13

programming language

play38:15

now of course there are many factors

play38:17

that can affect this cost

play38:19

some of them are listed on this slide

play38:21

but it is certainly possible to come

play38:22

up with other factors that might have a

play38:25

cost

play38:26

impact so once again as i've previously

play38:29

mentioned the cost might be a monetary

play38:32

cost but it might also be

play38:34

something like a time based cost

play38:37

so first of all we have the cost of

play38:40

training programmers to use

play38:42

a programming language this of course

play38:45

has a time impact but it might also be

play38:48

a monetary impact if you have to hire

play38:50

people to train your programmers

play38:52

or buy licenses for some sort of online

play38:56

training program

play38:58

secondly we have the cost of writing

play39:01

programs

play39:02

so this relates to the closeness of the

play39:05

programming language to the intended

play39:07

application area

play39:09

so as we will see certain programming

play39:11

languages are designed for certain

play39:13

application

play39:14

areas so for example if you have

play39:17

a programming language that is designed

play39:19

for business applications

play39:21

it would of course then cost a lot more

play39:24

time

play39:24

if you were to use this programming

play39:26

language to attempt to write

play39:28

scientific applications so again this

play39:31

relates to

play39:32

using the correct tool for the job

play39:35

then we have the cost of compiling

play39:38

programs and the cost

play39:39

of executing programs and very often

play39:43

there's a trade-off

play39:44

between these two costs so if you

play39:47

have a very high cost

play39:50

to compilation this usually means that

play39:53

the execution cost of

play39:54

your programs will be lower and vice

play39:58

versa

play39:59

we'll speak about this in some more

play40:00

detail in the upcoming lecture

play40:03

then we have the cost of the language

play40:06

implementation system that is used

play40:08

so this basically relates to the cost of

play40:10

compilers

play40:12

are free compilers available or are

play40:14

there only proprietary compilers that

play40:16

one must purchase

play40:19

then we have the cost of reliability

play40:22

so poor reliability obviously leads to

play40:25

higher costs

play40:26

if software breaks there are cost

play40:28

implementations in terms

play40:30

of fixing the software um there might

play40:32

even be

play40:33

costs related to for example court cases

play40:36

that might stem

play40:37

from faulty software and then finally we

play40:41

have the cost

play40:42

of maintaining programs within our

play40:44

programming language

play40:45

which may relate then also to the

play40:48

reliability of the programming language

play40:51

so i'd like you at this point then

play40:55

to pause the video and consider which of

play40:58

the programming

play40:59

language evaluation criteria that we've

play41:01

discussed prior to cost

play41:03

would affect the cost of maintaining

play41:06

our programs so

play41:10

at this point i'd also like you then to

play41:13

stop

play41:14

for a moment and consider potential

play41:17

other factors

play41:18

that might maybe influence the cost of

play41:20

using a programming language

play41:22

and out of the factors listed on this

play41:25

slide

play41:25

i would like you to consider which one

play41:28

or two or three of the factors

play41:30

has the most impact in a modern day

play41:33

context

play41:36

now the previous four evaluation

play41:38

criteria that we've discussed

play41:40

namely readability writability

play41:42

reliability and cost

play41:44

are the evaluation criteria that the

play41:46

textbook and this

play41:48

course focus on however as i've

play41:50

previously mentioned it is possible to

play41:52

define

play41:53

other criteria in terms of which one

play41:55

could evaluate a programming language

play41:57

so on this slide we have just three of

play41:59

these firstly the

play42:01

portability of a programming language so

play42:04

this relates to how easy it is

play42:06

to migrate a program from

play42:09

one implementation to another for

play42:12

example some languages such as java

play42:14

allow you to very easily migrate a

play42:17

program written for example in windows

play42:20

to an apple mac without even necessarily

play42:23

needing to recompile the program

play42:26

other programming languages like c plus

play42:28

make portability fairly

play42:30

difficult and it is required to

play42:33

initiate a fairly um

play42:36

detailed and wide-ranging rewrite of the

play42:38

software to move it to

play42:40

another hardware or compiler

play42:44

platform then we have the generality

play42:47

of a programming language so this

play42:49

relates to whether the programming

play42:51

language

play42:52

is applicable to a wide range of

play42:55

applications

play42:56

as we're going to see in chapter 2 some

play42:59

programming languages are designed

play43:03

for specific application areas for

play43:05

example business processing or

play43:07

scientific computation other programming

play43:10

languages

play43:11

such as c and c plus plus are very

play43:14

widely applicable and you can write

play43:16

programs for a lot of different domains

play43:19

using the same programming language

play43:22

then finally we have how well-defined

play43:25

the programming language in question is

play43:28

and this relates

play43:29

to the official definition of the

play43:32

programming language in terms of how

play43:34

complete and precise that definition is

play43:37

so for example if we look at early

play43:39

versions of c and c

play43:41

plus plus we see that the language

play43:43

specifications were relatively

play43:45

informal and this led to a lot of

play43:48

confusion

play43:49

in terms of how compilers should

play43:51

implement the programming language

play43:53

and how the programming language should

play43:56

be

play43:56

used more modern programming languages

play43:59

such as java and c-sharp

play44:01

for example have very detailed and

play44:03

accurate

play44:04

language definitions and this leads then

play44:07

to

play44:08

far fewer mistakes related to the

play44:10

interpretation of these standards

play44:14

now that we've discussed a variety of

play44:17

different programming language

play44:18

evaluation criteria

play44:20

we can take a look at some of the

play44:22

trade-offs

play44:23

involved between these criteria now on

play44:26

this slide we have only three examples

play44:28

of trade-offs but there are many other

play44:30

kinds of trade offs that may exist these

play44:32

are just some fairly common ones that

play44:34

you will run into in practice

play44:37

so first of all a programming language

play44:40

might provide a very good reliability

play44:43

but this might come at the expense of

play44:47

a poor cost of execution for this

play44:50

programming language

play44:51

so a good example of this is java in

play44:54

which

play44:56

all references to elements within an

play44:59

array

play44:59

are checked for proper indexing if you

play45:02

attempt to index beyond the bounds of an

play45:04

array

play45:04

then java will raise some kind of

play45:07

exception

play45:08

now this of course increases the

play45:11

execution

play45:12

cost because a bounce check needs to be

play45:15

performed with every single

play45:17

array access a language like c

play45:20

plus would not have this increased

play45:23

execution cost

play45:25

because it performs no balance checking

play45:27

at all on array accesses

play45:29

java however then is much more reliable

play45:32

because

play45:33

you are able to catch every situation

play45:36

where an accidental case of indexing

play45:40

beyond the bounds of the

play45:42

array occurs whereas for example c plus

play45:45

plus would have

play45:46

reduced reliability because of this

play45:50

and then we may also have a trade-off

play45:52

between the readability and the

play45:54

writability of

play45:55

a programming language a good example of

play45:58

this

play45:58

is the programming language called apl

play46:01

or

play46:01

apple depending on who you ask

play46:04

and we'll be talking about this language

play46:06

in some more detail

play46:07

when we move on to chapter two but

play46:11

um apl or apple provides a

play46:14

set of very powerful operators

play46:18

there are operators for example that can

play46:20

perform

play46:21

matrix transpositions or inversions in

play46:24

a single step now there are so many

play46:28

operators within

play46:30

this programming language that it

play46:32

requires a large number of new symbols

play46:35

which are actually not represented on a

play46:38

standard keyboard so this then

play46:42

allows for an increase in writability

play46:45

because it allows us

play46:46

to construct very complex programs

play46:49

using very few characters the programs

play46:53

written in apl are typically

play46:57

fairly short however the readability is

play47:00

very poor because

play47:01

you have to attempt to decipher

play47:05

this large set of symbols in order to

play47:07

understand

play47:08

what the programs do then we might

play47:11

also have trade-offs between the

play47:13

writeability of a programming language

play47:15

in terms of its flexibility

play47:17

versus the reliability of the

play47:20

programming language

play47:21

so a good example of this is in c plus

play47:24

we know that there is support for

play47:26

pointers and pointer arithmetic

play47:29

so pointers are very powerful they add a

play47:31

lot of flexibility to the c

play47:33

plus plus programming language they

play47:35

allow us

play47:36

to create aliases they allow us to do

play47:39

dynamic memory management

play47:40

ourselves and they're very flexible

play47:43

however

play47:44

as i've previously mentioned pointers

play47:48

are fairly dangerous to use and

play47:50

therefore they negatively affect

play47:53

the reliability of our programming

play47:55

language

play47:56

now what's important to understand here

play47:58

is that

play47:59

these trade-offs don't necessarily occur

play48:03

in this way for every programming

play48:05

language it is for example completely

play48:07

possible for us to have a programming

play48:09

language

play48:10

that is both very readable and very

play48:13

writable so it's important in terms of

play48:16

questions related to trade-offs between

play48:19

language evaluation criteria

play48:21

to understand the context of the

play48:23

question and answer appropriately based

play48:26

on that context

play48:29

the final issue that we'll be

play48:31

considering in this lecture

play48:32

is the existence of different

play48:35

programming domains

play48:37

so when we talk about programming domain

play48:39

we're talking about

play48:41

the intended application area for a

play48:43

programming language

play48:45

and what we'll see particularly through

play48:48

the course of chapter 2 is that

play48:51

different

play48:52

programming languages were devised with

play48:54

different intended

play48:55

purposes so first of all we have

play48:59

scientific application areas and this

play49:01

was in for

play49:02

in fact the context that the

play49:05

very first high-level programming

play49:07

language namely fortran

play49:09

was developed for so typically

play49:11

scientific applications

play49:13

require very efficient floating point

play49:16

computations

play49:18

and also support for efficient array use

play49:22

and this is because typically in a

play49:24

scientific application area

play49:26

you're interested in computing

play49:27

statistics for values therefore you need

play49:30

support for floating point

play49:32

computations and you're usually working

play49:35

with

play49:35

lists of observations or readings or

play49:38

measurements

play49:39

and therefore you need support for

play49:41

arrays so a good example of this

play49:44

of course then is fortran the next

play49:46

application area

play49:47

also one of the earliest application

play49:49

areas was

play49:50

for business application writing

play49:54

so here you are interested in the

play49:56

programming language that supports

play49:58

reports in other words it needs good

play50:00

string and character handling

play50:03

and also the use of decimal number

play50:06

values now we'll talk a little bit

play50:08

more about decimal number values in

play50:10

upcoming lectures

play50:12

however they differ from floating point

play50:14

values in

play50:15

that they are more accurate

play50:18

representations

play50:19

of specific decimal values and we would

play50:22

use decimal

play50:24

number representations to represent for

play50:26

example

play50:28

monetary values or currency exchange

play50:31

rates and those kinds of things

play50:32

where a high degree of accuracy

play50:36

is necessary so a good example

play50:39

of a language designed for business

play50:41

applications

play50:42

is cobalt the very first programming

play50:45

language developed for this

play50:46

intended purpose the third programming

play50:50

domain

play50:50

that we'll consider is that of

play50:53

artificial

play50:54

intelligence um so these days

play50:57

general purpose programming languages

play50:59

are very often used for artificial

play51:01

intelligence

play51:02

but if we look at earlier artificial

play51:05

intelligence applications

play51:07

and of course still work that happens

play51:08

today

play51:10

we would be interested in manipulating

play51:12

symbols

play51:13

rather than numbers where symbols

play51:14

represent concepts

play51:16

or ideas or objects within an

play51:18

environment that we want to manipulate

play51:21

and then also support four linked lists

play51:25

where we would want to represent for

play51:27

example

play51:29

objects in an environment that are

play51:30

related to each other

play51:32

in some kind of way we would then use a

play51:35

linked list representation which can

play51:37

grow and shrink

play51:38

as we add objects and remove them from

play51:41

our environment

play51:42

a good example of an early language that

play51:45

was intended for artificial intelligence

play51:47

applications

play51:49

is the first functional programming

play51:51

language namely

play51:52

lisp but we will also see

play51:55

that the prologue programming language

play51:58

was also designed for artificial

play52:00

intelligence

play52:01

applications then we have systems

play52:03

programming so what we are talking about

play52:05

here

play52:06

is programming languages that are

play52:08

designed

play52:09

for writing lower level systems such as

play52:12

operating systems

play52:14

or control systems so here the primary

play52:18

focus is on the efficiency of the

play52:21

programming language because these

play52:24

systems

play52:25

are typically used continuously it's no

play52:28

good if an operating system for example

play52:30

every time

play52:31

that it needs to create

play52:34

a write operation to a file locks

play52:37

up the entire execution of the whole

play52:40

operating system

play52:41

so we need very efficient languages that

play52:43

support very efficient

play52:46

structures within those languages a good

play52:48

example here is the c programming

play52:50

language

play52:51

very efficient but potentially depending

play52:54

on how you use the language

play52:56

fairly unreliable as well and then

play52:59

finally

play53:00

we have the web software programming

play53:03

domain

play53:04

we won't be focusing on this domain a

play53:06

lot within this course

play53:08

we already just mention it fairly

play53:10

briefly in places

play53:12

but generally here we have an eclectic

play53:15

collection

play53:15

of languages be they programming

play53:18

languages or

play53:19

markup languages so in a typical

play53:23

web software context we would usually

play53:26

use a combination

play53:28

of a markup language such as html or

play53:31

possibly xml

play53:32

we may combine that with scripting

play53:35

languages such as php

play53:36

or python for example and we may even

play53:39

include

play53:40

some general purpose programming

play53:41

languages such as

play53:43

java by means of embedded java applets

play53:47

right so that concludes the first

play53:51

part of our discussion on chapter one

play53:54

in the next lecture we will be finishing

play53:56

off the first chapter of the textbook

play53:59

in preparation for moving on to our

play54:02

history lesson in terms of the evolution

play54:05

of high-level programming languages

Rate This

5.0 / 5 (0 votes)

Related Tags
Programming LanguagesSoftware DevelopmentLanguage ConceptsCognitive SciencesLanguage EvaluationReadabilityWriteabilityReliabilityCost AnalysisEducational ResourceHigh-Level LanguagesIndustry Standards