order
The publication of The Way of Programming has been generally accepted by the programming community, and the publishing house invited me to translate some of them.
Guan's article, as a supplement to that famous book. Although, I declare that my ability is difficult.
Yes, but I was finally persuaded to give it a try.
This book is the result of many months of research and translation. It tries to find a complex theme by extracting from those traditional works. I don't doubt that many experts in computer archaeology will express their opinions on my extraction criteria.
. They asked quietly, "Why didn't he include the fables of UNIX programmers, elephants and prostitutes?" "How dare he ignore the long-standing story The Adventures of Turing Market!" For these criticisms, I can only say, >
I have tried my best to choose representative content.
To determine the age of each chapter, I used the dynasty system. For those unfamiliar with this method, it can be divided into four dynasties (or "four generations").
The first dynasty, the so-called "golden age", can be traced back to the era of making computers with glass tubes; Many modern scholars assert that this era is a myth. The second dynasty began with the invention of the transistor.
It ends with a copy of the integrated circuit.
The history of modern computers began in the third dynasty, ruled by the mainframe and the military minister who controlled the mainframe. The fourth dynasty began with the suppression of "integration" and the resistance of "integration" to the established order.
Was brutally destroyed by the fanatical "Blue Army". Ironically, it is this kind of blow that causes the Zen of programming to spread to the outside world.
In addition to the ancient materials that constitute the main body of this book, I am also fortunate to have the help of Dr. Babbage and Dr. Yu, who wrote the introduction and preface for this book respectively. I hope their contribution to this book can be more or less & gt;;
Make up for my incompetence as an editor.
Jeffrey James
1988 65438+ October in Los Angeles
catalogue
order
order
introduce
The first piece of wood
The second fire
The third article soil
The fourth article gold
Chapter V Water
According to the ancient "Five Elements Theory", this book consists of five parts:
Wood, fire, earth, gold and water.
Master: Ninja Walker, Hermit, Hercules, A Xing.
Media: chronicles, folk stories, sermons, case-solving and haiku.
Hardware: keyboard display CPU printer disk
Direction: southeast, central and northwest.
Software: editor, formatter, debugger, interpreter, compiler.
Sense: touch, sight, smell, hearing and taste.
Stage: Interface design, coding, debugging and testing
Animals: dragons, phoenixes, cows, rabbits and snakes.
System: VMS CP-6 operating system VS MS-DOS Unix.
This classification system is all-encompassing, and it is impossible to explain it clearly in the space of this book. However, in meditation,
After these ever-changing relationships, you may find that amazing insight.
order
There is no doubt that the ancient programming art is usually misunderstood in the eyes of westerners, but the modern view holds that it is a kind of
Engineering, mechanics and materialism.
Many people think that programming is only a means to achieve a goal, and it is a program (and process).
Order members can only be evaluated according to their ability to make money.
These primitive illusions come from a profound misunderstanding of the real intention of programming.
Superb programmers are not committed to superficial success, but to finding a mysterious existence between man and machine.
According to Zen, there is no boundary between hardware, software, firmware, interface and understanding-on the contrary, they are all.
Combine into a harmonious whole.
Only when programmers finally learn to put aside the false feeling of "self-existence" can they reach this state.
It is possible to realize, and the feeling of "self-existence" often accompanies most of our lives.
This is what computers bring-the behavior of Zen master programmers.
Some people say that programmers who master Zen master life. Such a programmer is a tireless child.
See the world with joy.
Awakening programmers can also feel the computers in houses and buildings on both sides when walking down the street.
When the modulated data passes through the computer line, the awakened programmer can feel and hear the continuity of the current pulse.
Hum.
The awakened programmer has been integrated with the universe.
Geoffrey, my former student, was able to do this work, and in 2000, he recreated the classic works of Zen lost in programming.
The world, as a teacher, I feel sincerely satisfied.
I sincerely hope that this book can re-establish the important position of Zen in the education of perfect programmers.
Dr. Yu Zhengping, School of Beyond Mechanical Engineering, Lotus University
Lhasa, Tibet
introduce
When Mr James asked me to give an introduction to his book, he told me some of my own plans.
I really can't think of a better way to protect my personal experience in this mysterious field. The maintenance of the program is programming.
A field that is rarely understood in design art.
Some readers will certainly insist that there is no difference between the profound teachings of Zen and the humble skills of program maintenance.
Point. But as a master said: "Methods and approaches (namely Tao) exist in all programs, even in.
In video games. Therefore, there is no doubt that the art of program maintenance has its Zen side for a long time.
Although for untrained people, this may not be immediately apparent.
My story began a few weeks after I graduated from university majoring in computer science. My goal after graduation from college is to serve the people.
R&D institutions, preferably departments that compile programs or design operating systems. I finally found one.
I am willing to hire my organization blindly, but only if I finish the program maintenance work within a period of time.
Learn this system.
Of course, I will have resistance to this suggestion. I spent five years in college, but it was a waste of time to figure it out.
Make some mistakes of other programmers! However, because they promised to let me do the work I am interested in in in the future, I
I accepted, and reminded myself in my heart that even if this job can't do anything, I can still find another job.
When the second weekly report arrived, I was led to see the master of the program maintenance group. Director of personnel department
Take me quickly through the dark corridor of the development center, and finally she pointed to a door at the end of the long corridor and said
: "He's inside." Say that finish, I left, as if a little absent-minded.
I went to the door and peeped in. I saw a man sitting in front of the terminal working, but his back was turned to me.
So I don't know how old he is and what he looks like. I just show my existence by coughing. Here,
The master said, "Please sit down" without looking back.
Over his shoulder, I caught a glimpse of those incomprehensible screen displays. When his long fingers danced on the keyboard,
They flashed on his terminal. Finally, he snorted with satisfaction, quit the system and turned around.
Turn around and face me.
What I saw surprised me, because he didn't look like the kind of person who should be a Zen master. His face is boring, almost
It's ugly. His hair is like a halo of trouble. But the first thing people pay attention to is his eyes, through the thick
Glasses emit a faint blue light.
He looked at me from head to toe, then nodded, as if to confirm a personal point of view, "you are the new one."
Come here? "He asked sourly.
"yes." I answered. Pretending to be full of passion, I quickly summed up my experiences and achievements in college.
Report.
The man listened politely, and then said, "That's good, but have you ever done maintenance work on a program before?"
I told him frankly that I didn't do it.
The host gave a long sigh. "Well, we should do what we should do." He said. Then he took it from a shelf
Write down a bunch of programs on the internet, open them at will and hand them to me. Then he asked, "What do you do with this?"
? "
My eyes are fixed on this list, which is an assembly language mixed with some strange macro languages. Every ten lines
Sentence, control is transferred to a mysterious subroutine, and even if this program has any structure, I have seen it.
Not coming out. "What program is this?" I asked.
The master took the list from my knee. "This is the Tibetan code of several generations of masters," he said.
When you learn to catch the wrong code from the maze, it's time for you to start. "Then he closed the door.
Make a list and put it back on the shelf.
I soon realized that the maintenance of the program was much more difficult than I thought. At first, I tried to learn the book Code Set.
Jing, but to my annoyance, I found that assembly language never provides instructions according to the rules.
This document left only some notes, which was written by a hardware developer who died or left the company many years ago.
This kind of coded Tibetan scriptures can't help me. Although there are some notes occasionally, these notes are different from this kind.
Assembly language is as vague as it is, except for some worrying information about the original hardware structure.
Other things.
When I complained to the master about all this, he listened politely. After we were silent for a long time, he replied.
Answer me:
"You are trying to understand something that your rational mind can't understand," he said. "This led to.
The result must be failure. You must clear your brain first, and only then can you begin to understand code hiding.
Classic. "
Then, Master began to slowly explain to me the complicated logic in encoding Tibetan scriptures. When I listen to his gentle
When I heard the sound, I finally began to notice a flicker of light, which is the glory and eternity hidden in the coded Tibetan scriptures.
Light. "Those masters know nothing about' good programming practices and rules'," said the master. They work hard.
What documents do they need to understand the internal activities of computer thinking in general? These programs are
The expression of limit.
However, even though I slowly began to understand something, I still felt like a little flying insect struggling in amber. teacher
What my father said is completely different from what I learned, and my rational thinking is hard to accept. But master always repeats patiently.
Repeatedly explain that I must not rely on rational thinking to reason, but use the subconscious to understand the connotation of encoding Tibetan scriptures.
After months of guidance, I feel confident and want to try my first patch. In order to give the master a
Surprise, I work in secret. I wrote a patch that can rerun a few lines of statements and reorganize the program.
And release the new program to the production system.
The next morning, I came a little late. To my surprise, the director of the development center and the general manager of the department are
In the master's office. When I entered the hall, the manager of the sales department saw me and closed the door. I listened with rapt attention.
Speak loudly, but I can't hear you clearly.
After the two guests left, I walked into the host's office. "What is it?" I asked.
"Your patch entered the production system at six o'clock last night. It has been deleted now. "
"So?"
"You can go on working." The master said.
Finally, I finally understand that all the efforts to understand the encoded Tibetan scriptures with my rational thinking are futile, which makes
I am desperate. Master noticed this change in my mind and began to teach me how to turn on the computer. He taught me meditation and
He said that since the computer age, the technical support department has passed on the skills of error checking from generation to generation.
I listened and began to realize a huge fact about my previous programming experience. We met in college.
The programmer's job is mainly to control the activities of hardware and software. The highest artistic realm of programming is to complete a project.
Task or achieve the goal, and successfully use superb programming skills. But program maintenance is different from program development.
If you want to maintain a program, you should regard it as a growing plant, and it is useless to pull out the seedlings to encourage it.
In fact, such behavior is more likely to lead to the death of plants. A project must be carefully cultivated. The programmer is right.
Before changing the program, you must be very familiar with every logical relationship and deeply understand the intention of the program.
Shelley's understanding cannot be achieved overnight, and it takes a long time to accumulate.
After several months, I was finally able to successfully design a patch for encoding Tibetan scriptures, but I had to pass it before designing.
After a long meditation, I opened the program on my desk. I also found that if I work,
When I lit a stick of incense, I kept repeating the formula that Master taught me: "Null-So-Stix-Etx-Eot".
I can concentrate more easily.
Attention. Master said that the formula means "five elements" of the universe.
Soon I found that I no longer care whether I can get rewards from my work performance, in myself and the projects I maintain.
There is no separation between them. Like a person who has lived in the shadow all his life, I began to understand the Zen meaning of programming.
This is an unspeakable and indescribable force hidden behind the programmer's design, just like the sun that casts a shadow.
Sample.
After getting rid of the meaningless "self-existence", I began to find that those great programming statements used to be
It seems vague to me, just because I haven't fully understood them, and I can't understand them. Now I know why.
In the past, those programmers never provided documentation for their programs because the description of the English language itself was more confusing.
Not inspiring.
One day, I found that a problem I was solving involved the most complicated part of coding Tibetan scriptures-error score.
Analyze the whole process. I didn't know anything about this, so I gave a patch that could pass the hardware interrupt area.
Check the contents of to determine the error condition, so that the program can continue to execute correctly.
That afternoon, Master walked into my workshop for the first time. He put his hand on my shoulder and looked down at me.
"It is time for you to start your career." He said.
The above is my first experience in Zen programming. Although I have been assigned to participate in many projects since then.
But I have never forgotten what my first teacher taught me.
Imagine my surprise when I found so many languages that my master loved very much in Zen of Programming.
Time. I finally saw the ancient tradition hidden behind his unforgettable speech.
Mr. James rediscovered that classic and far-reaching book, and we all owe him one. ask
If he hadn't persevered, he might have lost it forever. In this book, Mr. James has collected many periodicals, such as
Heresy preaching, folk stories and poems. This constitutes the legendary "integrated teaching" theory. To be exact; Precisely
Through the efforts of scholars like Mr. James, the programming light of the hidden Zen machine shines forever.
People who care about future generations.
Charlie Babbage
The first piece of wood
Master: Ninja
Media: Chronicle
Hardware: keyboard
Direction: East.
Software: editing program
Feeling: touch
Stage: interface
Animals: dragons
System: virtual machine
wood
As the revival of MRVMS/IIIX Buddhist Temple, the master programmer Ninja (this is the nickname given to him by later generations, his real surname.
The name cannot be verified-it's very famous. There are some legends that he jumped from an unknown programmer to someone.
Head of the development department of a powerful programming organization. After he finished an advanced operating system, he quietly
Disappeared According to him, this system needs neither hardware nor software, and it can run accurately. Ho Yin
No one knows where he is now, but it is said that he often appears as a management consultant.
one
When Ninja first worked in that development center, he was assigned to support the operating system. One day, a manager
Walk into the ninja studio.
"Why don't you work?" The manager asked.
"The system is down." Ninja said.
"The manager frowned." We pay you to make the system work normally! "He said loudly.
"The system is not paralyzed." Ninja said.
two
Ninja master said:
"If your application doesn't work properly, don't blame the operating system."
three
Master Ninja participated in a computer exhibition.
Many companies have introduced bright monitors and all the latest and biggest hardware and bodies they can find.
Blonde model in swimsuit.
Ninja didn't even look at the booth. Instead, he just opened a folding chair and sat quietly in the corner. no
Someone walked past him and asked him a question or two. He thought for a moment and then gave a short answer.
People sat cross-legged around the master-the collected pamphlets were scattered on one side-waiting for him quietly.
Go ahead.
four
Ninja master said:
"For a wise man, just one word; For the fast horse, it is just a whip; For well-written programs, as long as a single
A simple command. "
five
Ninja master attends the board meeting. When he began to explain the technical features of the software, the company executives
Children, some fidgety in their seats, some staring out of the window, some staring at coffee cups in a daze.
So, the master began to talk about how much money the software would make, and then the administrators pricked up their ears.
Flowers began to jump around the room. Obviously, they were attracted by the pleasant sound.
six
A company executive came to see the ninja. He found the teacher playing computer games. "What does this mean?" manage
The officer asked.
"I am testing the system." The master said.
The magistrate looked closely at the screen and it happened.
seven
One day, members of the board of directors got together to discuss business. They called the ninja master and asked him to make a report. "You?
What is the quarterly forecast? "They asked.
"There is no quarterly forecast." The ninja replied.
"What's your budget plan this year?" They asked.
"There is no budget plan this year." The ninja replied.
Then they asked, "Can you confirm that you are a ninja master?"
"There is no ninja master." The ninja master replied.
The directors were so confused that they had to suspend the meeting and go home.
eight
Ninja master said:
"It is easy to design an operating system with millions of programs, but it is much more difficult to change a person's nature."
nine
Three executives from different computer companies went to learn the true meaning of leadership from ninja.
Ninja asked the first administrator, "Do you have the organization chart of your company now?"
The first judge took a piece of paper from his pocket. "I always carry one with me." As he spoke, he put the paper
To the ninja.
The ninja looked at the paper with interest. "It seems that the template has been set up on the computer," he commented.
Go ahead.
"That's true," said the administrator proudly. "We have computerized our organization chart.
So you can choose to call as soon as you receive the notice. "
Ninja smiled and handed the paper back. I can't help you. He said.
The second magistrate then asked the real meaning of the ninja leadership art.
"Do you have the organization chart of your company now?" The ninja asked.
The second administrator shook his head. "Our organization has not changed in recent years. I remembered it years ago. "
Ninja frowned. I can't help you. Said.
The third magistrate asked the real meaning of ninja leadership art.
"Do you have the organization chart of your company now?" The ninja asked.
The third judge shrugged. "We don't have an organization chart," he said. "Everyone can do what they like.
Well, you can do it anytime. "
Ninja frowned. I can't help you. He said.
The three consuls whispered together for a while, turned to the ninja and said, "Well, let's have a look at your machine."
Structure setting diagram. "
Ninja takes them to an empty place where a tree grows alone. "This is my institutional setup.
Figure. "Ninja said as he put his hand on the trunk of a rough skin.
The second fire
Master: Walker
Media: Folk Stories
Hardware: monitor
Direction: South.
Software: Formatter
Feeling: vision
Stage: design
Animal: Phoenix
System: CP-6
fire
Programmer Walker collected all kinds of harsh folk stories about development. Recent computer archaeological research shows that,
The following folk stories are based on historical facts. Although you may inadvertently add some exaggerated elements.
Added, but the core content of its historical truth still exists.
one
When a project manager staffs his software project, he will hire 300 programmers in one day. winner
A scholar with a doctorate in computer science came to apply, and he got a well-paid position.
One day, the project manager was fired. "I think everyone should be clear about their responsibilities and perform their duties.
Responsibility. "The new project manager said when reviewing his team of programmers. Hearing this, the scholar remained silent.
Slipped away.
two
Two programmers are discussing the user interface in the emergency room.
"In terms of' ease of use', many major innovations are under way," said the first programmer.
Soon, people will no longer need to read those complicated user manuals before using computers. travel
The preface speaks for itself. "
The second programmer thought for a moment, and then said, "I was going to chop some wood to make a fire last week, but my axe was old."
Blunt. So I went to the hardware store and bought a new one. "
"This is interesting," said the first programmer, "but what does this have to do with the user interface?"
"This new axe comes with an eight-page instruction manual." He replied.
three
A third party once asked an engineer, a mathematician, a physicist, and a programmer, "There is one box.
How many noodles? "
The engineer answers first. "The box has four sides." He said.
"What do you mean?" Asked the wise man.
"These four vertical faces are what I call faces. They are connected by the top and bottom. " The engineer replied.
"This is ridiculous," commented the mathematician. "The box has six sides."
"What do you mean?" Asked the wise man.
"This box is a cube, so it has six faces," replied the mathematician.
"No," said the physicist, "a box has twelve sides."
"What do you mean?" Asked the wise man.
"Strictly speaking, there are six external faces and six internal faces," replied the physicist.
The wise man looked at the silent programmer. "What do you think?" Asked the wise man.
"A box has only two sides." The programmer said.
Hearing this, engineers, mathematicians and physicists all laughed.
"What do you mean-a box has only two sides?" Asked the wise man after the laughter stopped.
"This is based on personal experience," said the programmer. "'Inside' is where the circuit board is placed, while' outside' is.
Where to put the monitor. "
"Exactly." The wise man said.
four
A new supervisor is having a meeting with the programmer.
During the dinner, a programmer recited the following passage-"We have been expecting you."
Come on, your predecessor didn't have your noble ability at all. Now that you are here, we will become really productive.
Force. "
The new director is all smiles and full of flattery. "Did you write this speech yourself?" He asked.
"This is what our development center does," said the programmer. "No matter which new supervisor comes, we will.
This is the only speech I know. "
five
One day, a programmer in the development center found an algorithm system that can generate maze patterns. He is very diligent.
This algorithm is modified so that it can create an uninterrupted maze on a long printing paper tape.
Soon, he made a maze with millions of poverty points, 40 feet long and 7 feet wide. He hung up the printing paper.
In the long corridor in front of the programmer's office, in a short time, all programmers crowded in front of the maze.
Trying to solve this big problem.
The director of the development center happened to pass by. He stared at the scene in surprise and looked depressed. But when he entered the programming university,
When the teacher's office wanted help, the master had long since disappeared.
six
Five beginners came into the master's office crying, "Boo hoo! I heard that our project may have to be cancelled. "
The master said, "Everything goes on as usual until they stop."
Hearing this, beginners return to their jobs.
seven
One day, the development center received news that a new director would be appointed to be in charge here. He is a minister of military affairs and is interested in computers.
Know very little.
Programmers were very surprised to hear the news and stopped programming one after another, wasting a lot of time trying to figure out what was going to happen.
An unfortunate day has come.
Seeing this situation, a master decided to do something. So he borrowed a costume to dress up as a gorilla.
Soon, the minister took office. He called all the managers to a small conference room, accompanied by several headquarters.
Company executives, it is said that they are here to make a "smooth transition" of the development center.
Suddenly, the owner dressed as a gorilla broke into the house. He jumped on the conference table and kicked the papers everywhere.
Yes, and growled at the administrator who sat there dumbfounded. Then, he wagged his head.
Leave the meeting room suddenly, just like when he came.
Hearing this, the programmers all went back to work.
The author once talked to several people, and they all witnessed the events described in this legend. The author also heard that one year
Later, a similar provocative behavior occurred in a certain department of IBM. The difference between the second incident and the first incident is that
Programmer Yu stood at the door in sportswear and coughed loudly.
eight
A group of programmers are reporting to the chairman. "What is the greatest achievement this year?" The chairman asked.
The programmers discussed it together for a while, and then answered, "The bug we solved this year (program error-
50% more than last year. "
The chairman looked at them doubtfully. Obviously, he doesn't know what BUG means. He whispered to the ministers around him.
After a while, he turned to the programmer, his face flushed with anger. "Such bad quality control, you should ask.
Feel guilty. There will be no "bugs" next year! He ordered.
To be sure, when the programmer reported to the chairman the next year, he did not mention this BUG.
nine
A company manager came to visit the development center. He walked in the long corridor, just like a general reviewing troops.
Sample. From time to time, he leans up to talk to people he meets. Finally, he walked into a programmer's office.
Programmers are absorbed in checking the operating system for errors.
The sheriff looked around the office and noticed a statue of a pig on the programmer's terminal. "I often program.
The antiques and souvenirs collected by the staff were deeply attracted, the librarian said. There seems to be something very behind them.
Interesting story. For example, what does the statue there mean? "He pointed to the statue.
The programmer looked up from the terminal, blinked, and then stared at the statue, as if it was the first time to see it.
Yes "This is a pig!" He said.
The third article soil
Master: Hermit
Media: preaching
Hardware: CPU
Direction: medium
Software: debugging program
Sense: sense of smell
Stage: coding
Animals: cattle
System: operating system/virtual system
land
The author of the following quotations, a master programmer hermit, has always been vague in people's minds. He is marked by COBOL language.
He was assassinated by an agent of the quasi-Committee, but little is known about him.
one
I've heard:
What seems easy at first is often the hardest in the end. That's why programmers say-"Open!
Nine percent before delivery takes half the time, and the other half is used for ten percent after completion. "
two
I've heard:
The biggest mistake of man-machine interface is to ignore the rights of computer. Systems that are forced to be compatible with old concepts are always influenced by calendars.
The limitations of history. Computers shouldn't simulate reality-they should surpass reality.
three
I've heard:
A computer company has designed a powerful system, which is ahead of the times. Because I'm worried about this.
The new design may be copied. They kept the structural design of the hardware secret and applied for a patent for the operating system.
10 years later, a beginner asked the programmer about the dirty and old wooden box behind the data center.
four
I've heard:
Don't let political reasons affect technical decisions; And don't make political decisions based on scientific papers. Only in the absence of it.
In the mind of the knower, these things will always be mixed together.
five
I've heard:
The timetable for project planning and release itself is meaningless. These dates and milestones in the project progress do not mean that
What to wear. However, there is a secret timetable that everyone involved in the project knows. This secret
The timetable has never been fooled by outside attention, nor has it been manipulated to cater to the market plan. This secret schedule
It is always observed because it reflects the mutual understanding among all members of the development department. When the project reflects this reality,
When, the program will be completed as scheduled; When the project plan conflicts with this reality, the procedure will be delayed.
six
I've heard:
There are three situations that will definitely lead to the failure of programming projects. In the first case, the manager in charge of this project is interested in software.
Know nothing; In the second case, the project leader in charge of the program code is not interested in writing the code; third
In one case, programmers who write code are hired temporarily and lack loyalty to the project. In these three cases,