As a fantasy enthusiast who is a programmer by DAY, I finally realized it!
Programming language, is essentially a modern magic spell!
If you don’t know magic Muggles, don’t worry, let me unravel the mysteries of the century.
Let’s start with the simplest HTML, technically known as a “markup language,” or structural language.
< HTML ><body><h1> Summon the demon </h1></body></ HTML >Copy the code
alchemy
This sign language, made up of pairs of signs, is actually a great alchemic magic!
Magic array made up of simple language markers, all objects in the magic array will attach a specific magic effect, or be converted into other objects.
Those of you who have seen the Alchemy of steel should understand this alchemy very well.
But alchemy is not something anyone can easily master. It requires a long period of learning spells. Public HTML tutorial
In addition, the second requirement for alchemy is the operating environment.
This is what all magic needs, the basic laws of the world in which it operates.
As we all know, in different magical systems, there are different laws of the world, in our barren plane, there is no “magic”, “psychic power” and other basic elements that those magical systems have.
So even if you had a encyclopedia of spells in your hand, none of them would work.
So going back to HTML, what’s the context of the spell?
If you’re a smart kid, you’ve already figured it out. Yes, it’s something called a browser.
This is a virtual container, and if you put the spell into it in the right way, it will do what it was meant to do.
As follows:
Summon demons
Yes, this is a feature that makes text bigger and bigger, but of course it’s a trivial trick.
But if you were to summon the devil, of course, in terms of complexity, it might take us too far.
Now let’s do something else.
Summon operation
Let’s summon the spell of a little white dove
<p><img src="https://img2018.cnblogs.com/blog/194179/201902/194179-20190225003028071-1764286030.jpg" alt="" width="190" height="178" /></p>Copy the code
Building things out of nothingness, because now the dove is just a paper dove, so we call it static “objects”, and of course dynamic “objects”. The spell that makes it work is called animation programming.
It’s no longer alchemy, it’s not an exchange of equals.
Low-level simple spells are short in length, while high-level spells are often powerful, but spells can be very lengthy.
In actual combat, if all the functions were built from scratch, it would take a lot of time and become a fixed target in a rapidly changing war. This is the
Sing a time
In addition, the singing process is very prone to interference, which may be caused by their own lack of ability, lack of proficiency in programming technology, or lack of understanding of the function to achieve, lack of understanding of the environment, etc., causing bugs.
BUG fixes will continue to increase the minstrel time, there will also be interference from outside, such as friendly PM dialogue messages, interference from the battlefield, etc.
In order to solve the time problem, the experienced magician will prepare some beforehand
Magic scrolls
These scrolls are used to carve practical and complex spells into them with more time and effort in their spare time.
Programmatically it is called a “JDK” or toolkit or API. In practice, it only takes a short activation spell to unlock complex functions.
Of course, these scrolls are not necessarily made by users, they may be made by others, purchased by users, or downloaded for free.
There are some fairly common scroll societies, which we call open source platforms, that make scrolls available for free, and the spell details of those scrolls are open to all viewers for free, which is a good conscience.
So let’s move on to another topic
Magic circle
The difference between magic phalanx and incantation is that one is a pattern and the other is spoken language.
So what is the way to implement functionality in a programming language using patterns?
That’s right! It’s called “visual programming,” which builds applications by dragging and dropping components with a specific tool, the IDE.
Various visual programming tools, VS, Unity3D, dreamWeaver
The essence of magic array is still spells, so all visual programming can still be done manually by writing code, but there are some advantages to development efficiency.
When we mentioned “spoken language”, programming languages don’t actually need to be spoken. As you already know from the simple example we just started, they need to be put into a virtual container to work.
Of course, different languages also have different containers.
Web classes, including HTML, CSS, and js, require a browser environment, c# requires “.netframwork “, and Java requires “JVM”.
There’s another very special casting technique called
Your cast
Spellcasters can silently cast spells that can be cast very quickly without making a sound.
In programming, this is called “CTRL + C CTRL + V” by copying and pasting some existing code snippets quickly.
We know that large spells usually require
Multiple cast aid
In order to solve the problem of multi-person collaboration process, and the complexity is too high.
Developers come up with things like object-oriented, twenty-three design patterns, Domain oriented, aspect oriented.
At this time, there will be another function divided, “architect”, most of the architect is not in the picture, but in the invisible place silently design, deduce.
At this point, this picture of the wind front might remind some of you of a basic question.
Then the corresponding
Elemental wizard
Such as wind, fire, mines and other elements of the magic, in programming is how to reflect?
First of all, in some magical systems, such as Western magic, WOW, the Lord of the Rings, dragon Lance series, etc., elements are relatively common magic.
Usually the basic elements of their “operating environment” are these free elements “wind”, “fire”, “water” and “thunder” scattered throughout the world, which is the basic law of the world.
So in the virtual world of programming, the most basic is of course “0” and “1”, and there are compound elements above the basic elements, such as wind + electricity = thunderstorm, water + fire = fog
Zeros and ones combine other logical elements: “and,” “or,” “not,” “xor,” and then, one level above that, the “assembly language” elements of CPU instructions combined with these logical symbols, move left, move right, save, copy, etc
Then, one level up, we get to the familiar high-level language categories, variables, arrays, objects, loops, and so on.
Dark destruction spells correspond to hackers, and light healing spells correspond to white caps of defense.
Potions who specialize in drugs correspond to plugin developers.
This is modern magic, programming development.
A discipline of deduction of rules that can be derived from nothing with great rigor.
Can create magic, can destroy the sky and earth. Can turn a stone into gold, can also be a thousand miles in an instant.
It’s wonderful!