Computing - Custom Theme

Theme Overview

This custom theme is designed for Computing programs. It features a modern color scheme optimized for technical content and code examples.

Standard Learning Blocks

Note

Object-Oriented Programming Principles

The four pillars of OOP—Encapsulation, Abstraction, Inheritance, and Polymorphism—provide a framework for writing modular, reusable, and maintainable code. Understanding these principles is essential for modern software development.

Activity

Algorithm Design Challenge

Design an algorithm to find the shortest path between two nodes in a weighted graph. Consider the following:

Implement your solution in Python and test with sample data.

Reflection

Code Review Reflection

Think about a recent code review you participated in. What feedback did you receive or provide? How did the review process improve code quality? What best practices can you apply to future projects?

Key Point

DRY Principle

Don't Repeat Yourself: Every piece of knowledge should have a single, unambiguous representation in your codebase. Avoid code duplication by extracting common functionality into reusable functions, classes, or modules.

Definition

Big O Notation

Definition: A mathematical notation that describes the limiting behavior of a function when the argument tends toward infinity. In computer science, it's used to classify algorithms by how their runtime or space requirements grow as input size increases.

Common complexities: O(1), O(log n), O(n), O(n log n), O(n²), O(2ⁿ)

Warning

Security Best Practices

Never store passwords in plain text or commit API keys to version control. Always use environment variables for sensitive data, implement proper authentication and authorization, and validate all user input to prevent SQL injection and XSS attacks.

Example

Factory Pattern Implementation

The Factory pattern provides an interface for creating objects without specifying their exact classes:

class ShapeFactory:
    @staticmethod
    def create_shape(shape_type):
        if shape_type == "circle":
            return Circle()
        elif shape_type == "square":
            return Square()
        elif shape_type == "triangle":
            return Triangle()
        else:
            raise ValueError(f"Unknown shape: {shape_type}")

# Usage
shape = ShapeFactory.create_shape("circle")
shape.draw()

Assignment

Full-Stack Web Application Project

Build a complete web application with the following requirements:

Due: Final submission in Week 14 with live demo presentation.

Quiz

Data Structures Quiz

Test your understanding of fundamental data structures. This quiz covers arrays, linked lists, stacks, queues, trees, and hash tables.