2026-10-09 17:26

Status:


Week 1

What is Programming and P 5.js

A program is a collection of commands in order to accomplish something. You use a large number of commands that become source code, and this source code is exactly what is then used in order to make a piece of software.

You write all of your code inside of a code editor, and it is basically something that makes it very easy in order to write code. This course uses something called brackets but I will actually be using something called VS Code because fuck these guys. You can also do things like run your code and your applications which is sometimes called executing them

You can execute your code by just a button in some editors, or its a bit more complicated in a few different other languages and what not.

In this lesson we will be using something called p5.js which is basically just an add-on to javascript that lets you render objects in a three or two d space. This is a library and is something you can do in order to not “re-invent” the wheel and what not. It is a good way to start learning about the code

p5.js

I have used this a good little bit before hand for making the midascloud homepage, its a pretty simple way to just get you to render a bunch of different shapes using javascript without the need for knowing how to actually render those kinds of shapes with HTML and JSS.

How to run programs and stuff

Honestly I think I have seen this video before hand, he just tells you how to install brackets and then use the p5.js library, which is pretty basic, it just has an index.html file which you really do not touch, its there because the web browser needs it for knowing what the fuck is going on

You have the p5.min.js file which is generally the actual javascript that is this library that he was talking about, its the code that makes all of your shit work, so you just import it and you get all of the gnarly functions and everything

You then have the sketch.js file which is where you actually call things like the draw functions and the entry programs for p5 and is where you can have different events and all of that good stuff

Running your program with VS-Code

Oh wow there is a new guy, I guess they have been using a bunch of old videos and what not, and I am not too surprised for that as well, this video looks a lot more new. Hes just gonna say how to set this bit up in Vscode though I just assume

I already have VS code and I have used it a bunch for different other things, looks like they just have you use the live server extension for running the index.html which then obviously loads in all of the good p5.js dependency stuff. This guy is on fucking Mac, can we imagine.

I know how to use Vscode and how to use the sidebar as well, this is pretty simple so far.
You put in all of the given things in there for downloading whatever things they have you download for their fuck as project, and then you just open it in Vscode, click that go live button from the extension, and thats all you gotta do.

Learn by hacking

He does not mean actual hacking, like finding weaknesses and the whole red team ordeal that you find in cyber security, instead it basically just means you need to mess around with the code to see what does what. This lets you learn a lot better about what is happening inside of your code. Pretty neat overall and honestly I mean I do agree, it is really good to do that.

2D coordinate grid

Basically, you have a pixel grid of coordinates for your given screen, and this starts in the top left corner of the computer screen, you use the createCanvas(500, 400); command in order to create a drawable grid for yourself in the library that they have you use

Pasted image 20261009172823.png

You start counting from zero, it works like math and it is pretty basic, in all honesty you only use this for rendering things in libraries like this or in game development, in essence I suppose you might use something like this for CSS styling and what not, but as cool as this is, it is not something you would actually use in programming all too much.

You can use something like rect(x, y, width, height) this draws it like how something in SFML might be drawn, that being that it draws it from the top-left corner of your given shape.

There are two functions setup() and draw() this is just like something you might see in a game editor like Unity, where setup runs only once before any code is ran, and then draw() runs every single rendering frame or something like that, basically in a while loop


References