csfieldguide/curriculum_guides/content/en/apcsp/sections/programming.md
# Programming
## Overview
- EU 5.1 Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).
- EU 5.2 People write programs to execute algorithms.
- EU 5.3 Programming is facilitated by appropriate abstractions.
- EU 5.4 Programs are developed, maintained, and used by people for different purposes.
- EU 5.5 Programming uses mathematical and logical concepts.
## Reading from the Computer Science Field Guide
Start by reading through:
- [Programming Languages]('chapters:chapter' 'programming-languages')
- [Software Engineering]('chapters:chapter' 'software-engineering')
- [Human Computer Interaction]('chapters:chapter' 'human-computer-interaction')
The AP CSP framework does not require a specific programming language but does require students to learn programming.
## Learning objectives
The above chapter readings include specific knowledge for EKs marked in bold. Work to include unmarked learning objectives in the CS Field Guide is currently in progress.
### LO 5.1.1 Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge.
- **EK 5.1.1A Programs are developed and used in a variety of ways by a wide range of people depending on the goals of the programmer.**
- **EK 5.1.1B Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may have visual, audible, or tactile inputs and outputs.**
- **EK 5.1.1C Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may be developed with different standards or methods than programs developed for widespread distribution.**
- **EK 5.1.1D Additional desired outcomes may be realized independently of the original purpose of the program.**
- **EK 5.1.1E A computer program or the results of running a program may be rapidly shared with a large number of users and can have widespread impact on individuals, organizations, and society.**
- **EK 5.1.1F Advances in computing have generated and increased creativity in other fields.**
### LO 5.1.2 Develop a correct program to solve problems.
- **EK 5.1.2A An iterative process of program development helps in developing a correct program to solve problems.**
- EK 5.1.2B Developing correct program components and then combining them helps in creating correct programs.
- EK 5.1.2C Incrementally adding tested program segments to correct working programs helps create large correct programs.
- **EK 5.1.2D Program documentation helps programmers develop and maintain correct programs to efficiently solve problems.**
- **EK 5.1.2E Documentation about program components, such as code segments and procedures, helps in developing and maintaining programs.**
- EK 5.1.2F Documentation helps in developing and maintaining programs when working individually or in collaborative programming environments.
- **EK 5.1.2G Program development includes identifying programmer and user concerns that affect the solution to problems.**
- **EK 5.1.2H Consultation and communication with program users is an important aspect of program development to solve problems.**
- **EK 5.1.2I A programmer’s knowledge and skill affects how a program is developed and how it is used to solve a problem.**
- **EK 5.1.2J A programmer designs, implements, tests, debugs, and maintains programs when solving problems.**
### LO 5.1.3 Collaborate to develop a program.
- EK 5.1.3A Collaboration can decrease the size and complexity of tasks required of individual programmers.
- EK 5.1.3B Collaboration facilitates multiple perspectives in developing ideas for solving problems by programming.
- EK 5.1.3C Collaboration in the iterative development of a program requires different skills than developing a program alone.
- EK 5.1.3D Collaboration can make it easier to find and correct errors when developing programs.
- EK 5.1.3E Collaboration facilitates developing program components independently.
- EK 5.1.3F Effective communication between participants is required for successful collaboration when developing programs.
### LO 5.2.1 Explain how programs implement algorithms.
- **EK 5.2.1A Algorithms are implemented using program instructions that are processed during program execution.**
- EK 5.2.1B Program instructions are executed sequentially.
- EK 5.2.1C Program instructions may involve variables that are initialized and updated, read, and written.
- EK 5.2.1D An understanding of instruction processing and program execution is useful for programming.
- EK 5.2.1E Program execution automates processes.
- EK 5.2.1F Processes use memory, a central processing unit (CPU), and input and output.
- EK 5.2.1G A process may execute by itself or with other processes.
- EK 5.2.1H A process may execute on one or several CPUs.
- EK 5.2.1I Executable programs increase the scale of problems that can be addressed.
- EK 5.2.1J Simple algorithms can solve a large set of problems when automated.
- EK 5.2.1K Improvements in algorithms, hardware, and software increase the kinds of problems and the size of problems solvable by programming.
### LO 5.3.1 Use abstraction to manage complexity in programs.
- EK 5.3.1A Procedures are reusable programming abstractions.
- EK 5.3.1B A procedure is a named grouping of programming instructions.
- EK 5.3.1C Procedures reduce the complexity of writing and maintaining programs.
- EK 5.3.1D Procedures have names and may have parameters and return values.
- EK 5.3.1E Parameterization can generalize a specific solution.
- EK 5.3.1F Parameters generalize a solution by allowing a procedure to be used instead of duplicated code.
- EK 5.3.1G Parameters provide different values as input to procedures when they are called in a program.
- EK 5.3.1H Data abstraction provides a means of separating behavior from implementation.
- EK 5.3.1I Strings and string operations, including concatenation and some form of substring, are common in many programs.
- EK 5.3.1J Integers and floating-point numbers are used in programs without requiring understanding of how they are implemented.
- EK 5.3.1K Lists and list operations, such as add, remove, and search, are common in many programs.
- EK 5.3.1L Using lists and procedures as abstractions in programming can result in programs that are easier to develop and maintain.
- EK 5.3.1M Application program interfaces (APIs) and libraries simplify complex programming tasks.
- EK 5.3.1N Documentation for an API/library is an important aspect of programming.
- EK 5.3.1O APIs connect software components, allowing them to communicate.
### LO 5.4.1 Evaluate the correctness of a program.
- EK 5.4.1A Program style can affect the determination of program correctness.
- EK 5.4.1B Duplicated code can make it harder to reason about a program.
- EK 5.4.1C Meaningful names for variables and procedures help people better understand programs.
- EK 5.4.1D Longer code segments are harder to reason about than shorter code segments in a program.
- EK 5.4.1E Locating and correcting errors in a program is called debugging the program.
- EK 5.4.1F Knowledge of what a program is supposed to do is required in order to find most program errors.
- EK 5.4.1G Examples of intended behavior on specific inputs help people understand what a program is supposed to do.
- EK 5.4.1H Visual displays (or different modalities) of program state can help in finding errors.
- EK 5.4.1I Programmers justify and explain a program’s correctness.
- EK 5.4.1J Justification can include a written explanation about how a program meets its specifications.
- EK 5.4.1K Correctness of a program depends on correctness of program components, including code segments and procedures.
- EK 5.4.1L An explanation of a program helps people understand the functionality and purpose of it.
- EK 5.4.1M The functionality of a program is often described by how a user interacts with it.
- EK 5.4.1N The functionality of a program is best described at a high level by what the program does, not at the lower level of how the program statements work to accomplish this.
### LO 5.5.1 Employ appropriate mathematical and logical concepts in programming.
- **EK 5.5.1A Numbers and numerical concepts are fundamental to programming.**
- **EK 5.5.1B Integers may be constrained in the maximum and minimum values that can be represented in a program because of storage limitations.**
{panel type="teacher-note"}
# EXCLUSION STATEMENT (for EK 5.5.1B):
Specific range limitations of all programming languages are beyond the scope of this course and the AP Exam.
{panel end}
- **EK 5.5.1C Real numbers are approximated by floating-point representations that do not necessarily have infinite precision.**
{panel type="teacher-note"}
# EXCLUSION STATEMENT (for EK 5.5.1C):
Specific sets of values that cannot be exactly represented by floating point numbers are beyond the scope of this course and the AP Exam.
{panel end}
- EK 5.5.1D Mathematical expressions using arithmetic operators are part of most programming languages.
- EK 5.5.1E Logical concepts and Boolean algebra are fundamental to programming.
- EK 5.5.1F Compound expressions using and, or, and not are part of most programming languages.
- EK 5.5.1G Intuitive and formal reasoning about program components using Boolean concepts helps in developing correct programs.
- EK 5.5.1H Computational methods may use lists and collections to solve problems.
- EK 5.5.1I Lists and other collections can be treated as abstract data types (ADTs) in developing programs.
- EK 5.5.1J Basic operations on collections include adding elements, removing elements, iterating over all elements, and determining whether an element is in a collection.