Programming Zen
Geoffrey James
Foreword
The publishing of "Programming" has been universally accepted in the programming industry, and publishers invites me to translate some
The related articles are supplemented as the famous classic. Although, I declared my ability to win.
Nice, but I was finally told for a try.
This book is the result of research and translation in many months. It tries to pass through the tradition of traditional works.
Complex topic. I don't doubt, there will be many computer archaeological experts to comment on my excerpt standard.
They asked, "Why didn't he bring" UNIX programmers, elephants and prostitutes "to come in?" "He
I dare to ignore the historic story "Tuling Market Adventures"! "For these criticism, I can only say, I have
After exhausting my biggest effort to choose a representative content.
In order to determine the ages of various chapters in the article, I used the dynasty system. For those agents who are not familiar with
The person of the method can be divided by four dynasties (or "four generations").
The first dynasty, that is, the so-called "golden age", to be traced back to the day by the glass tube; many
Modern scholar asserts that this era has mythical color. The second dynasty begins in the invention of the transistor,
Bunch of reappearance of the integrated circuit.
History of modern computers, starting from the third dynasty, it is ruled by the host and control of the military machine minister.
The fourth dynasty began in the "integration" suppression, "Integration" is established, the renal of the established order,
The fanatic "Blue Corps" is cruelly destroyed. Ironically, it is this suppression, leading to programming
Zen spread to the outside world.
In addition to the ancient material that makes up the subject, I still have to get the help of Dr. Babbage and Dr. Yu.
Help, they have written introduction and order for the book. I hope that their contribution to the book can be more or less
I don't make up my editor.
Geoffrey James
In January 1988 in Los Angeles
table of Contents
Foreword
sequence
introduction
First wood
Secondfoot
Third earth
Fourth gold
Fifth water
According to the ancient "five elements", this book is from five parts:
Wooden fire water water
Master: Ninja Walker Hidden Hercules God
Media: Chronicle of the Chinese Story
Hardware: Keyboard Display CPU Printer Disk
Direction: East China West North
Software: Editing Program Format Program Debugger Interpretation Compiler
Feel: Tactile visual sense hearing taste
Stage: Interface Design Coding Test
Animals: Dragon Phoenix Cow Rabbit Snake
System: VMS CP-6 OS / VS MS-DOS UNIX
This classification system is unlikely to explain it clearly in the space of the book. however,
After pensive, you may find that amazing insights will be found.
sequence
There is no doubt that the ancient programming art will usually be misunderstood in the mind of the Western people, and modern views think this.
It is an engineering, mechanical theory and materialism.
Many people think that programming is only a means used in order to achieve a purpose, and a program (and
Programmers) can only evaluate them according to their ability to make money.
These original illusions come from a deep misunderstanding of the true intent of the programming.
The superb programmers are not committed to the success of the surface, but to find a mysterious existence between the human machine.
According to the interpretation of Zen, there is no boundary between hardware, software, firmware, interface and understanding - instead, all this
Some combine into a harmonious whole.
Only when the programmer finally learned the false feeling of "self-self", this kind of situation
The world may reach, and the feeling of "self-existence" is often accompanied by most of our people.
This is the behavior of the programmaker from the computer.
Some people say that the programmer who has mastered the Zen machine will also master life. Such a programmer is in a never tired
Childish joy will look at this world.
A conscious programmer, walking on the street, you can feel the computer and the computer inside the building.
The conscious programmer can feel and hear the current pulse while the modulated data passes through the computer line.
Constant buzz.
Probable programmers have integrated with the universe.
My previous student Geoffrey can complete such a job, reproduce the classic writing of Zen of the lost programming
As a teacher, I feel sincerely satisfied.
I sincerely hope that this book can re-establish an important role in the perfect programmer education.
Dr. C.P. Yu
Lotus University Beyond Machinery College
Tibet Lhasa
introduction
When Mr. James asked me to write a introduction to him, in addition to telling about myself
The program maintained personal experience in this mysterious area, I really can't think of a better way. Program maintenance
It is a field that is rarely understood from the art.
Some readers will definitely say that there is nothing in the humble skills of the Zen's Deep Olympicity and Procedure Maintenance.
Common. But just as a master said: "Method and way (that is, the way) exists in all procedures
Even in the video game. "Therefore, long-term procedures maintenance art must have its Zen aspects, this is
It is undoubtedly, although it may not immediately appear for unstoppable minds.
My story begins with my weeks I have graduated from the University of Computer Science. Our goal after graduating from our university
It is for a study and development agency, it is best to compile procedures or operating system designs. I finally finally
Find a institution that is willing to hire me, but the condition is that I have to pass the programmed dimension within a period of time.
The work of protecting "Society this system".
I will certainly create a psychology of this proposal. I spent five years of university time, it was for a waste of time.
To address other programmers! However, because they have promised to make me feel interested in the future
So I accepted it and reminded himself in my heart. Even if this work is not famous, I can find it.
his job.
When I went to the second week, I was taken to meet with Master of the program maintenance group. Personnel department
The total tube takes me quickly through the dark corridor of the development center, and finally she pointed at the end of the long hall.
A door said: "He is there." Say that he is trick, it seems that some heart is not.
I walked to the door, my eyes gave to the inside, I saw a man sitting in front of the terminal, but he turned against
I, so I don't know how old him, what is much longer. I only have a cough to show my existence.
Here, the master didn't even look back at glance: "Please sit".
Crossing his shoulders, I saw those difficult screen display, flying on the keyboard with his slender fingers
Dance, they have flashed on his terminal. Finally, he was satisfied with it, withdraws the system.
Then turned around to face me.
I saw it, I am surprised, because he seems unlike a person who should be a Zen teacher, his face is tall,
Almost ugly, his hair is like a circle of annoying. But people first pay attention is his eyes,
Thick glasses have a touch of blue light.
He looked at me from the beginning to the foot, then nodded, just confirmed a person's point of view, "You are that
New? "His asked with sour.
"Yes." I replied. I pretend to be passionate, put my experience and make a fast score in college.
report.
This politely listened, then said: "That's good, but have you been doing the maintenance of the program before?" I frankly told him that I have not done.
Master sighed, "Well, we should do what we do." He said. Then he from one
Remove a large list of procedures on the shelf, free to open it, and hand it to me. Then he asked: "How do you
Deal with this? "
My eyes are staring at this list, and that is the assembly language, but also with some strange macro language. Every more than ten
Scriptures, control power transfer to a mysterious subroutine, and even if this program has any structure
I can't see it. "What is this program," I asked.
Master took the list from my knee, "This is the" Master of Generation "," he said,
"When you learn to grab the wrong code from the mismuth, that is, you have a teacher."
He closed the list and put it back to the bookshelf.
I will soon realize that the maintenance of the program is far more difficult than I think. I started to learn the book "Code"
The assembly language used in the Tibetan scriptures, but I am worried about that I have found that the assembly language has never been provided by the rules.
In explaining documentation, there are only some notes in existing, which is a hardware developer who die or leaves the company many years ago.
written.
This "Coding Tibetan" cannot give me any help. Although there are occasional comments, these comments and
This assembly language is like blurred, except for some people involved in the original hardware construction to
Don't have it.
When I complained about all this, he listened and listened, and after we were silent for a long time.
, Answer me:
"You are trying to understand something impossible to be understood by your rational thinking," he said, "
The result will inevitably fail. You must first empty your brain, only then, you can start comprehension "
Tibetan scriptures. "
Then, Master began to slowly explain the complex logic of the "Code Tibetan". When I listen to him
When I was a sound, I finally started to feel the glitter of light, which is hidden in the "Code Tibet".
And eternal lighting. "Those masters don't know about 'good programming practices and rules'," Master
Said that they work hard to understand the internal activities of computer thinking, what do they need?
What is the file? Those programs are extreme expression.
However, even if I start to have something to understand, I still feel that I am like a small flying insect in amber.
. Master said that I have learned that I have learned, my rational thinking is hard to accept. But Master always resists
Once you have all over again, I have to rely on rational thinking to reason, and I have to use the subconscious to understand the "Code Tibet"
The connotation of "".
After several months of guidance, I feel very confident, I want to try my first patch. In order to give Master
A surprise, I secretly work. I wrote a patch that re-runs a few rows of statements, re-entering the program
The row is assembled and the new program is released into the production system.
The next morning, I came late for a while. Let me feel strange that the Director of the Development Center and the General Manager
Master is in the office. When I walked into the hall, I went to the department's general manager to see it. I listen
I have seen a lot of speaking, but I can't hear what.
After the two visks left, I walked into the office of Master, "What?" I asked.
"Your patch, I entered the production system at 6 o'clock last night. It has now been deleted."
"So?"
"You can still continue to work." Master said.
Finally, I finally understand that all the efforts of "coding Tibetan scriptures" is futile,
This makes me very desperate. Master heard this change in my thoughts, and he began to transfer to me. He taught me to meditate and check the wrong skills. He said that these techniques are from the beginning of the computer age, from the generation of technical support
Down.
I listened and began to realize a big fact about my previous programming experience. In college, I
It is mainly to control hardware and software activities, and the highest artistic realm of programming is for
Complete a task or achieve a goal and successfully use superb programming skills. But the program maintenance is different from
Program development. To maintain a procedure, it is necessary to treat the program as a gradually growing plant, plucking
Long is no benefit. In fact, such behavior is more likely to lead to the death of plants. A program must be small
Nourishment. Programmers must be very familiar with each logical relationship before making the program.
There is a deep understanding of the intent of the program. This kind of understanding is not available on one night, it needs
Long time accumulation.
After a few months, I finally gave the "Coding Tibet" to successfully design a patch, but it is necessary to design
After a long time, I have to open the list on my table. I also found that if
When I worked, I looked with a fragrant. I kept in my mouth to repeated Master to give me the mouth: "
Null-So-Stix-ETX-EOT "(ASCII code table, five bytes NUL, SOH, STX, ETX, EOT)
Sound - translation), I am easier to concentrate. Master said that the mouth means the "five original" of the universe.
Soon I found that I no longer care for rewarding for work, in my own and my maintenance
There is also no separation between the order. I am like a person who lives in a shadow like a life, start understanding programming.
Zen, this is a force that is hidden behind the programmer's design, just like project shadow.
The sun is the same.
After getting out of the meaningless "self-existence", I started to find out that those great programming statements
In the past, it seems to be ambiguous, just because I have not fully understood it, I can't understand them. I know now
Why did those programmers in the past provide documentation from not for their programs, because the description of the English language itself
More confused, but they are inspired by people.
One day, I found that one of myself is solving involves the most complex part of the "Coded Tibet" - wrong
Map analysis. I gave a patch in the case of this, I can pass hardware.
The content of the interrupt area is checked to measure the error, so that the program can continue correctly.
That afternoon, Master walked into my work in the first time. He put his hand on my shoulder, and his eyes looked down.
I, "Now it's time to be a teacher." He said.
These are the experience of my first contact with Zen programming. Although I was assigned to many items from then
Designed, I have never forgotten my first master to give me the teachings.
Imagine my surprise - when I found that many of my Master was very loved in "Programming Zen"
Language. I finally saw an ancient tradition behind his unforgettable speech.
Mr. James re-discovered the work of the classic influence, we all owe him a person.
. If it is not his constant, it may always lose. In this book, Mr. James collected a lot of piles.
Regular, such as heresy, folk story and poetry, etc., they form a legendary "integration"
The teachings. It is the effort of scholars such as Mr. James, which makes the extension of the shelving Zen machine.
The people of Mang Yongnee shine shine in the descendants.
Charlie (Chuck) Babbage
-------------------------------------------------- ------------------------------ First Wood
Master: Ninja
Media: Chronicle
Hardware: Keyboard
Direction: East
Software: Editing
Feel: Tactile
Stage: Interface
Animals: Dragon
System: VMS
wood
As the revival of the MRVMS / IIIX Zen College, the programming master is ninja (this is the nickname of him, his true
The name cannot verify - the translation is very famous. There are some legend, saying that he jumped from an opaque programmer.
Become a supervisor of the development department of a strong strength program design agency. He has completed a set of advanced operating systems
After, it quietly disappeared. According to him, this system does not require software, it is also necessary to accurately
Play function. He is now going to know, but he heard that he often appears in a management consultant.
One
The Ninja initially came to the development center to work, he was assigned to support the operating system. One day, one
I entered the work between Ninja.
"Why don't you work?" Asked the manager.
"The system is awkward." Ninja said.
"The manager frowned." We pay you salary, you want you to maintain the normal operation of the system! "He said loudly.
"The system is not paralyzed." Ninja said.
two
The Ninja Master said:
"If your application can't run correctly, don't blame the operating system."
three
The Ninja Master participated in a computer show.
Many companies have escorted all the latest, maximum hardware they can search.
And blonde models in swimsuit.
Ninja even did not look at those exhibitions. On the contrary, he just opened a folding chair and sat quietly in the corner.
. From time to time, someone came from him and asked him one or two questions. He thinks on a moment, then use short words
Answer.
People are sitting around the husband's legs - those collected brokers are scattered on one side - quietly
Hold him to speak.
four
The Ninja Master said:
"For smart people, as long as one word; for fast horses, just gently aston; for a well-written program, only
A order to be separate. "
Fives
The Ninja Master participated in a board. When he begins to explain the technical characteristics of the software, those companies
Policeters, some are irritated on the seat, some stare outside the window, some look at the coffee cup.
So, the master began to talk about how much the software would earn, then the administrators have set up
Ears and started to jade in the room, obviously, they were attracted by this pleasant voice.
six
A company executive official came to see Ninja, he found that the master is playing computer games. "What does it mean?"
The executive officer asked.
"I am testing the system." Master said.
The executive official is close to the screen, and it is true.
Seven
One day, the board member concentrated on discussing business, they recalled the Ninja Master, let him report. "
What is your quarter forecast? "They asked.
"There is no quarter forecast." Ninja replied.
"So what about your budget plan this year?" They asked.
"There is no budget plan this year." Ninja replied.
Then they asked: "Can you confirm that you are a ninja master?"
"There is no Ninja master." The Ninja Master replied.
Directors were confused, but they had to suspend the meeting to go home.
Eight
The Ninja Master said:
"Designing a millions of procedures is easy, and it is difficult to change the nature of a person."
nine
Three administine from different computer companies go to the true meaning of leading art to the ninja.
Ninja asked the first executive, "Do you have your company's current institutional setup map?"
The first executor took a piece of paper from the pocket. "I have been with a side." He said with the paper to the Ninja.
Ninja looked at the paper, "This seems to have established templates on the computer."
Statement.
"Others," The executive official said proudly, "We have set up our institutions to computers.
In order to receive a notification, you can choose to call. "
The ninja smiled and handed it back. "I can't help you." He said.
The second executive official will then ask the true meaning of the art of the art.
"Do you have your company now institutional setup?" Asked by the Ninja.
The second executive is shaking, "our institution has not changed in the past few years, I remembered a few years ago.
"
The ninja frowned, "I can't help you." Said.
The third executive official is still asking the true meaning of the art.
"Do you have your company now institutional setup?" Asked by the Ninja.
The third executive is shrugged, "We have no institutional setup," he said, "Everyone likes to do.
What to do, what to do when you like? "
Ninja frightened, "I can't help you." He said.
The three executive officials got a while, turned around and said to the Ninja: "So well, let us see you
Institutional setup. "
The ninja led them to a piece of open, there was a tree in the alone. "This is my institution
Set. "The Ninja is on the side of the hand on the epidemic roughly.
Secondfoot
Master: Whafts
Media: Folk story
Hardware: Display
Direction: South
Software: Formatting Program
Feel: Vision
Stage: Design
Animals: Phoenix
System: CP-6
fire
Programming masters have collected a variety of folk stories about development and thorn. Recent computer archaeological research
Diction, the following folk stories are based on historical facts. Although some exaggerated ingredients may not
It is intended to be added, but the core content of its historical truth still exists.
One
When a project manager is equipped with his software project, he will hire three hundred programmers within a day. One
A scholar who received a doctoral degree in computer science came to work, he was given a high salary.
One day, the project manager was dismissed. "I think everyone should clear their duties and fulfill their own
Duty. "The new project manager says this to his programmer team. I heard this, the school
Say quietly.
two
The two programmers are emergency about the user interface.
"Simple and relaxing in 'use, many significant innovations are being in progress," the first process
The prequatters say, "Soon, people will no longer need to read those lengthy user hands before using the computer.
Book. The program will be self-cleared. "
The second programmer thought for a while, then said: "I am preparing for some wood firewood, but my ax.
It is old and blunt. So I went to the Hardware store to buy new. "
"This is very interesting," said the first programmer, "But what is the relationship with the user interface?"
"This comes with an instruction manual with a length of eight pages." He replied.
three
A third party asked an engineer, a mathematician, a physics and a programmer: "a box
How many faces are there? "
The engineer first replied. "There are four faces in a box." He said.
"How do you say this?" Asked the wise.
"The four vertical faces are what I said, they are connected by one top." The engineer replied.
"Too ridiculous," mathematician commented, "there is six places in a box."
"How do you say this?" Asked the wise.
"The box is a cube, so there are six faces.", Mathematician answered.
"No," physicist said, "There is twelve in a box."
"How do you say this?" Asked the wise. "Strictly speaking, there are six external faces and six internal faces." Physicist answered.
The wise man looked at an unscrupulous programmer. "What about your opinion?" Asked the wise.
"There is only two faces in a box." Said programmer.
After listening to this, engineers, mathematicians and physicists laughed.
"How can this happen - only two faces?" When the laugh stopped, the wise man asked.
"This is based on personal experience." The programmer said, "The 'inside' is the place where the board is placed, and 'outside
'Is the place where the display is placed. "
"Just this." The wise man said.
four
A new Director is holding meeting with programmers.
Among the banquets, a programmer recited the following speech - "We have been looking forward to you.
It comes, your predecessor does not have this noble ability. Now that you are here, we will become truly life.
Production. "
This new director is flattering, "Is this speech writing?" He asked.
"This is the practice of our development center." The programmer said, "No matter which new directors arrive at the time, I
We must publish that speech, this is the only speech that I know. "
Fives
One day, a programmer in the development center found a set of algorithm systems that can generate maze patterns. He is very
Strive to modify this algorithm so that it can generate an uninterrupted on a long print strip.
maze.
Soon, he made a maze with hundreds of thousands of pensions, forty feet long, seven feet wide. He put the paper
With a long aisle of the programmer's office door, there will be, all programmers are squeezed in that.
Before the maze, try to solve this huge problem.
The Director of the Development Center hacked from side by side, he stared at this scene, and his face was gloomy. But when he entered the editor
When the master's office wanted to seek help, the master didn't have there.
six
Five beginners cried into the master's office, "Hey, hey! I heard that our project may be canceled.
. "
Master said: "All things continue as usual until they stop."
After listening to this, those beginners returned to their respective work.
Seven
One day, the development center received the news, a new director will be appointed to be responsible for this, he is a minister of military machines,
There are very few computers.
The programmers heard this news was very surprised, and they stopped programming and wasting many times in trying.
The upcoming misfortune.
Seeing these, a master must do something. So, he borrowed a set of garments in gorilla.
.
Soon, the minister took office, he convened all the managers to a small meeting room, which is coming,
The headquarters of the company's executive officials, it is said that they are to make the development center "smooth transition".
Suddenly, the master went to dress up the gorilla. He shakes the meeting table and kicks the file everywhere.
They are all, and the executive officials are screaming, and the executive officers are sitting there. then,
He left the meeting room, just as he came.
When I heard this, the programmer returned to their respective jobs.
The author has talked with a few people, and they all witnessed the incidents depicted in this legend. The author also heard that
One year later, similar provocation happened in a certain sector of IBM. The second event is not the first
The same is that the programmer worn a sportswear and coughed loudly at the door.
Eight
A group of programmers are reporting to the chairman. "What is the biggest result this year?" Asked the chairman.
Those programmers discused for a while, then replied: "Our bugs in this year (program error - translation) are 50% over last year."
The chairman looked at them in confusion, it was clear, he didn't know what bugs mean. He is small with the big
After a while, turned over to the programmer, he was full of red. "Such a bad quality control, you
They should be worried. No 'bug' is not allowed next year! He ordered.
It can be sure that the second year of the programmers reported to the chairman, and the BUG is only not mentioned.
nine
A company executive came to visit the development center. He walked in the long corridor, just like an examiner will
Like the army. He talked about talking to the people he encountered from time to time. Finally, he walked into a programmer's office.
Room, this programmer is looking for an operating system in the aging.
The executive officer looked at the office and noted the statue of the pigs posing on the terminal of the programmer. "I am often used
The ambitions and souvenirs collected by programmers are deeply attracted, "said the executive officials," It seems that behind them.
Some very interesting stories. For example, what is the statue there? He pointed to the statue.
The programmer lifted his head from the terminal, blinked, stared at the statue, as if it was a first time I saw it.
Like. "This is a head!" He said.