top of page

Getting into programming, how to understand the mess that is computers

I'm sure we can all agree that computers are complicated. The intricate systems of wires and lines of code that compose the amazing machine that your reading this from are an accumulation of generations of engineers working on automating mathematics and shrinking technologies. For anyone wanting to enter into the field of computer engineering or computer programming it can seem like a daunting task. Even trying to understand why computers do what they do is near impossible without hours of study. However, hopefully I can help shed some light on how the basics of computers work and where to go to start learning.

A piece of code telling AI what do do in a game (language unknown)

Variables:

In my personal opinion, variables are about the most important thing you can use in programming. Essentially a variable is a named setting used to fill in a piece of code, kind of like X in algebra. In code you can tell a computer to include X in a series of equations or lines of code and whenever X is changed (either by manually changing it or by interacting with something outside of the code, like the pressure of a thumb or the distance between two objects) the equation is changed as well. Variables are usually integers (or regular numbers like 1 and 10) however they can also be word based. If a system changes the text on a page based on what you put down it is probably a text variable. Variables are amazing in the sense that they can be extremely simple (what is 1+X?) to extremely complicated (if X=7 then change position by 3 and if position > 10 then change Y+3).

If/Then Statements:

An if/than statement is one of the most basic forms of programming and is very important. Essentially an If/Then statement asks the computer is a question is true or if the requirements set by the if are met, and if the question is true the computer fallows the Then command. This can be used for simple AI and can work with a multitude of requirements for the if. An example for this is If: cookie is within 200mm/ Then: go to cookie.

Loops:

A loop is used to make sure that a piece of code is not ignored within a set window. A loop runs a function (or segment of code) over and over again for a set amount of times or until some requirement is met. Loops are useful if you need to set a window of time for a user to do something. some websites use a loop function on notifications so the can be clicked and seen for a limited amount of time but goes away automatically so the user doesn't feel annoyed.

Movement:

Movement can be done in two different ways. Either by the universal direction of the object, or by moving on a X,Y (and sometimes Z) axis. These movements can either be along vectors (or lines drawn mathematically), or through teleportation, jumping to specific point on the axis. When you move a file on your laptop, it is jumping to the X,Y position you have set for it. And when a character moves in a game it is moving across a vector to simulate realistic motion.

The key thing about programming is that all of these different operations can be used in tandem. You can loop an if/then statement infinitely to see if your variable is equal to 3 then change your X,Y by 7,3 looped 9 times. The key is to combine ideas until your process comes out with what you want. And keep in mind that what I said here is just scratching the surface

Programs and languages for starting to learn programming:

There are a lot of languages out there for you to start learning from and some of them can be considered quite complicated. Personally I first learned the concepts of programming from a piece of software called scratch which you may or may not have heard of. Scratch uses color coded blocks and simple designs to teach programming and computer logic and is relatively simple to get a handle on. If you want to learn a full language though I would suggest PHP which has tons of internet support and tutorials and is very useful for simple web design when used with attachments like CSS.


bottom of page