CIS 554 What This Course is About
Fall 2016, David Matuszek
The Sapir-Whorf hypothesis
The Sapir-Whorf hypothesis: A theory developed by Edward Sapir and Benjamin
Lee Whorf that states that the structure of a language determines or greatly
influences the modes of thought and behavior characteristic of the culture
in which it is spoken. (Wikipedia)
Fortran was one of the earliest programming languages. There is an old
saying that "You can write a Fortran program in any language." What this
means is: With some ingenuity, you can force the new language to accept
programs written in style of Fortran, ignoring the newer and often radically
better approaches available in later languages.
says that " In a 2003 presentation at an open source convention, Yukihiro
Matsumoto, creator of the programming language Ruby, said that one of his
inspirations for developing the language was the science fiction novel
Babel-17, based on the Sapir–Whorf Hypothesis."
The following summary of language paradigms is oversimplified, but should
give some idea of what constitutes a "paradigm."
- With an algorithmic language, the programmer uses
loops and conditionals to tell the computer exactly how to solve a
- In an object-oriented language, the emphasis is on
managing the states and interactions of objects. Within individual
methods, the logic is algorithmic.
- In a declarative language, the programmer states
facts and relationships, and it is the computer's job to find solutions
to problems. Loops and conditionals are used rarely if at all.
- In a functional language, there is no concept of
state, and side effects are prohibited or strictly isolated. Loops are
replaced by bulk operations on lists.
- In a dataflow language, modifying the value of a
variable immediately affects the values of other variables (think of
- A reactive language is like a dataflow language in
which the values of variables are modified by external events.
The goals of this course
Every programming language has it's own "genius," it's own preferred way
of thinking about problems. The "mainstream" languages--Java, C, C++,
Objective-C, C#, and (to some extent) Python--are mostly very similar in
their approaches. Sure, there are some differences. For example, one would
never consider incrementing a pointer in Java. However, all these
languages are firmly based in algorithmic thinking.
This isn't the only way to program.
Prolog and Lisp have no built-in loops (although you can "hack" them),
because they aren't needed. Scala has an actual "while" loop, but it also
has a "for" loop that, when examined closely, really isn't a loop. Haskell
has no loops at all. These are not deficiencies, because the named
languages have features of equal or greater usefulness. The trick is to
learn to "think in the language," rather than thinking in C (or Fortran)
and trying to force the language to behave like C.
I believe the best way to learn concepts is to use them, and the best way
to use new programming concepts is by writing programs in the languages
that support and encourage those concepts. Later, those concepts can be
carried over into more conventional languages, once they have become a
part of the programmer's "mental toolkit."
The primary goals of this course are to teach you new ways to think about
programming, additional tools to use in conventional programming, and to
give you the confidence to tackle new languages and systems. Along the
way, I think you will become a better programmer.
I have tried to choose, among the languages I am at least somewhat
familiar with, those that best serve as examples of the concepts I wish to
convey. This means not only that the features in question are well
supported, but also that the syntax is simple enough to pick up quickly. (In
one or two cases, the syntax itself involves new concepts.) These criteria
rule out the most popular languages, which are all mainly algorithmic and
object oriented. Consequently the languages chosen are not "mainstream," and
you will probably never use them outside of class. You will,
however, encounter the concepts again and again.
One partial exception is the Scala language. Scala is a competitor to Java
that is designed from the ground up to incorporate both object-oriented and
functional programming concepts. All modern languages are gradually
incorporating functional concepts; even Java 8 tries to fit them into the
existing language. But Scala is, in my opinion, just a much better language.
Finally, reactive programming is becoming more and more important. Last year
I used Elm to illustrate reactive programming, but since then Elm has
this purpose, but both seem to me to make reactivity both complicated and
difficult. I am still looking for the best vehicle for reactive programming.