当前位置:网站首页>[philosophy and practice] the way of program design

[philosophy and practice] the way of program design

2022-07-07 20:11:00 Apple II

China's software industry , Influenced by Eastern and Western cultures and thinking .

I was there 【 Rich imagination 】《 West tide 》 And 《 Go to the world series 》_ Apple II blog -CSDN Blog

Invite everyone to share their views . I was there too  【 Philosophy and practice 】 Avenue 、 Law 、 Technique 、 potential 、 device _ Apple II blog -CSDN Blog   Mention the aisle .

We should understand the connotation and essence of program design , Philosophical thinking is needed , Let's have a look today , American programmers Geoffrey James stay 《 The way of programming 》(The Tao of Programming) In this book, how to use the Oriental philosophy system of Tao to think and understand deeply .James Say it yourself , The generation of inspiration and the formation of ideas for writing this book , Thanks to the mysterious feeling after practicing Taijiquan every morning .James In the book , Use stories with novel and strange ideas but profound truth , To discuss the following issues .

  • The first chapter is the quiet space
  • Chapter II Ancient Masters
  • Part III design
  • Part IV code
  • Chapter V maintenance
  • Part VI Management
  • Chapter 7 knowledge in the company
  • Part VIII hardware and software
  • The end of Chapter 9

Today I'll explain some interesting examples . Thank you Guo Hai, the translator of the Chinese version of this book .

picture source :Amazon.com

Details can be referred to  The Tao of Programming

The first chapter is the quiet space

Programming masters say so : “ When you have the ability to take this crystal from me , It's time for you to graduate .”

1.1  In the quiet space , A magical substance is formed and born . It immediately stopped , Wait alone , Nothing , But in eternal motion . It's the source of all programs , I don't know its name , So I'll call it the way of programming .  If this path is perfect , Those operating systems are perfect , If the operating system is perfect , So the compiler is perfect , If the compiler is perfect , So the app is perfect . Customer satisfaction -- Harmony came into being .

The way of programming is gone , And return in the morning wind .

Excellent application design depends on a good foundation of the operating system and compiler , The ultimate goal of program design is to achieve a harmony .

Chapter II Ancient Masters

2.2  Turing, a computer science giant, once dreamed that he was a machine . When he woke up , He exclaimed : “ I don't know -- I dreamt that I was a Turing machine , Or a machine dreaming that it is Turing ?”

2.3  A programmer from a big computer company attended a software seminar . When he came back, he reported to the manager that :“ What are the programmers who work for other companies ? They behaved badly , Regardless of your appearance . Their hair is long and messy , The clothes are wrinkled and old . They broke into our reception group , There was rude noise when I was speaking .”  The manager said :“ I shouldn't have asked you to attend the meeting . Those programmers live outside the material world . They think life is absurd , An unexpected coincidence . They come and go freely . They live only for their program , Live carefree . Why should social customs be used to restrain them ? They live in this way .”

2.4  An auditorium man asked the master :“ There's a programmer , Never conceived 、 Document or test his program , But everyone who knows him thinks he's the best programmer in the world . Why is that ?”  The master replied :“ The man has the way . He doesn't need to conceive in advance , When the system crashes , He won't be unhappy about it , But to accept the whole truth calmly . He also took a break from the need to document programming instructions , I don't care if anyone looks at his code . He doesn't need to test either . Every program of his is perfect . Quiet and elegant , The purpose of the program is also obvious . really , He has entered the magical realm of Tao .”

The image of hackers in movies and TV series is usually long hair , The appearance of the beard with many immortal edges . Speak frankly , There are not many euphemistic words , Because hackers put their energy into program design , It seems to be unreasonable , In fact, he is too focused on his own work . Try to design a perfect program .

Part III design

3.3  Once a programmer was sent to  IBM  Of the military aircraft ministers . The Military Secretary asked the programmer :“ Design a financial package , And designing an operating system , Which is easier ?” “ operating system .” The programmer replied . There was an instant exclamation of distrust in the Minister of war ,“ With a complex operating system , A financial software package is nothing .” He said . “ Is not the case, ,” The programmer said ,“ When designing a financial package , Programmers act as intermediaries between people with different ideas : How does the software have to operate , What form must its report form be , How it has to be consistent with tax laws , wait , An operating system is not limited by its appearance . When designing an operating system , Programmers just need to find the simplest harmony between machine and human thinking . That's why operating systems are easier to design .”  The minister nodded , smiled .“ So it is . But to detect and correct the mistakes , Which is easier ?”  The programmer didn't answer .

Designing applications requires thinking about user experience 、 Business logic and necessary external constraints , And can make full use of computer principles 、 Information processing methods and computational thinking , The process is more complicated , The skills required are also very comprehensive .

Part IV code

Programming masters say so : “ A perfectly written program is its own paradise , And a poorly written program is its own hell .”

4.1  A program should be light 、 agile , Its subroutines are connected like a string of pearls . Its spirit and intention should run through . In the program , It should not be too much , It shouldn't be too little ; There should be no unnecessary circular structure , There should be no redundant variables ; No lack of structure , Not too rigid . A program , No matter how complicated , They should all work in a holistic way . Procedures should be guided by their inherent logic , Not the external form .  If a program fails to meet these requirements , It will be in a state of confusion and confusion . The only way is to rewrite the program .

4.4  A programmer under a project manager is writing software . His fingers are flying on the keyboard , There is no error message during the compilation of the program . The program works like a breeze . “ Great !” The manager cried out happily ,“ Your skill is perfect .” “ Skill ?” The programmer said and turned around from his terminal ,“ I follow the way -- All the skills are far beyond ! When I first started programming , What I see in front of me is a mess of the whole problem . After three years, , I can't see this mess any more . contrary , I use all kinds of subroutines . But now , I can't see anything . My whole body and mind exist in an invisible void , My perception is empty . My spirit moves with its instinct , Not without principle plan can work freely . To make a long story short , It's my program that wrote itself . indeed , Sometimes there are some problems . I saw the problems coming to me , So I slowed down , Watching them in silence . Then I changed a line of code , Those problems will disappear . Then I compile the program . I sit quietly , Let the joy of work spread all over my body . I close my eyes , Take a break , Then exit the system .”  The manager said ,“ I hope all my programmers are so smart !”

Design and develop elegant programs , Need to reduce the complexity of the program , Balance structure and flexibility , Ensure the integrity of the program .

Chapter V maintenance

Programming masters say so : “ Even if a program has only three presidents , One day it will have to be maintained .”

5.1  The hinge of a door that often opens does not need lubricating oil .  A fast river doesn't get dirty .  Neither sound nor thought can spread in a vacuum .  Software will rot if not used .  It's a wonderful world .

Programming masters say so : “ Let more programmers and less managers -- And then productivity will be high .”

The program needs to be used frequently and upgraded according to the specific situation , You also need to optimize the program in use .

Part VI Management

6.1  When the managers meet endlessly , Programmers write games to play ; When financial executives talk about quarterly profits , The development budget will be cut soon ; When senior scientists talk about the blue sky , It's going to be stormy . Actually , This is not the way to program . When managers are devoted to their duties , The game will be put aside ; When treasurers make long-term plans , Harmonious order will soon be restored ; When senior scientists set about the immediate problem , These problems will soon be solved . Actually , That's the way to program .

Program design needs the planning, management and support of enterprise technology management and financial management , To establish an external environment for excellent program design .

Chapter 7 knowledge in the company

7.2  In the East , There is a big fish , Bigger than all the other fish . It became a bird , Its wings are like clouds that fill the sky . When the bird flies over the land , It brings “ Company headquarters ” The news of , Like a dragonfly skimming the water, I left this news among the programmers . Then the bird is driving in the wind , Carrying the blue sky , Back home . The novice programmer stared at the bird in surprise , Because he can't understand ; Mediocre programmers are afraid of the bird , Because he's afraid of the news from the birds ; And the programmer is still working in front of his terminal , Because he didn't know that the bird came and went .

Work in the company , Focus on programming , Don't care about those irrelevant things .

Part VIII hardware and software

Programming masters say so : “ No wind , The grass is still ; No software , Hardware is useless .”

8.4  On the way to Silicon Valley , Hardware meets software . Software theory :“ You are Yin , I am Yang . If we go hand in hand , We   Will be famous in the world , And make a lot of money .” therefore , This pair of yin and Yang will go forward together , Thinking about how to conquer the world . After a while , They ran into firmware (firmware, The combination of hardware and software , Such as  IC  card -- Translation notes ), He is in rags , With a stick with a thorn in his hand , Hobbling along . Firmware says to them :“ Tao exists in Yin 、 Beyond Yang . It's unknown , Serene Waters . It does not seek fame , So no one knows it exists ; It does not seek wealth , Because of its completeness . It exists outside space and time .”  Software and hardware , Feel ashamed , Turn around and go home .

Understand the essence of programming Tao , One day I can experience and skillfully use it .

The end of Chapter 9

Programming masters say so : “ It's time for you to graduate .”

Thinking practice , Practical thinking , One day, I can deeply experience , And teach others .

Designing and developing programs is a skill , I hope we can all reach the highest level ,“ Skill is close to Tao ”.

原网站

版权声明
本文为[Apple II]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071801510573.html