Computer Science: Programming with a Purpose (Coursera)

Offered by Princeton University,
Computer Science: Programming with a Purpose (Coursera)

The basis for education in the last millennium was “reading, writing, and arithmetic;” now it is reading, writing, and computing. Learning to program is an essential part of the education of every student, not just in the sciences and engineering, but in the arts, social sciences, and humanities, as well. Beyond direct applications, it is the first step in understanding the nature of computer science’s undeniable impact on the modern world.

Class Deals by MOOC List - Click here and see Coursera's Active Discounts, Deals, and Promo Codes.

This course covers the first half of our book Computer Science: An Interdisciplinary Approach (the second half is covered in our Coursera course Computer Science: Algorithms, Theory, and Machines). Our intent is to teach programming to those who need or want to learn it, in a scientific context.
We begin by introducing basic programming elements such as variables, conditionals, loops, arrays, and I/O. Next, we turn to functions, introducing key concepts such as recursion, modular programming, and code reuse. Then, we present a modern introduction to object-oriented programming.
We use the Java programming language and teach basic skills for computational problem solving that are applicable in many modern computing environments. Proficiency in Java is a goal, but we focus on fundamental concepts in programming, not Java per se.
All the features of this course are available for free. It does not offer a certificate upon completion.

Syllabus

WEEK 1
Basic programming concepts
Why program? This lecture addresses that basic question. Then it describes the anatomy of your first program and the process of developing a program in Java using either virtual terminals or a program development environment, with some historical context. Most of the lecture is devoted to a thorough coverage of Java's built-in data types, with example programs for each.

WEEK 2
Conditionals and loops
The if, while, and for statements are Java's fundamental control structures. This lecture is built around short programs that use these constructs to address important computational tasks. Examples include sorting, computing the square root, factoring, and simulating a random process. The lecture concludes with a detailed example illustrating the process of debugging a program.

WEEK 3
Arrays
Computing with a large sequence of values of the same type is extremely common. This lecture describes Java's built-in array data structure that supports such applications, with several examples, including shuffling a deck of cards, the coupon collector test for randomness, and random walks in a grid.

WEEK 4
Input and output
To interact with our programs, we need mechanisms for taking information from the outside world and for presenting information to the outside world. This lecture describes several such mechanisms: for text, drawings, and animation. Detailed examples covered include fractal drawings that model natural phenomena and an animation of a ball bouncing around in the display window.

WEEK 5
Functions and libraries
Modular programming is the art and science of breaking a program into pieces that can be individually developed. This lecture introduces functions (Java methods), a fundamental mechanism that enables modular programming. Motivating examples include functions for the classic Gaussian distribution and an application that creates digital music.

WEEK 6
Recursion
A recursive function is one that calls itself. This lecture introduces the concept by treating in detail the ruler function and (related) classic examples, including the Towers of Hanoi puzzle, the H-tree, and simple models of the real world based on recursion. We show a common pitfall in the use of recursion, and a simple way to avoid it, which introduces a different (related) programming paradigm known as dynamic programming.

WEEK 7
Performance
When you develop a program, you need to be aware of its resource requirements. In this lecture, we describe a scientific approach to understanding performance, where we develop mathematical models describing the running time our programs and then run empirical tests to validate them. Eventually we come to a simple and effective approach that you can use to predict the running time of your own programs that involve significant amounts of computation.

WEEK 8
Abstract data types
In Java, you can create your own data types and use them in your programs. In this and the next lecture, we show how this ability allows us to view our programs as abstract representations of real-world concepts. First we show the mechanics of writing client programs that use data types. Our examples involve abstractions such as color, images, and genes. This style of programming is known as object-oriented programming because our programs manipulate objects, which hold data type values.

WEEK 9
Creating data types
Creating your own data types is the central activity in modern Java programming. This lecture covers the mechanics (instance variables, constructors, instance methods, and test clients) and then develops several examples, culminating in a program that uses a quintessential mathematical abstraction (complex numbers) to create visual representations of the famous Mandelbrot set.

WEEK 10
Programming languages
We conclude the course with an overview of important issues surrounding programming languages. To convince you that your knowledge of Java will enable you to learn other programming languages, we show implementations of a typical program in C, C++, Python, and Matlab. We describe important differences among these languages and address fundamental issues, such as garbage collection, type checking, object oriented programming, and functional programming with some brief historical context.

Go to Class
MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Related Courses

Estruturas de dados Python (Coursera) Coursera
University of Michigan

Estruturas de dados Python (Coursera)

Este curso apresentará as estruturas de dados centrais da linguagem de programação Python. Vamos superar os fundamentos da programação de procedimentos e explorar como podemos usar as estruturas de dados integradas do Python, como listas, dicionários e tuplas, para realizar análises de dados cada vez mais complexas. Este curso cobrirá os capítulos 6 a 10 do livro “Python para Todos”. Este curso aborda o Python 3.

Aug 10th 2026
5-12 Weeks
Parallel programming (Scala 2 version) (Coursera) Coursera
École Polytechnique Fédérale de Lausanne

Parallel programming (Scala 2 version) (Coursera)

With every smartphone and computer now boasting multiple processors, the use of functional ideas to facilitate parallel programming is becoming increasingly widespread. In this course, you'll learn the fundamentals of parallel programming, from task parallelism to data parallelism. In particular, you'll see how many familiar ideas from functional programming map perfectly to to the data parallel paradigm. We'll start the nuts and bolts how to effectively parallelize familiar collections operations, and we'll build up to parallel collections, a production-ready data parallel collections library available in the Scala standard library.

Aug 10th 2026
4 Weeks
Programming Reactive Systems (Scala 2 version) (Coursera) Coursera
École Polytechnique Fédérale de Lausanne

Programming Reactive Systems (Scala 2 version) (Coursera)

Reactive programming is a set of techniques for implementing scalable, resilient and responsive systems as per the Reactive Manifesto. Such systems are based on asynchronous message-passing, and their basic building-blocks are event handlers. This course teaches how to implement reactive systems in Scala and Akka by using high-level abstractions, such as actors, asynchronous computations, and reactive streams.

Aug 10th 2026
5-12 Weeks
Image and video processing: From Mars to Hollywood with a stop at the hospital (Coursera) Coursera
Duke University

Image and video processing: From Mars to Hollywood with a stop at the hospital (Coursera)

In this course, you will learn the science behind how digital images and video are made, altered, stored, and used. We will look at the vast world of digital imaging, from how computers and digital cameras form images to how digital special effects are used in Hollywood movies to how the Mars Rover was able to send photographs across millions of miles of space.

Aug 10th 2026
5-12 Weeks
The Fundamental of Data-Driven Investment (Coursera) Coursera
Sungkyunkwan University - SKKU

The Fundamental of Data-Driven Investment (Coursera)

In this course, the instructor will discuss the fundamental analysis of investment using R programming. The course will cover investment analysis topics, but at the same time, make you practice it using R programming. This course's focus is to train you to do the elemental analysis for investment management that you might need to do in your job every day. Additionally, the study note to do using Python programming will be provided.

Aug 10th 2026
4 Weeks
Algorithmic Thinking (Part 1) (Coursera) Coursera
Rice University

Algorithmic Thinking (Part 1) (Coursera)

Experienced Computer Scientists analyze and solve computational problems at a level of abstraction that is beyond that of any particular programming language. This two-part class is designed to train students in the mathematical concepts and process of "Algorithmic Thinking", allowing them to build simpler, more efficient solutions to computational problems.

Aug 10th 2026
4 Weeks
IBM z/OS Rexx Programming (Coursera) Coursera
IBM

IBM z/OS Rexx Programming (Coursera)

This course is designed to teach you the basic skills required to write programs using the REXX language in z/OS. The course covers the TSO extensions to REXX and interaction with other environments such as the MVS console, running REXX in batch jobs, and compiling REXX. A total of 11 hands-on labs on an IBM Z server (via remote Skytap access) are part of this course.

Aug 10th 2026
5-12 Weeks
Functional Program Design in Scala (Scala 2 version) (Coursera) Coursera
École Polytechnique Fédérale de Lausanne

Functional Program Design in Scala (Scala 2 version) (Coursera)

In this course you will learn how to apply the functional programming style in the design of larger Scala applications. You'll get to know important new functional programming concepts, from lazy evaluation to structuring your libraries using monads. We'll work on larger and more involved examples, from state space exploration to random testing to discrete circuit simulators. You’ll also learn some best practices on how to write good Scala code in the real world. Finally, you will learn how to leverage the ability of the compiler to infer values from types.

Aug 10th 2026
5-12 Weeks