<div id='stars2'></div>
<div id='stars3'></div>
<div id='stars4'></div>
[[Programming#Section 1 Foundation|Learn Programming Section 1]]
---
## Intro
If you are completely new to programming then you will need something to program and later compile your code.
You could use notepad if you like pain and suffering but I'd at least use [notepad++](https://notepad-plus-plus.org/). You'd then need to separately compile the code.
For simplicity you could alternatively use an IDE like: [vsCode](https://code.visualstudio.com/), [Visual Studio](https://visualstudio.microsoft.com/), [Code:\:Blocks](https://www.codeblocks.org/)or any of the others.
To quickly get started https://www.onlinegdb.com/ works just as well.
I will also at times use game engines/frameworks like the [Godot](https://godotengine.org/) or [Raylib](https://www.raylib.com/)
## Breaking it Down - What do programs do?
We can break down what a program does into four general categories.
- input
- storage
- manipulation/transformation
- output
This isn't strictly all programming can do but it serves as a good starting point and covers most cases.
### Input
Few programs are ever fully self contained. We want to be able to interact and insert new data into our program. There are also many other parts like functions and classes that take input in the form of parameters.
Inputs can come from a number of different sources
- input device(keyboard, mouse, controller, sensors etc)
- files(binary, text, csv, obj, etc)
- networked(talking to servers, peers, and other devices)
- other(command line, randomly generated, other programs)
This is not a comprehensive list but should give you a good general idea.
### Storage
Our data can't exist in the void so we need a place to put it.
On one side we have the physical medium that data can be put into.
Most of your files will be stored on some sort of physical drive.
For most of the data internal to the program will reside in a mix of places.
- Most of the program will exist in RAM(fast memory)
- When you get close to doing work with data it gets sent to the cpu caches(very fast memory but small)
- When you actually get to working with the data it bounces in and out of cpu registers
- unused data might get pushed to your storage drive
In terms of speed you have the slowest to fastest
- storage drives(hard disk, solid state, etc)
- RAM
- CPU Caches
### Manipulation/Transformation/Testing
Programming wouldn't be very interesting if didn't do anything with our data
On the relatively simpler side we have all of our math expressions.
We can test and compare to start building logic and build more complicated
### Output
Once we are done working on our data we will usually want to send it somewhere else.
Most of the time this will be to another part of our program. After that would probably be outputting to an external device(speakers, screens, lights, motors, etc)
## The Parts
Here's a simplified overview of the actual parts that make up our programs
**Variables** - Hold some information or data, comes in many different formats
**Operations** - Changes data into a new form, often has strict rules(but rules can sometimes be broken), most common are your math operations(addition, subtraction, multiplication, etc..)
**Functions** - A self contained group of <u>operations</u> and <u>variables</u>, reusable
**Classes/Structs** - a group of <u>variables</u> and <u>functions</u>
Programs are made by composing these things in different combinations to more efficiently accomplish it's tasks.
**Files** - Where the above parts are stored, often split into <u>Header</u> and <u>Implementation</u> files.
- Header files are public facing and anything defined there is publicly accessible
- Implementation Files are private everywhere except for the Header files they include
The more advanced parts are:
**Algorithms** - A set of instructions to solve or perform a specific task; Common tasks: sorting, searching, encryption, compression, and other decision making
**Data Structures** - Different ways to organizing data;
#
---
next: [[Hello World]]