
Tao of programming, part 2
- Transfer
Part 1

And the Great Programmer said: “A well-written program is Paradise for itself. A poorly written program is Hell to itself. ”
4.1
A program should be light and flexible, and its routines should be pearls strung on a thread. The spirit and purpose of the program must be maintained throughout its duration. The code should not be too much or too little. No unnecessary cycles, no useless variables. Neither chaos, nor excessive structure.
The program must follow the rule of least surprise. This means that the program should respond to user actions in a way that is least surprising to him.
A program of any complexity should work as a whole. The work of the program is dictated by logic, and not by external signs.
If the program does not meet these requirements, this leads to confusion and confusion. It remains only to rewrite it again.
4.2 A
novice asked the Master: “My program sometimes works, and sometimes it crashes. I followed the laws of programming, but I'm confused. What is the reason? "The
master replied:" You are embarrassed because you have not comprehended Tao. Only a fool would expect rational behavior from fellow humans. What did you expect from a car designed by people? Computers emulate determinism. Only the Tao is perfect.
The laws of programming are transient, only Tao is forever. Therefore, you need to contemplate the Tao before you reach Enlightenment. "
" But how do I know that I have reached enlightenment? "Asked the newcomer.
“Your program will work correctly,” answered the Master.
4.3 The
master explained the essence of Tao to one of the newcomers.
“Tao is present in all software, even in secondary programs,” said the Master.
“Is there a Tao in the calculator?” The novice asked.
"There is".
“Is there a Tao in a video game?”
“Even in a video game.”
“Is there a Tao in the DOS operating system?” The
master choked and slightly changed his position. “The lesson is over for today,” he said.
4.4
A programmer serving Prince Wong wrote a program. His fingers danced on the keyboard. The program compiled without errors and worked like a gentle breeze.
“Excellent!” Exclaimed the Prince. “Your technique is impeccable!”
“Technique?” The programmer asked, turning away from the terminal. “I follow the Tao and far from the techniques. When I started programming, I saw a task in front of me in one piece. Three years later, I saw routines instead. And now I do not see anything. My essence is in a formless void. My feelings are dormant. My spirit, not constrained by the plan, follows instinct. In short, my program writes itself.
Yes, sometimes difficult tasks are encountered. I see their approach, I slow down, I silently watch. Then I change one line of code - and the difficulties disappear like puffs of smoke. Then I compile, and the pleasure of work fills me. I close my eyes for a second, and then log out. ”
Prince Wong said,“ Oh, if all my programmers were so wise! ”
And the Great Programmer said: "Even a 3-line program will someday have to be supported."
5.1 A
frequently used door does not need to be lubricated.
Flowing water does not stagnate.
Deer is dissolved in the colors of the forest.
Programs get corrupted if they are not used.
5.2 The
manager asked the programmer how much time he needed to complete the program. “It will be finished tomorrow,” he answered quickly.
“In my opinion, you are not realistic,” the manager said. “How much time do you really need?”
The programmer thought. “Well, I want to add some features. It will take at least two weeks. ”
“And even that is too optimistic,” the manager insisted. "It will be enough for me if you just tell me when it will be finished."
The programmer agreed.
A few years later, the manager quit. On his way to a farewell dinner, he found the programmer sleeping at the terminal. He worked all night.
5.3 A
novice programmer once received the task of writing a simple financial module.
The newcomer worked hard for many days, but when the Master checked his program, he found that it had a visual editor, a set of general-purpose graphical methods, an interface to AI, but nothing remotely resembling finances.
When the Master asked him about this, the newcomer was indignant: "Do not be so impatient, in the end I will add a financial component."
5.4
Does a good farmer ignore a planted sprout?
Is a good teacher passing even the most humble student?
Would a good father allow an only child to starve?
Would a good programmer refuse to support his code?
And the Great Programmer said: “Let there be many programmers, but managers not. Then we will achieve productivity. ”
6.1
When managers sit, programmers write games.
When accountants discuss quarterly profits, the development budget runs the risk of being cut.
When scientists talk about a clear sky, clouds will soon appear on it.
And this is not a Tao of programming.
When managers make commitments, games fade into the background.
When accountants do long-term planning, harmony and order are restored.
When scientists talk about pressing issues, they will soon be resolved.
And this is Tao of programming.
6.2
Why are programmers unproductive? They lose time in meetings.
Why are programmers rebelling? Because managers too often interfere in the process.
Why do programmers quit? Because they burned out at work.
Having worked for bad managers, they no longer value their work.
6.3
One manager was about to be fired. But the programmer who worked on his team wrote a new program that became popular and sold well. As a result, the manager saved the job.
The manager tried to give the programmer a bonus, but he refused, saying: "I wrote the program because I was interested in the concept, so I do not expect rewards."
Hearing this, the manager remarked: “This programmer, although not taking the most revered position, understands what is the duty of an employee. Let's raise it to the elevated position of a consultant! ”
The programmer, having heard this, again refused:“ I exist to program. If they elevate me, I will only waste the time of other people. May I already go? The program is waiting for me there. ”
6.4. The
manager came to his programmers and told them: “Regarding your working hours: you will need to come at nine and leave at five in the evening.” The programmers got angry, several immediately resigned.
Then the manager said: “Okay, in this case, you plan your time yourself, just finish the projects on time.” Programmers, satisfied with this, began to arrive by noon and work until morning.
And the Great Programmer said: "You can show the program to the director, but you cannot train him in computer literacy."
7.1 A
novice asked the Master: “In the east there is a huge tree structure called“ Corporate Governance ”. She's bloated because of all sorts of vice presidents and accountants. It spawns a mountain of memoranda calling for “go there” or “do this,” and no one knows what they mean. Every year, new names appear in the structure - and all to no avail. How can such an unnatural entity exist? ”The
master replied:“ You are observing it, and you are concerned that it has no purpose. But do not the fun of moving within her amuse you? Do you enjoy serene programming in the shadow of its sprawling branches? Why are you worried about its futility? ”
7.2
In the east there is a shark that is larger than any fish. It turns into a bird, whose wings like clouds cover the sky. When this bird moves above the ground, it carries a message from the Corporation Management. A message falls into the thick of programmers as if a seagull were marking the beach. Then the bird saddles the wind, and returns home.
A novice programmer is surprised to follow her, because he does not understand it. The average programmer expects her to appear with concern, as she is afraid of her message. The great programmer continues to work behind the terminal, not noticing its appearance.
7.3
The wizard from the ivory tower brought his latest invention to the study of the Great Programmer. The magician rolled a large black box into the office of the Great, while he waited in silence.
“This is a general-purpose integrated distributed workstation,” began the Wizard, “designed with ergonomics in mind, with a closed OS, sixth generation languages, and many unique user interfaces. It took my assistants several hundred man-years to design it. Well, isn’t it an amazing thing? ”The
great programmer raised his eyebrows slightly:“ And really, amazing. ”
“The management of the Corporation demanded that everyone use this workstation as a platform for new programs. Do you agree to this? ”
“ By all means , ”the Programmer replied. “I will order to transport her to the data center immediately!” And the satisfied wizard returned to his tower.
A few days later, a novice programmer looked into the office of the Great and asked: “I can’t find the listing of my new program. Do you know where he could be? ”
“I know,” the Master answered. “All listings are folded on a new nightstand in a data center.”
7.4 The
Great Programmer moves from program to program without fear. He is not affected by changes in management. He will not be fired, even if his project is closed. Why? It is filled with Tao.
And the Great Programmer said: “Without wind, grass does not move. Iron is useless without programs. ”
8.1 The
novice programmer asked the Master: “I see that one software company is much more than all the others. She rises above them, like a giant among dwarfs. Any of its units can be distinguished into a separate business. Why so? ”The
master answered:“ Why are you asking such stupid questions? The company is big because it is big. If it produced only iron, no one would buy it. If she produced only programs, no one would use them. If she only dealt with support, people would treat her as a servant. But since it combines all these directions, people think that it is akin to the gods! Not looking for a fight, she wins without effort. ”
8.2
Once the Master passed a beginner. He noticed that the beginner is busy with a portable game.
“I'm sorry,” he said. “May I see?”
The beginner handed the game to the Master. “I see that the game offers three difficulty levels: easy, medium and hard,” said the Master. "And yet, any such device has another level where it does not try to either conquer a person or be conquered by him."
“Oh, Grand Master,” the novice prayed, “open up how to find this mysterious option?” The
master dropped the device to the ground and stepped on it with his heel. And the newcomer suddenly reached enlightenment.
8.3
There was once a programmer who wrote software for staff. “Look how good I am,” he told the mainframe programmer on a visit. “I have my own OS and file storage device. I don’t have to share resources with anyone. The software is consistent and easy to use. Why don't you leave your work and join me? ”
The mainframe programmer began to describe his system:“ The mainframe sits in the middle of the data center, like an ancient sage meditating. Its drives stand behind each other, like a whole ocean of cars. Software is multifaceted, like a diamond, and intricate, like a primitive jungle. Programs, each unique, move through the system like a fast river. Therefore, I am happy in my place. ”
The PC programmer, having heard this, was speechless. But the two programmers remained friends until the end of their days.
8.4
Iron met Soft on the road to Chiang Tse. Soft said: “You are Yin, and I am Yang. If we go together, we will become famous and earn a lot of money. " And they went together, hoping to conquer the world.
And they met Firmware, dressed in tattered rags, waddling along the road, leaning on a spiked stick. The firmware told them: “Tao lies beyond Yin and Yang. It is silent and quiet, like a lake. It does not seek glory - therefore no one knows about its presence. It does not seek wealth, for it is self-sufficient. It exists outside of space and time. ”
Iron and Soft, ashamed, returned home.
And the Great Programmer said: "The time has come for you to leave."

Book 4
Kodim
And the Great Programmer said: “A well-written program is Paradise for itself. A poorly written program is Hell to itself. ”
4.1
A program should be light and flexible, and its routines should be pearls strung on a thread. The spirit and purpose of the program must be maintained throughout its duration. The code should not be too much or too little. No unnecessary cycles, no useless variables. Neither chaos, nor excessive structure.
The program must follow the rule of least surprise. This means that the program should respond to user actions in a way that is least surprising to him.
A program of any complexity should work as a whole. The work of the program is dictated by logic, and not by external signs.
If the program does not meet these requirements, this leads to confusion and confusion. It remains only to rewrite it again.
4.2 A
novice asked the Master: “My program sometimes works, and sometimes it crashes. I followed the laws of programming, but I'm confused. What is the reason? "The
master replied:" You are embarrassed because you have not comprehended Tao. Only a fool would expect rational behavior from fellow humans. What did you expect from a car designed by people? Computers emulate determinism. Only the Tao is perfect.
The laws of programming are transient, only Tao is forever. Therefore, you need to contemplate the Tao before you reach Enlightenment. "
" But how do I know that I have reached enlightenment? "Asked the newcomer.
“Your program will work correctly,” answered the Master.
4.3 The
master explained the essence of Tao to one of the newcomers.
“Tao is present in all software, even in secondary programs,” said the Master.
“Is there a Tao in the calculator?” The novice asked.
"There is".
“Is there a Tao in a video game?”
“Even in a video game.”
“Is there a Tao in the DOS operating system?” The
master choked and slightly changed his position. “The lesson is over for today,” he said.
4.4
A programmer serving Prince Wong wrote a program. His fingers danced on the keyboard. The program compiled without errors and worked like a gentle breeze.
“Excellent!” Exclaimed the Prince. “Your technique is impeccable!”
“Technique?” The programmer asked, turning away from the terminal. “I follow the Tao and far from the techniques. When I started programming, I saw a task in front of me in one piece. Three years later, I saw routines instead. And now I do not see anything. My essence is in a formless void. My feelings are dormant. My spirit, not constrained by the plan, follows instinct. In short, my program writes itself.
Yes, sometimes difficult tasks are encountered. I see their approach, I slow down, I silently watch. Then I change one line of code - and the difficulties disappear like puffs of smoke. Then I compile, and the pleasure of work fills me. I close my eyes for a second, and then log out. ”
Prince Wong said,“ Oh, if all my programmers were so wise! ”
Book 5
Support
And the Great Programmer said: "Even a 3-line program will someday have to be supported."
5.1 A
frequently used door does not need to be lubricated.
Flowing water does not stagnate.
Deer is dissolved in the colors of the forest.
Programs get corrupted if they are not used.
5.2 The
manager asked the programmer how much time he needed to complete the program. “It will be finished tomorrow,” he answered quickly.
“In my opinion, you are not realistic,” the manager said. “How much time do you really need?”
The programmer thought. “Well, I want to add some features. It will take at least two weeks. ”
“And even that is too optimistic,” the manager insisted. "It will be enough for me if you just tell me when it will be finished."
The programmer agreed.
A few years later, the manager quit. On his way to a farewell dinner, he found the programmer sleeping at the terminal. He worked all night.
5.3 A
novice programmer once received the task of writing a simple financial module.
The newcomer worked hard for many days, but when the Master checked his program, he found that it had a visual editor, a set of general-purpose graphical methods, an interface to AI, but nothing remotely resembling finances.
When the Master asked him about this, the newcomer was indignant: "Do not be so impatient, in the end I will add a financial component."
5.4
Does a good farmer ignore a planted sprout?
Is a good teacher passing even the most humble student?
Would a good father allow an only child to starve?
Would a good programmer refuse to support his code?
Book 6
Control
And the Great Programmer said: “Let there be many programmers, but managers not. Then we will achieve productivity. ”
6.1
When managers sit, programmers write games.
When accountants discuss quarterly profits, the development budget runs the risk of being cut.
When scientists talk about a clear sky, clouds will soon appear on it.
And this is not a Tao of programming.
When managers make commitments, games fade into the background.
When accountants do long-term planning, harmony and order are restored.
When scientists talk about pressing issues, they will soon be resolved.
And this is Tao of programming.
6.2
Why are programmers unproductive? They lose time in meetings.
Why are programmers rebelling? Because managers too often interfere in the process.
Why do programmers quit? Because they burned out at work.
Having worked for bad managers, they no longer value their work.
6.3
One manager was about to be fired. But the programmer who worked on his team wrote a new program that became popular and sold well. As a result, the manager saved the job.
The manager tried to give the programmer a bonus, but he refused, saying: "I wrote the program because I was interested in the concept, so I do not expect rewards."
Hearing this, the manager remarked: “This programmer, although not taking the most revered position, understands what is the duty of an employee. Let's raise it to the elevated position of a consultant! ”
The programmer, having heard this, again refused:“ I exist to program. If they elevate me, I will only waste the time of other people. May I already go? The program is waiting for me there. ”
6.4. The
manager came to his programmers and told them: “Regarding your working hours: you will need to come at nine and leave at five in the evening.” The programmers got angry, several immediately resigned.
Then the manager said: “Okay, in this case, you plan your time yourself, just finish the projects on time.” Programmers, satisfied with this, began to arrive by noon and work until morning.
Book 7
Corporate Wisdom
And the Great Programmer said: "You can show the program to the director, but you cannot train him in computer literacy."
7.1 A
novice asked the Master: “In the east there is a huge tree structure called“ Corporate Governance ”. She's bloated because of all sorts of vice presidents and accountants. It spawns a mountain of memoranda calling for “go there” or “do this,” and no one knows what they mean. Every year, new names appear in the structure - and all to no avail. How can such an unnatural entity exist? ”The
master replied:“ You are observing it, and you are concerned that it has no purpose. But do not the fun of moving within her amuse you? Do you enjoy serene programming in the shadow of its sprawling branches? Why are you worried about its futility? ”
7.2
In the east there is a shark that is larger than any fish. It turns into a bird, whose wings like clouds cover the sky. When this bird moves above the ground, it carries a message from the Corporation Management. A message falls into the thick of programmers as if a seagull were marking the beach. Then the bird saddles the wind, and returns home.
A novice programmer is surprised to follow her, because he does not understand it. The average programmer expects her to appear with concern, as she is afraid of her message. The great programmer continues to work behind the terminal, not noticing its appearance.
7.3
The wizard from the ivory tower brought his latest invention to the study of the Great Programmer. The magician rolled a large black box into the office of the Great, while he waited in silence.
“This is a general-purpose integrated distributed workstation,” began the Wizard, “designed with ergonomics in mind, with a closed OS, sixth generation languages, and many unique user interfaces. It took my assistants several hundred man-years to design it. Well, isn’t it an amazing thing? ”The
great programmer raised his eyebrows slightly:“ And really, amazing. ”
“The management of the Corporation demanded that everyone use this workstation as a platform for new programs. Do you agree to this? ”
“ By all means , ”the Programmer replied. “I will order to transport her to the data center immediately!” And the satisfied wizard returned to his tower.
A few days later, a novice programmer looked into the office of the Great and asked: “I can’t find the listing of my new program. Do you know where he could be? ”
“I know,” the Master answered. “All listings are folded on a new nightstand in a data center.”
7.4 The
Great Programmer moves from program to program without fear. He is not affected by changes in management. He will not be fired, even if his project is closed. Why? It is filled with Tao.
The book.
Iron and software
And the Great Programmer said: “Without wind, grass does not move. Iron is useless without programs. ”
8.1 The
novice programmer asked the Master: “I see that one software company is much more than all the others. She rises above them, like a giant among dwarfs. Any of its units can be distinguished into a separate business. Why so? ”The
master answered:“ Why are you asking such stupid questions? The company is big because it is big. If it produced only iron, no one would buy it. If she produced only programs, no one would use them. If she only dealt with support, people would treat her as a servant. But since it combines all these directions, people think that it is akin to the gods! Not looking for a fight, she wins without effort. ”
8.2
Once the Master passed a beginner. He noticed that the beginner is busy with a portable game.
“I'm sorry,” he said. “May I see?”
The beginner handed the game to the Master. “I see that the game offers three difficulty levels: easy, medium and hard,” said the Master. "And yet, any such device has another level where it does not try to either conquer a person or be conquered by him."
“Oh, Grand Master,” the novice prayed, “open up how to find this mysterious option?” The
master dropped the device to the ground and stepped on it with his heel. And the newcomer suddenly reached enlightenment.
8.3
There was once a programmer who wrote software for staff. “Look how good I am,” he told the mainframe programmer on a visit. “I have my own OS and file storage device. I don’t have to share resources with anyone. The software is consistent and easy to use. Why don't you leave your work and join me? ”
The mainframe programmer began to describe his system:“ The mainframe sits in the middle of the data center, like an ancient sage meditating. Its drives stand behind each other, like a whole ocean of cars. Software is multifaceted, like a diamond, and intricate, like a primitive jungle. Programs, each unique, move through the system like a fast river. Therefore, I am happy in my place. ”
The PC programmer, having heard this, was speechless. But the two programmers remained friends until the end of their days.
8.4
Iron met Soft on the road to Chiang Tse. Soft said: “You are Yin, and I am Yang. If we go together, we will become famous and earn a lot of money. " And they went together, hoping to conquer the world.
And they met Firmware, dressed in tattered rags, waddling along the road, leaning on a spiked stick. The firmware told them: “Tao lies beyond Yin and Yang. It is silent and quiet, like a lake. It does not seek glory - therefore no one knows about its presence. It does not seek wealth, for it is self-sufficient. It exists outside of space and time. ”
Iron and Soft, ashamed, returned home.
Book 9
Epilogue
And the Great Programmer said: "The time has come for you to leave."