Distilling PEP 8 for Teaching Introductory Programming

Writing code that exhibits 'good style' is considered important in industry because such code is easier to understand and change and so reduces ongoing maintenance costs.It is therefore appropriate that computer science educators teach students how to write such code.However there are challenges in doing so.Professional style guides such as PEP 8 exist, but they are not designed for teaching as they contain content that is not suitable for introductory programming courses and often present advice without explaining why it should be adopted.This means that instructors who wish to base style instruction on an accepted standard must spend time extracting relevant information and adapting guidelines for teaching.We believe that a more systematic and rigorous approach to embedding style in our courses is necessary, and there is value in aligning what we do with industry practices to better prepare students.In this paper, we describe a study to create a Python primer based on PEP 8 for instructors of introductory programming courses.We used a Code Style Model (CSM) as a basis for explaining how the individual guidelines relate to broader principles of quality and clarifying why the guidelines should be adopted.Our contribution is a Python primer for code style based on PEP 8.

Authors

Institutions

Publication Details

Published
2025-02-12
DOI
https://doi.org/10.1145/3716640.3716644
Primary Topic
Teaching and Learning Programming
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Distilling PEP 8 for Teaching Introductory Programming

Andrew Luxton-Reilly, Diana Kirk, Ewan D. Tempero
Teaching and Learning Programming
article

Distilling PEP 8 for Teaching Introductory Programming

Andrew Luxton-Reilly, Diana Kirk, Ewan D. Tempero
article en

Abstract

Writing code that exhibits 'good style' is considered important in industry because such code is easier to understand and change and so reduces ongoing maintenance costs.It is therefore appropriate that computer science educators teach students how to write such code.However there are challenges in doing so.Professional style guides such as PEP 8 exist, but they are not designed for teaching as they contain content that is not suitable for introductory programming courses and often present advice without explaining why it should be adopted.This means that instructors who wish to base style instruction on an accepted standard must spend time extracting relevant information and adapting guidelines for teaching.We believe that a more systematic and rigorous approach to embedding style in our courses is necessary, and there is value in aligning what we do with industry practices to better prepare students.In this paper, we describe a study to create a Python primer based on PEP 8 for instructors of introductory programming courses.We used a Code Style Model (CSM) as a basis for explaining how the individual guidelines relate to broader principles of quality and clarifying why the guidelines should be adopted.Our contribution is a Python primer for code style based on PEP 8.

University of Auckland (NZ)
Zero hunger
Openalex Percentile: Top 94%
Teaching and Learning Programming
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Distilling PEP 8 for Teaching Introductory Programming — Andrew Luxton-Reilly, Diana Kirk, et al. · (2025) | TGRS Research Map | TGRS