-
Notifications
You must be signed in to change notification settings - Fork 114
Programming basics
The goal of this section is to give artist fast understanding of core programming concepts to be able to follow VEX tutorials if the programming is Terra Incognita for him (or her). To explain complex things (and programming could be sophisticated for those who never have a deal with it or who consider himself an artist but not technician) we will use simplification and analogies. This is not even a first steps, we learn to crawl here.
Simplification is a focus on the main topic ignoring all surrounding exceptions and details. Analogies — explaining unknown with the notions which are intuitive (familiar without any extra knowledge to a majority of humans in the world). Both simplification and analogies yields to a faster understanding but less precision. Keep in mind that you may not pass an exam on computer science with such kind of knowledge but from the other side it would be possible to start applied developing without finishing computer science class.
At the end of the lesson, you should be comfortable with syntax, data types, variables, commands, functions, loops.
Let's define what is programming. Sure we can say that programming is a process of creating computer programs, it would be correct, but not very useful. Let's say, programming — is communication with a computer, it`s how you can "speak" with this device. The more accurate definition would be: giving precise instructions to a computer to perform specific actions. Moreover, anything you want your computer to execute should be expressed in a way that your computer will understand. And the only thing computers understand is a program written in particular programming language.
You can imagine programs as blocks. The program could be simple (like a lonely small block of code), or it could be more sophisticated and combined with numerous small blocks linked together. How we link blocks we will describe later in data types section.
A particular example: when you copy a file from one folder to another your OS execute specific program.
As you can speak different languages, computers understand different programming languages also. The written rules for each language (the alphabet, words and sentence structure, etc) is what we can call a syntax. Each programming language has its own syntax. Once you learn one of them it's more and more easy to learn another.
A particular example: you should end every sentence in VEX with a semicolon.
Let's define what is data first. Data is any piece of information you are dealing with inside your program (code). It's important to understand that data is not a part of the program the code (program) itself. It is something that "comes inside" your program from the outer environment (everything around your program block). Now we can clarify links between different programs we speak above in Programming section.
For example, if we have a program which copies files from folder A to a folder B (when user selects a file in explorer and press Ctrl + C in folder A and Ctrl + V in folder B) the data here is a name with a path of the copied file (C:/temp/myFile.py)