Magic do exist. What we call magic is an ability or a result beyond common sense, beyond mediocrity, something extraordinary.
But it is not just a skill. It is usually a unique combination of several ingredients and some personal insight or realization - so-called a-ha moment - much like a musical composition.
This means magical things rarely created, they are usually discovered or realized.
Computers, of course, are magical things, and the very first people who invented and built them were true magicians. Their occupation was a magic for the common folks.
We cannot teach you the magic itself - it cannot be transmitted directly, but we can teach you the foundations, explain how it works and why it is so, and then you can attain your own realizations, your personal insights and become a magician.
The very first mantra to learn is: It from bit.
This means that everything that computer can do, all its complex behavior controlled by programs, comes from this very basic idea.
One bit is a smallest piece of information, it is basically a switch - it could be in one of two positions - on/off, 1/0, yes/no, true/false.
Something is or it isn't. Light is on or it is off. When there is no light, there is darkness. When light (or rather current) is on - there is 1. When it is off - there is nothing. Zero, 0.
1 - on, 0 - off. Light, darkness. No magic. Just bits.
Let's add some magic. The symbols '1' or '0' which we are used to draw to represent the digits 'one' and 'zero' - what they are?
Well, they are shapes or forms, we're taught to draw with our pens. The shape '1' is associated with the word 'one' and the shape '0' is associated with word 'zero'. What words are?
That's tricky. Words are representations of sounds we used to produce with our mouth when we want to communicate an idea we have in our mind. There are more than one representation. One is when we write words on paper or a screen, and one is in our head - a piece of a language we knew. (What happens when we know more than one language?!)
The word 'one' is associated with an idea that there is something, alone, separated from the rest of stuff. One apple. (Don't ask me what is an apple!)
The word 'zero' is much more trickier. It represents a sound we taught to produce when we have an idea that we might have an apple, but still have none - zero apples. There are no apple. None. Zero.
What we have done? We have described and visualized an associations between some ideas and their representations - one is audio representation - sounds, another is visual - shapes or forms, and another is in our mind, a raw one.
Everything we know are such trees of associations between objects and ideas and their different representations, and Programming is a skill of manipulating those associations and creating new ones. This what our magic is all about.
Computers are our magical devices. We program them to behave the way we wish. By arranging bits in a different order.
But we can't touch bits, we can't even see them, the same way we cannot see or touch a digit. But we can draw a symbols representing digits and visualize our ideas like this: 2 + 2 = 4, you know.
By the way, the much more important example is - The cat sat on the mat. See, there is no cat, no mat, nothing, but by putting together, combining a few symbols we created an inner construction, a mental picture in our mind.
We look at these symbols, interpret them as words, associate them with our internal representations, and, by magic, here it is: some cat which sat on some mat. Inside our head.
You see - I program. I'm writing these words for you to understand what I know. I program you. See, it is not that difficult.
How is this possible? Well, it is possible, because you have several representations of knowledge inside your head. You have sounds associated with pieces of knowledge, and symbols, composed out of characters, associated with these sounds and some inner mental pictures.
When I want to create some mental picture in your mind, I produce a string of symbols for you to read. When I (or you) want to create something in the computer memory I must create some sequence of bits. This is how to program.
Now, lets see the magic. Yes, we can, to some extend. And it is you who will see it.
There are (magic) rules:
Everything inside a computer is a sequences of bits. With these sequence of bits we represent (encode) numbers. With numbers we represent characters, including digits which are symbols for numbers. Symbols are sequences of characters. See?
A word 'cat' is a symbol of tree characters 'c', 'a' and 't' which, in turn, are numbers 99, 97 and 116, which are represented as a following sequences of bits: 01100011, 01100001 and 01110100.
Now look, rules are pretty simple - we might say: when we have this sequence of bits 01100011 (which is a computer's inner representation for a number 99) please draw a character 'c' of English alphabet instead.
Or we might say: there is a mapping (a table) between characters of English alphabet and numbers, for each commonly used letter and digit. This rule, defined as a table, we might call encoding. Boring? Sure.
The idea is - it is just a set of associations between two different representations, as in our minds.
The rest is simple - by putting numbers (characters) together we create words, which are symbols (a visual representation of something). By putting symbols into a sequences (lists) I create sentences (expressions). By interpreting (reading) these symbols computer (or you) creates new inner representations in its memory.
So, programming is a manipulations of symbols.
There are several transformations on the way between sequences of symbols a programmer writes and resulting sequences of bits computer can interpret. They are of the same nature, as the transformations in your head between words you read and the meaning you extract. This is how it works. This is magic.