Basics – Done!

Hello 🙂

As last time I’ve to apologise first for the delay, but I’m very happy to close the first chapter today with you. I want to summarise shortly the basic building blogs of coding as I learned them so far and speak a little bit about what’s next. So let’s dive in!

In the last month I learned about all the parts necessary to build a modern program. It started with defining variables to use them in various contexts, especially in functions. Functions are lines of code that the computer has to execute and every programming language comes with a set of pre defined functions to make coding easier for you, because when it comes down to it, coding is nothing more than a way to express to a computer what it should do for you. And because the computer doesn’t understand you or me, we have use a language that it can understand and lucky for us, some smart people made this part much easier as in the beginning of programming by creating programming languages. For example, if we come back to defining a variable the computer has to store the value of this variable somewhere in its hardware and it does it in pre defined ways when one uses a modern programming language like Processing or Python. As long as a variable is stored in the computers memory one can access it and use it in various operations. Maybe it’s a number you can do mathematical operations with or it’s a variable that expresses a state that can be true or false, like in a so called boolean expression, where you check exactly that. Then you maybe would make an if statement that gives further instructions, like “if the variable A is greater than the number 100 – do something“. Similar to the conditional statements like “if“ and “else“ there are logical operators like “and“, “or“ and “not“, which can be combined all together to create a complex set of constructions. Because one doesn’t want to write things like that over and over again to make something happen many times there is syntax to tell the computer it should do things repeatedly – forever or until a condition is met. These are called loops. The functions that are pre built in a programming language are mostly what I described before. They are pre defined statements of what the computer has to do when certain syntax is used. One can define their own functions and use them, as I mentioned before. But because sometimes one has to write quite a bit of conditions and functions only to make the computer do things that seam easy from our perspective, programmers created a shorter way code can reused, with so called classes and objects. A class is pre packed code that in the end can be reused in form of an object and it could be put together of a huge pile of code, but the object than used in the code is written more or less like a variable, like a single word in sentence, that contains a whole concept. Once you told the computer what’s the concept of the class, it can understand objects from that class in simple to write syntax and can create more complex code easily without the need to rewrite all of the code that defines the object again. And to manage huge numbers of objects and other things, one can create so called arrays. These are lists that are stored on your hardware and that can be accessed from other areas of the code. When you imagine a video game, there are often many things of the same typ like items or non player characters. All of these belong to certain pre defined classes and every instance is then part of an array, that manages the objects. And this is basically it! These are all the parts out of which a program is made.

To close my little summary I want to mention that you should take everything wrote about with a grain of salt, because I am also an absolute beginner and maybe there are some misconceptions from me or maybe even mistakes that I missed. But at the end you will find another list of links to my sources. In the rest of this weeks blog I want to share with you some pictures I made with the program I was building along with the blog to design something for the header. After some minor changes in the code tried to set some variables for the movement different and got rid of the shapes strokes. This way the pictures reminded me a little bit of paintings, as you can see here.

The last one of this set is the actual picture for the header, as you may have noticed and this completes this first project. At this point I’m not sure about next weeks topic, so it will be a surprise for you as well as for me but I’m planning to create a way you can communicate with me in the future, so you can maybe leave suggestions or even tipps on what to look at next.

That’s all for now. Thanks for reading till the end and have a nice time until next week.

Goodbye,
Rupert

Links:
https://www.processing.org/reference/
https://www.processing.org/tutorials/
https://www.youtube.com/playlist?list=PLzJbM9-DyOZyMZzVda3HaWviHqfPiYN7e