Programming Concepts and Developer Tools, CS101 – Study Notes
offline

Source: CS101 Introduction to Coding Concepts and Programming Languages

Tags: variables, functions, control flow, OOP, object-oriented programming, algorithms, data structures, debugging, IDE, integrated development environment, VS Code, IntelliJ, PyCharm, Eclipse, CS101, UCF

Difficulty: Beginner | Prerequisites: Familiarity with what a programming language is (see companion notes: Introduction to Coding and Programming Languages, CS101)


Big Picture

Once you know that coding means writing instructions in a programming language, the next question is: what kinds of instructions can you write? This set of notes covers the foundational concepts that appear in every programming language, regardless of syntax. Variables, functions, control flow, object-oriented programming, algorithms, data structures, and debugging are the building blocks you will use for the rest of the course and your career. The final section covers IDEs, the software tools that make writing and testing code practical. If you understand these concepts, switching between languages later becomes a matter of learning new syntax rather than new ideas.


TL;DR

Programming revolves around six core concepts: storing data (variables), reusing logic (functions), directing execution order (control flow), modelling real-world entities (OOP), solving problems efficiently (algorithms and data structures), and finding mistakes (debugging). IDEs are the tools that bring all of this together in one workspace with features like syntax highlighting, error detection, and version control.


Key Terms

Variable

A named storage location in a computer's memory that holds a value. That value can change during program execution (hence "variable").

Think of it as a labelled box. The label is the variable name, and whatever you put inside the box is the value. You can swap the contents at any time.

Function

A reusable block of code that performs a specific task. Functions accept inputs (parameters), process them, and optionally return an output.

In simple terms, a function is a mini-program inside your program. You define it once, then call it whenever you need that task done, instead of writing the same code over and over.

Control flow

The order in which a program executes its instructions. By default, code runs top to bottom, but control flow structures let you change that order.

Think of it as a set of road signs: "if this condition is true, go left; otherwise, go right; keep looping around this roundabout until you have done it five times."

If/else statement

A control flow structure that executes one block of code when a condition is true and a different block when it is false.

In simple terms, it is how your program makes decisions. "If the user is logged in, show the dashboard. Otherwise, show the login page."

Loop

A control flow structure that repeats a block of code multiple times, either a set number of times (for loop) or until a condition is met (while loop).

Think of it as telling the computer: "keep doing this task until I say stop" or "do this task exactly ten times."

Switch statement

A control flow structure that selects one of many code blocks to execute based on the value of an expression. An alternative to writing many if/else branches.

In simple terms, it is a cleaner way to handle situations where a variable could equal one of several specific values and you want different behaviour for each.

Object-oriented programming (OOP)

A programming paradigm that organises code around objects, which bundle data (attributes) and behaviour (methods) together. Classes serve as blueprints for creating objects.

Think of it as modelling the real world in code. A "Car" class defines what properties a car has (colour, speed) and what it can do (accelerate, brake). Each actual car in your program is an object created from that blueprint.

Algorithm

A step-by-step set of instructions designed to solve a specific problem or perform a specific task. Algorithms can be evaluated by their efficiency (how fast they run and how much memory they use).

In simple terms, an algorithm is a recipe for solving a problem. The recipe can be good (fast, efficient) or bad (slow, wasteful), even if both produce the correct answer.

Data structure

A way of organising and storing data so it can be accessed and modified efficiently. Common examples include arrays, lists, stacks, queues, and trees.

Think of it as choosing the right container for your data. A bookshelf (array) is great for ordered access. A filing cabinet (hash map) is great for quick lookups by name. Picking the wrong container makes your program slower than it needs to be.

Debugging

The process of finding, diagnosing, and fixing errors (bugs) in code. Debugging is a core programming skill, not an afterthought.

In simple terms, debugging is detective work. Something went wrong, and you trace through your code to find out where and why.

Integrated development environment (IDE)

A software application that combines a code editor, debugging tools, build automation, and often version control into a single interface for writing and testing code.

Think of it as a workshop that has all your tools on one workbench, instead of scattering them across different rooms.


Core Content

Variables – Storing and Naming Data

  • Every programming language lets you create variables to hold values: numbers, text, booleans (true/false), and more complex types.

  • A variable has a name (identifier), a type (what kind of data it holds), and a value (the current contents).

  • In statically typed languages (Java, C++), you declare the type explicitly: int age = 21;

  • In dynamically typed languages (Python, JavaScript), the type is inferred: age = 21

  • Variable names should be descriptive. student_count is better than x because anyone reading your code can understand what it stores.

Functions – Reusable Logic

  • Functions let you write a piece of logic once and call it many times, reducing duplication and making code easier to maintain.

  • A function definition typically includes a name, a list of parameters (inputs), a body (the code that runs), and optionally a return value (the output).

  • Example concept: a function called calculate_average takes a list of numbers, adds them up, divides by the count, and returns the result.

  • Breaking a large program into small functions is called decomposition, and it is one of the most important habits in programming.

Control Flow – Directing the Program's Path

  • Sequential execution: code runs one line after the next, top to bottom. This is the default.

  • Conditional execution (if/else): the program evaluates a condition and chooses which block of code to run.

    • Example: "If the student's score is above 90, print 'A'. Otherwise, if above 80, print 'B'. Otherwise, print 'C'."

  • Loops: the program repeats a block of code.

    • A for loop runs a set number of times: "for each item in this list, do something."

    • A while loop runs until a condition changes: "while the user has not typed 'quit', keep asking for input."

  • Switch/case: useful when one variable could match several known values and each needs different handling.

  • Control flow is where beginners first experience logic errors: the code runs without crashing, but it does the wrong thing because a condition is backwards or a loop runs one time too many.

Object-Oriented Programming (OOP)

  • OOP organises code into classes (blueprints) and objects (instances of those blueprints).

  • A class defines attributes (data the object holds) and methods (actions the object can perform).

  • Four core principles appear throughout OOP courses:

    • Encapsulation: bundling data and methods together and restricting direct access to some of the object's internals.

    • Inheritance: creating a new class based on an existing one, reusing its attributes and methods.

    • Polymorphism: allowing objects of different classes to be treated through the same interface.

    • Abstraction: hiding complex implementation details and exposing only what is necessary.

  • OOP is the dominant paradigm in Java and C++ and is supported in Python, JavaScript, and Ruby.

Algorithms and Data Structures

  • An algorithm is judged by correctness (does it solve the problem?) and efficiency (how do its time and memory requirements scale as the input grows?).

  • Data structures are the containers algorithms operate on. Choosing the right data structure often matters more than writing clever code.

  • Common data structures you will encounter in CS101 and beyond:

    • Array/list: ordered collection, accessed by index.

    • Stack: last-in, first-out (LIFO). Think of a stack of plates.

    • Queue: first-in, first-out (FIFO). Think of a queue at a shop.

    • Hash map / dictionary: stores key-value pairs for fast lookup by key.

    • Tree: hierarchical structure, used in search algorithms and file systems.

  • You will study specific algorithms (sorting, searching) in detail later in the course, but the concept of "a set of steps that solves a problem" is the foundation.

Debugging – Finding and Fixing Errors

  • Three types of errors:

    • Syntax errors: you broke a language rule. The program will not run at all. These are the easiest to fix because the compiler or interpreter tells you where the problem is.

    • Runtime errors: the program starts but crashes during execution (e.g. dividing by zero, accessing a list index that does not exist).

    • Logic errors: the program runs and finishes without crashing, but produces the wrong result. These are the hardest to find.

  • Debugging strategies:

    • Read the error message. It usually tells you the file, line number, and type of error.

    • Print statements. Insert temporary output to see what values variables hold at different points.

    • Use the IDE's debugger. Set breakpoints, step through code line by line, and inspect variable states.

    • Rubber duck debugging. Explain your code line by line to someone (or something) else. The act of articulating what each line should do often reveals where it does not.

Integrated Development Environments (IDEs)

  • An IDE bundles a code editor, build tools, a debugger, and often version control into one application.

  • Key IDE features:

    • Syntax highlighting: colours different parts of your code (keywords, strings, comments) so structure is visible at a glance.

    • Autocomplete / IntelliSense: suggests completions as you type, reducing typos and helping you discover available methods.

    • Debugging tools: set breakpoints, step through execution, inspect variables.

    • Version control integration: track changes, commit code, and collaborate through Git without leaving the editor.

Popular IDEs

  • Visual Studio Code (VS Code): free, open-source, lightweight. Supports almost every language through extensions. The most widely used editor as of the mid-2020s.

  • IntelliJ IDEA: built for Java development, with strong refactoring, testing, and debugging support. The community edition is free.

  • PyCharm: purpose-built for Python, with code analysis, a visual debugger, and environment management. Also has a free community edition.

  • Eclipse: a Java-focused IDE that supports other languages through plugins. Older but still used in many university courses and enterprise environments.


Real-World Applications

  • Variables and functions are the basis of every piece of software you use, from the calculator app on your phone to the algorithms running a search engine.

  • Control flow is what lets an ATM decide whether to dispense cash (if your balance is sufficient) or display an error (if it is not).

  • OOP is the architecture behind most large software systems: a banking application might have classes for Account, Transaction, and Customer, each with its own data and behaviour.

  • Debugging is roughly half of a professional developer's working life. The ability to isolate and fix bugs quickly is one of the most valued skills in the industry.


Common Misconceptions

  • "A variable's name affects how the program works." Variable names are for humans, not the computer. x = 5 and student_count = 5 behave identically; the difference is that one is readable and the other is not.

  • "Functions slow your program down." The overhead of calling a function is negligible in almost all cases. The clarity and maintainability gained by using functions far outweighs any micro-performance cost.

  • "OOP is the only way to write good code." OOP is one paradigm. Functional programming, procedural programming, and other approaches are equally valid depending on the problem. CS101 emphasises OOP because it is dominant in industry, not because it is the only option.

  • "Debugging means your code is bad." Every developer writes bugs. Debugging is a normal, expected part of the development process, not a sign of failure.


Why It Matters / Exam Flags

⚠️ Be able to define each core concept (variable, function, control flow, OOP, algorithm, data structure, debugging) in one or two sentences. Short-answer and multiple-choice questions test this directly.

⚠️ Know the difference between the three types of errors (syntax, runtime, logic) and be able to identify which type a given scenario describes.

⚠️ Understand the four OOP principles (encapsulation, inheritance, polymorphism, abstraction) at a high level. Even if CS101 does not go deep, later courses assume you know these terms.

⚠️ Be able to name at least two IDEs and state what language each is primarily associated with.


Quick Self-Test

  1. True or false: A variable's value cannot change after it is first assigned.

  1. Fill in the blank: A ________ is a reusable block of code that performs a specific task.

  1. True or false: A logic error will cause the program to crash immediately.

  1. Fill in the blank: In OOP, a ________ is a blueprint for creating objects.

  1. True or false: Visual Studio Code only supports JavaScript.

Answers: 1. False (the value can be reassigned). 2. Function. 3. False (the program runs but produces incorrect results). 4. Class. 5. False (it supports many languages through extensions).


Practice Q&A

Q: What is a variable, and why are descriptive variable names important?

A: A variable is a named storage location in memory that holds a value. Descriptive names matter because they make code readable and maintainable. Another developer (or your future self) should be able to understand what a variable represents without reading the entire program.

Q: Explain the difference between a for loop and a while loop.

A: A for loop runs a predetermined number of times (e.g. once for each item in a list). A while loop runs as long as a condition remains true, and the number of iterations may not be known in advance.

Q: What are the four core principles of object-oriented programming?

A: Encapsulation (bundling data and methods, restricting access), inheritance (creating new classes from existing ones), polymorphism (treating different objects through a common interface), and abstraction (hiding implementation details, exposing only what is necessary).

Q: A student writes a program that runs without errors but prints the wrong total. What type of error is this, and how might they find it?

A: This is a logic error. The student could use print statements to inspect variable values at key points, step through the code with the IDE's debugger, or trace through the logic on paper to find where the calculation goes wrong.

Q: Name two features of an IDE that help with debugging.

A: Breakpoints (pausing execution at a specific line to inspect the program state) and variable inspection (viewing the current value of variables while the program is paused).

Q: Why are data structures important? Give an example.

A: Data structures determine how efficiently data can be stored, accessed, and modified. For example, if you need to look up a student's grade by their name, a hash map (dictionary) lets you find it in near-constant time, whereas searching through an unsorted list would require checking every entry.


Connections to Other Topics

  • Variables and control flow connect directly to the algorithms unit later in the course, where you will write loops and conditionals to implement sorting and searching procedures.

  • OOP is the foundation for software engineering and design patterns, which you will encounter in intermediate and advanced CS courses.

  • Debugging skills and IDE familiarity carry through every course and every professional role in software development. The earlier you build these habits, the less time you spend stuck on avoidable errors.


Related Terms / Search Tags

variables, data types, functions, methods, parameters, return value, control flow, conditional, if/else, loop, for loop, while loop, switch statement, object-oriented programming, OOP, class, object, encapsulation, inheritance, polymorphism, abstraction, algorithm, data structure, array, list, stack, queue, hash map, dictionary, tree, debugging, syntax error, runtime error, logic error, IDE, integrated development environment, Visual Studio Code, VS Code, IntelliJ IDEA, PyCharm, Eclipse, breakpoint, version control, CS101, intro to computer science, UCF