Skip to content
UoL CS Notes

Lecture 1-1

COMP105 Lectures

Programming languages can be split into imperative and functional. This course will focus on the functional language of Haskell.

  • Imperative programs tell the computer how to compute the answer.
    • Declare variables
    • Go around a loop
    • Do the same instructions each time
  • Functional programming languages follow mathematic definitions and focus on recursion. No variables are declared and no explicit loops.
    • No variables
      • No such thing as a variable in functional programming.
    • No explicit loops
      • using recursive functions.

Functional programming is a style of programming the isn’t dependant on the language that is is written in. Functional programming languages are built to support this style.

Course Focus

The course will focus on functional languages but we will compare the two styles of programming.

Haskell is a pure functional languages as you cannot program in an imperative style easily.

Why Functional Languages are Important

  1. Their usefulness is increasing
    • Multi-core systems and GPUs prefer highly parallel code which functional programs are.
  2. Learning the functional style can make you a better imperative programmer.
    • Sometimes the functional style is more appropriate.
    • Many imperative languages support functional styles.
  3. Functional programming is a good preparation fo a computer science education.
    • Algorithms in CS are often presented in a functional way.
    • Functional programming helps you translate the algorithms into functional code.
    • The functional paradigm is also used in the analysis of algorithms.