Computer Science 101: Key Concepts Explained

Jul 10, 2024

Computer Science 101: Key Concepts Explained

Code Debugging

  • First Action: Do nothing and try running the code a few times
  • If unresolved: Jokingly suggests needing a Computer Science degree
  • Learning Curve: Coding can feel like magic; understanding fundamentals is key

Introduction to Computer Science

  • Today's Focus: Understanding 101 Computer Science terms and concepts

Basic Computer Architecture

  • What is a Computer: A Turing machine that can compute anything
  • Core of Modern Computers: CPUs containing billions of transistors (tiny on/off switches)
  • Bits and Bytes:
    • Bit: Smallest unit (0 or 1)
    • Byte: 8 bits, can represent 256 values (e.g., ASCII characters)
  • Character Encoding: Binary values mapped to characters (ASCII, UTF-8)
  • Binary & Hexadecimal:
    • Binary: base-2 system (0, 1)
    • Hexadecimal: base-16 system (numbers + letters)

Programming and Machine Code

  • Programming Languages: Convert human-readable code into machine code
  • Machine Code: Binary format executable by CPU
  • Memory (RAM): Stores data for applications (like a neighborhood of bytes)
  • Input/Output Devices: Keyboard, mouse (input) & monitor (output)
  • Operating Systems: Manages hardware resources via kernels and device drivers

Shell and Programming Languages

  • Shell: Program exposing the OS to the end user (Command Line Interface, CLI)
  • Secure Shell (SSH): Connects to remote computers over a network
  • Programming Language Choice:
    • Interpreted Languages: e.g., Python, executed line-by-line via interpreter
    • Compiled Languages: e.g., C++, converted to machine code by compiler

Data Types and Variables

  • Built-in Data Types:

Int: whole numbers (signed & unsigned)

  • Float: numbers with decimal points
  • Double: Double precision for floating-point numbers
  • Char: single character
  • String: sequence of characters
  • Big Endian & Little Endian: Ways to store data bytes in memory
  • Variables: Names attached to data points
    • Dynamic Typing: e.g., Python, infers data type
    • Static Typing: e.g., C, data type specified

Memory Management

  • Pointers: Variable storing the memory address of another variable
  • Garbage Collection: Automated memory management

Data Structures

  • Common Structures:
    • Array/List: Ordered collection with integer index
    • Linked List: Items connected via pointers
    • Stack: Last in, first out
    • Queue: First in, first out
    • Hash/Map/Dictionary: Key-value pairs
    • Tree: Hierarchical structure
    • Graph: Nodes connected by edges

Algorithms

  • Definition: Code that solves a problem
  • Functions: Named blocks of code with input, process, and output
  • Conditional Logic:
    • If statements: Conditional execution
    • Loops: While & For loops for iterative operations
  • Algorithm Efficiency (Big-O Notation):
    • Time Complexity: Speed of algorithm
    • Space Complexity: Memory usage
  • Algorithm Types:
    • Brute Force: Try all combinations
    • Divide and Conquer: e.g., Binary Search
    • Dynamic Programming: Memoization technique
    • Greedy Algorithms: Short-term optimal choices
    • Backtracking: Explore all options incrementally

Programming Paradigms

  • Declarative: Describes what to do without control flow (e.g., functional languages)
  • Imperative: Explicit instructions for outcomes (e.g., procedural languages)
  • Multi-Paradigm: Modern languages supporting multiple styles (e.g., Python, JavaScript)
  • Object-Oriented Programming (OOP):
    • Classes: Blueprints for data and methods
    • Inheritance: Subclasses extending parent class behaviors
  • Memory Areas:
    • Call Stack: Short-term memory for function calls
    • Heap: Long-term memory for objects

Multithreading and Concurrency

  • Threads: Virtual cores for simultaneous code execution
  • Parallelism: Execute code on multiple threads
  • Concurrency Models: Non-simultaneous multitasking (Event Loop, Co-routines)

Cloud Computing and Networking

  • Virtual Machines (VMs): Software simulating hardware for cloud computing
  • Internet Protocol (IP): Unique addresses for network identification
  • Domain Name Service (DNS): Maps URLs to IP addresses
  • TCP Handshake: Establishes connection between computers
  • SSL: Encrypts/decrypts messages
  • HTTP: Protocol for data exchange (Client requests, Server responses)
  • API: Standardized method for client-server interaction (e.g., REST)

Printers

  • Practical necessity: Required knowledge for practical everyday scenarios

Conclusion

  • Final Note: Computer science knowledge is vast and essential for many aspects of tech life