code.org: Computer Science Principles
Code.org Computer Science Principles — Content Summary
Unit 1: Digital Information Core idea: All digital information can be reduced to binary (1s and 0s).
- Binary representation — computers use base-2; a bit is the smallest unit (0 or 1); a byte = 8 bits.
- Encoding numbers — binary-to-decimal conversion; overflow error (number too large) and round-off error (value too precise).
- Encoding text — character encoding schemes (e.g., ASCII, Unicode) map characters to binary codes.
- Encoding images — pixels stored as binary; B&W images use 1 bit/pixel; color images use RGB (3 bytes per pixel, 24-bit color); hexadecimal notation for compact representation.
- Compression:
- Lossless — reduces bits without losing information; reversible (e.g., run-length encoding, Huffman coding).
- Lossy — reduces bits by discarding some information; irreversible (e.g., JPEG, MP3).
- Intellectual property — ownership of digital works; Creative Commons licenses; digital rights management.
Unit 2: The Internet Core idea: The Internet is a layered system of protocols that routes data between devices.
- Networks — a group of interconnected devices; LAN (local) vs. WAN (wide area); bandwidth = max data transfer rate.
- Packets — data broken into small chunks, each with header info (source/destination IP).
- IP addressing — unique address per device; IPv4 (32-bit, ~4 billion addresses) vs. IPv6 (128-bit).
- Routing — routers use IP addresses to forward packets along paths.
- DNS (Domain Name System) — hierarchical system translating human-readable domain names to IP addresses.
- Protocols (layered):
- TCP (Transmission Control Protocol) — reliable, ordered, error-checked delivery.
- UDP — faster, no guaranteed delivery.
- HTTP — protocol for transferring web pages.
- HTTPS / TLS / SSL — encryption layers protecting data in transit.
- Cybersecurity basics — DNS spoofing, man-in-the-middle attacks, certificates.
- Redundancy & fault tolerance — multiple paths so the network survives failures.
- Global impacts — net neutrality, censorship, digital divide, surveillance.
Unit 3: Intro to App Design Core idea: Programs are event-driven; you respond to user actions.
- Event-driven programming — the program waits for events (clicks, keypresses) and runs a function in response.
- App Lab (JavaScript) — the environment used for all programming units.
- Software development process — iterative design, pair programming, debugging, code review.
- UI design — layout, widgets, user experience considerations.
Unit 4: Variables, Conditionals, and Functions Core idea: These three concepts let programs store data, make decisions, and organize code.
- Variables — named storage for values; assignment; types (numbers, strings, booleans).
- Conditionals — if / else if / else; Boolean expressions (comparisons, logical operators &&, ||, !); control flow based on conditions.
- Functions — named blocks of reusable code; function keyword; calling functions; abstraction (hiding complexity behind a name).
Unit 5: Lists, Loops, and Traversals Core idea: Collections of data and repetition let programs handle large amounts of information.
- Lists (arrays) — ordered collections; indexed access (0-based); .length; adding/removing items.
- Loops:
- for loop — iterate a known number of times.
- while loop — repeat while a condition is true.
- Infinite loop — when the condition never becomes false.
- Traversals — processing each item in a list: search, find min/max, filter, accumulate a total.
- Data import — pulling real-world data (CSV/JSON) into programs.
Unit 6: Algorithms Core idea: An algorithm is a precise sequence of steps to solve a problem; some problems are easier to solve than others.
- What is an algorithm — precise, finite sequence of instructions.
- Efficiency — how an algorithm’s running time grows with input size:
- Polynomial time (e.g., O(n), O(n²)) — practical for large inputs.
- Exponential time (e.g., O(2ⁿ)) — impractical beyond small inputs (“unreasonable time”).
- Undecidable problems — some problems cannot be solved by any algorithm (e.g., the Halting Problem).
- Parallel & distributed computing — splitting work across multiple processors.
Unit 7: Parameters, Return, and Libraries Core idea: Well-organized, reusable code is the foundation of large software systems.
- Parameters — inputs passed into a function.
- Return values — a function sends a result back to the caller.
- Libraries — collections of reusable functions (built-in or custom); importing and using them.
- Code organization — writing clear, documented, modular code that others can use.
Unit 8: Create Performance Task Prep Core idea: The iterative development process.
- Iterative design — plan → build → test → refine, repeated.
- Personal creative project — design, develop, and document a meaningful app.
- Documentation — explain the problem, design decisions, and iterative process.
Unit 9: Data Core idea: Data can reveal patterns and tell stories about the world.
- Data collection & cleaning — gathering data, handling missing/erroneous values.
- Exploration & visualization — charts, graphs, trends, correlations.
- Interpretation — distinguishing correlation from causation; drawing conclusions.
- Data ethics — privacy, bias, responsible use of data.
Unit 10: Cybersecurity and Global Impacts Core idea: Computing shapes (and is shaped by) society, law, and ethics.
- Encryption — symmetric vs. asymmetric; public-key cryptography basics.
- Cybersecurity threats — phishing, malware, social engineering.
- Innovations enabled by computing — across fields (medicine, science, art, etc.).
- Global & societal impacts — big data, surveillance, digital divide, public policy, ethics of AI and automation.