Aims:

This module provides an introduction to computer programming using two different programming styles, imperative and functional programming. Its primary aim is to develop core design, programming, and problem-solving skills, with a secondary aim of building confidence in the ability to take on and learn new programming languages within a short space of time. In order to achieve these aims the module has a substantial practical element in the form of compulsory lab classes where students work through sets of programming exercises to apply the programming concepts introduced during the module lectures.Learning outcomes:

On successful completion of the module, a student will be able to:

Design, implement, and debug small programs using two different programming paradigms, given straightforward specifications.
	Develop straightforward algorithms to solve a range of common programming problems.
	Compare and contrast the different paradigms, understanding the relative advantages and disadvantages of each.
	Use common programming tools such as compilers, editors and debuggers.
	Gain a basic understanding of how programs use computer memory, memory management, and the binary representation of data values.
Content:

Core Programming Concepts:

What is programming?
	Programming languages.
	Programs and algorithms.
	Compilers and tools.
	Running and debugging programs.
Introduction to Imperative Programming:

Core imperative programming ideas: sequence, selection, iteration, recursion, assignment and variables.
	Types and type checking.
	Functions, parameters, scope and lifetime.
	Arrays and files.
	Pointers, memory allocation, and memory management.
Introduction to Functional Programming:

Core functional programming ideas.
	Recursion and recursive data structures such as lists.
	Lazy evaluation.
	Role of types.
	Higher order functions.
	List comprehension.
	Recursive functions.
Program design in the small:

Designing and implementing small programs.
	Implementing and using basic algorithms and data structures.
	Good programming and design practice.
Requisites:

To be eligible to select this module as optional or elective, a student must be registered on a programme and year of study for which it is formally available.