0% found this document useful (0 votes)
8 views5 pages

Programming Study Notes

The document outlines fundamental programming concepts, including problem-solving techniques like decomposition and abstraction, as well as essential computer architecture components such as CPU and RAM. It covers various programming elements like data types, control flow, data structures, and object-oriented programming principles. Additionally, it discusses web development, database management, version control, and the software development life cycle, along with advanced concepts like recursion and asynchronous programming.

Uploaded by

christachelgwexy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Programming Study Notes

The document outlines fundamental programming concepts, including problem-solving techniques like decomposition and abstraction, as well as essential computer architecture components such as CPU and RAM. It covers various programming elements like data types, control flow, data structures, and object-oriented programming principles. Additionally, it discusses web development, database management, version control, and the software development life cycle, along with advanced concepts like recursion and asynchronous programming.

Uploaded by

christachelgwexy
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

The Core Philosophy of Programming


At its heart, programming is not about syntax (the commas and brackets); it is about problem-
solving.

 Decomposition: Breaking a large problem into small, manageable


pieces.
 Pattern Recognition: Identifying which parts of the problem we’ve
solved before.
 Abstraction: Hiding the complexity of a process so you can focus on
the high-level logic.
 Algorithms: A step-by-step "recipe" to achieve a specific result.

2. Computer Architecture: The "Why" Behind the Code


Before writing code, you must understand the hardware it controls.

 CPU (Central Processing Unit): The brain. It executes instructions


using the Fetch-Decode-Execute cycle.
 RAM (Random Access Memory): The short-term memory. It’s fast
but volatile (wiped when power is lost).
 Storage (HDD/SSD): Long-term memory. Slower than RAM but
persistent.
 Binary & Bits: Computers only understand 1s and 0s. A "Bit" is a
single binary digit; a "Byte" is 8 bits.

3. Data Types and Variables


Variables are named containers used to store data in RAM.

Common Primitive Data Types:

1. Integer (int): Whole numbers (e.g., 5, -42).


2. Float/Double: Numbers with decimals (e.g., 3.14).
3. String: Text wrapped in quotes (e.g., "Hello World").
4. Boolean (bool): True or False values.
5. Character (char): A single letter or symbol (e.g., 'A').

4. Control Flow: The Logic Gates


Control flow dictates the order in which code is executed.
I. Conditionals (if, else if, else)

Allows the program to make decisions.

if user_age >= 18:

print("Access Granted")

else:

print("Access Denied")

II. Loops (The "Workhorses")

 For Loops: Used when you know exactly how many times you want to
repeat an action.
 While Loops: Used when you want to repeat an action until a certain
condition changes.

III. Switch Statements

An efficient way to handle multiple specific conditions for a single variable.

5. Data Structures: Organizing Information


How you store data determines how fast your program runs.

Structure Description Best Use Case


Array/List An ordered collection of items. Storing a simple sequence of names.
Stack Last-In-First-Out (LIFO). "Undo" buttons in software.
Queue First-In-First-Out (FIFO). Printer task management.
Looking up a user profile by their
Dictionary/Hash Map Key-Value pairs.
ID.
Elements pointing to the next
Linked List Dynamic memory allocation.
element.

6. Functions and Modularity


DRY Principle: Don’t Repeat Yourself.

Functions are blocks of code that perform a specific task and can be "called" whenever needed.

 Parameters: The inputs the function accepts.


 Return Value: The output the function sends back to the caller.
 Scope: Global variables (available everywhere) vs. Local variables
(only available inside a specific function).

7. Object-Oriented Programming (OOP)


OOP is a paradigm based on the concept of "objects," which contain data and code.

The Four Pillars of OOP:

1. Encapsulation: Keeping data (properties) and methods (actions)


bundled together in a class and hiding internal states.
2. Abstraction: Showing only the necessary features and hiding the
complex background details.
3. Inheritance: Allowing a new class (child) to take on the properties of
an existing class (parent).
4. Polymorphism: The ability of different classes to be treated as
instances of the same parent class through the same interface.

8. Memory Management and Pointers


In lower-level languages like C or C++, you manage memory manually.

 The Stack: Fast, automatic memory allocation for local variables.


 The Heap: Larger pool of memory used for dynamic allocation
(requires manual cleanup/garbage collection).
 Pointers: A variable that stores the memory address of another
value.

9. Web Development Fundamentals


The web runs on a specific "Three-Tier" stack:

1. HTML (Structure): The skeleton of the page.


2. CSS (Style): The skin, clothes, and layout.
3. JavaScript (Behavior): The muscles and brain that allow for
interactivity.

10. Database Management


Most applications need to save data permanently.

 Relational (SQL): Data is stored in tables with fixed schemas (e.g.,


PostgreSQL, MySQL).
 Non-Relational (NoSQL): Data is stored in documents or graphs
(e.g., MongoDB).
 CRUD Operations: Create, Read, Update, Delete.

11. Version Control (Git)


Git is essential for collaboration and tracking changes.

 Commit: A "save point" in your project.


 Branch: A separate version of the code to test new features.
 Merge: Combining a branch back into the main code.
 Repository (Repo): The project folder.

12. Software Development Life Cycle (SDLC)


How professional software is actually built:

1. Requirements Analysis: What does the user need?


2. Design: Planning the architecture.
3. Implementation: Writing the actual code.
4. Testing: Finding bugs before the user does.
5. Deployment: Releasing to the public.
6. Maintenance: Updating and patching.

13. Advanced Concepts to Explore


 Recursion: A function that calls itself to solve smaller versions of a
problem.
 API (Application Programming Interface): A way for two pieces of
software to talk to each other.
 Asynchronous Programming: Allowing a program to handle multiple
tasks at once without freezing the UI.
 Big O Notation: Measuring the efficiency of an algorithm (O(n), O(log
n), etc.).

How to use these notes:

1. Summarize: Try to explain each bolded term in your own words.


2. Practice: Pick one concept (like "Loops") and write 5 different versions
of it in a language like Python.
3. Build: Combine these concepts to create a "To-Do List" or "Calculator"
app.

You might also like