Comp sci basics

Introduction to Coding Skills Development

  • The development of coding skills follows a structured approach in the code.org curriculum:

    • Introduction of the concept

    • Presentation of how the concept looks in code

    • Practice and debugging

    • Creation

Understanding Code Development

  • Emphasis on modifying existing code rather than starting from scratch

  • Importance of repurposing previously encountered content

  • Creating from scratch is occasionally necessary but not the norm

Structure of the Curriculum

  • Each topic typically spans about four periods, with adjustments made as necessary:

    • Introduction of unit three was less formally checked; focus shifts to ensuring students engage with the material

    • From unit four onward, small credits will contribute to the project grade to encourage ongoing engagement

    • Avoid cramming information and wasting flexible time

Accountability and Class Structure

  • Students will be responsible for managing their learning pace

  • Regular checks for understanding will be conducted during class, with emphasis on troubleshooting

  • Teaching philosophy centers around prompting student thought rather than providing answers

  • Utilization of ancient Greek philosophy (Socratic method) for the learning process

Topic Introduction: Variables

  • Definition of variables in coding contrasted with their mathematical counterpart

    • In math, variables serve as placeholders for unknowns

    • In coding, variables are actual storage locations in memory, storing values (e.g., a = 3 represents a storage space named 'a' that holds the number 3)

Types of Variables

  • The following types of variables will be focused on during the course:

    1. Numeric:

      • Example: let a = 3;

    2. String:

      • Strings can contain letters, numbers, punctuation, etc., and are denoted by quotation marks (e.g., let greeting = "Hello";)

    3. Boolean:

      • Holds either a true or false value, important for logical operations (e.g., let isActive = true;)

      • Related to binary systems (0 or 1) as it provides two possible outcomes

Setting Up Variables in Code

JavaScript Syntax

  • Declaring a variable in JavaScript:

    • Example of variable declaration:

      • var num1; to reserve storage space

      • Setting a value: num1 = 3;

      • Distinction between assignment in coding vs. equality in math

  • Example of defining a string:

    • var day = "Monday";

      • Importance of quotation marks for strings

Variable Operations and Assignments

  • Assignment statements are used to assign values to variables:

    • num1 = num1 + 2; changes the value stored in num1 from 3 to 5

  • Explanation of why this is not an equation: it modifies the stored value rather than presenting equality

Combining Strings: Concatenation

  • Process of combining strings:

    • Example:

      • var dayName = day + "day"; yields "Monday"

    • This operation is known as concatenation

Limitations and Rules of Variable Naming

  • Certain limitations in variable naming include:

    • Avoiding starting variable names with punctuation marks or spaces

  • Assignment statement:

    • Clarifies the action of putting a value into a storage location

Arithmetic Operations Overview

  • Overview of arithmetic operators used in coding:

    • Addition: +

    • Subtraction: -

    • Multiplication: *

    • Division: /

    • Exponentiation: ^ (caret symbol)

    • Modulus: % (gives remainder after division)

Further Considerations in Coding

  • Importance of using parentheses to maintain order of operations

  • The necessity of clear entry to avoid errors in calculations

Conclusion of Initial Coding Session

  • Initial understanding of coding concepts begins with variables and their operations

  • Students are encouraged to refer to provided materials and practice coding with guidance on structuring their work during class rather than at home

  • Future lessons will build on fundamental concepts introduced here, particularly in relation to logic and variable interactions.