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

Programming and Application Foundations (Coursera) Coursera
Illinois Tech

Programming and Application Foundations (Coursera)

This course introduces the students to the creation and deployment of modern, standards-compliant web pages written in HTML, CSS, and JavaScript in the context of the client-server architecture of the web. The course also covers the fundamentals of programming in a modern programming language, basic data modeling, database design, implementation, and administration of single-user and shared multi-user database applications using a contemporary relational database management system.

Aug 17th 2026
5-12 Weeks
Introduction à la programmation orientée objet (en Java) (Coursera) Coursera
École Polytechnique Fédérale de Lausanne

Introduction à la programmation orientée objet (en Java) (Coursera)

Ce cours introduit la programmation orientée objet (encapsulation, abstration, héritage, polymorphisme) en l'illustrant en langage Java. Il présuppose connues les bases de la programmation (variables, types, boucles, fonctions, ...). Il est conçu comme la suite du cours « Initiation à la programmation (en Java) ».

Aug 16th 2026
5-12 Weeks
Introduction to TCP/IP (Coursera) Coursera
Yonsei University

Introduction to TCP/IP (Coursera)

You use the Internet through your PC (Personal Computer), laptop, tablet, smartpad, and smartphone every day in everything you do. Through your own PC/laptop, you can easily learn everything about the Internet, and that is what this course is focused on. In this course ‘Introduction to TCP/IP,’ you will learn the operational functions of Internet technologies (which include IPv4, IPv6, TCP, UDP, addressing, routing, domain names, etc.) and your PC/laptop's security and gateway Internet setup and basic principles.

Aug 17th 2026
5-12 Weeks
Introduction to Software, Programming, and Databases (Coursera) Coursera
IBM

Introduction to Software, Programming, and Databases (Coursera)

There are many types of software and understanding software can be overwhelming. This course aims to help you understand more about the types of software and how to manage software from an information technology (IT) perspective. This course will help you understand the basics of software, cloud computing, web browsers, development and concepts of software, programming languages, and database basics.

Aug 17th 2026
5-12 Weeks
Learn Imba (Coursera) Coursera
Scrimba

Learn Imba (Coursera)

In this class, you'll dive into Imba, the programming language used to build scrimba.com. Imba, a compile-to-JavaScript language, packs a punch with nifty features for whipping up web apps, including built-in tags and styles. We'll cover the ABCs of Imba syntax and work on creating a Dopamine Box app. By the finish line, you'll be armed with the skills to construct your very own web app UI using Imba.

Aug 17th 2026
1 Week
COBOL Programming with VSCode (Coursera) Coursera
IBM

COBOL Programming with VSCode (Coursera)

Professor Tak Auyeung of American River College, said it beautifully, “A programming language is not a fashion statement” it is used for a purpose. Whether it is to add new features, modify logic, create APIs to integrate it into other applications, or implement modern development practices, businesses around the world need application developers who know COBOL.

Aug 17th 2026
3 Weeks
System Validation (2): Model process behaviour (Coursera) Coursera
EIT Digital

System Validation (2): Model process behaviour (Coursera)

System Validation is the field that studies the fundamentals of system communication and information processing. It is the next logical step in computer science and improving software development in general. It allows automated analysis based on behavioural models of a system to see if a system works correctly. We want to guarantee that the systems does exactly what it is supposed to do.

Aug 17th 2026
3 Weeks
Digital Signal Processing 4: Applications (Coursera) Coursera
École Polytechnique Fédérale de Lausanne

Digital Signal Processing 4: Applications (Coursera)

Digital Signal Processing is the branch of engineering that, in the space of just a few decades, has enabled unprecedented levels of interpersonal communication and of on-demand entertainment. By reworking the principles of electronics, telecommunication and computer science into a unifying paradigm, DSP is a the heart of the digital revolution that brought us CDs, DVDs, MP3 players, mobile phones and countless other devices.

Aug 17th 2026
3 Weeks
Laboratório de Programação Orientada a Objetos - Parte 2 (Coursera) Coursera
Universidade de São Paulo, Brasil

Laboratório de Programação Orientada a Objetos - Parte 2 (Coursera)

Esta é a segunda parte do curso avançado de Programação Orientada a Objetos oferecido pelo Departamento de Ciência da Computação do IME-USP. O curso é voltado para profissionais ou estudantes interessados em Desenvolvimento de Software Avançado e que já dominam uma linguagem de programação e já conhecem os fundamentos básicos da orientação a objetos.

Aug 17th 2026
5-12 Weeks
Practical Steps for Building Fair AI Algorithms (Coursera) Coursera
Fred Hutchinson Cancer Center

Practical Steps for Building Fair AI Algorithms (Coursera)

Algorithms increasingly help make high-stakes decisions in healthcare, criminal justice, hiring, and other important areas. This makes it essential that these algorithms be fair, but recent years have shown the many ways algorithms can have biases by age, gender, nationality, race, and other attributes. This course will teach you ten practical principles for designing fair algorithms. It will emphasize real-world relevance via concrete takeaways from case studies of modern algorithms, including those in criminal justice, healthcare, and large language models like ChatGPT. You will come away with an understanding of the basic rules to follow when trying to design fair algorithms, and assess algorithms for fairness.

Aug 17th 2026
4 Weeks