当前位置:网站首页>GUI, CLI and UNIX Philosophy
GUI, CLI and UNIX Philosophy
2022-04-23 09:19:00 【dog250】
Unix Philosophy advocates combining multiple small programs that do only one thing . What are the benefits ?
Independent high cohesion programs can be coupled into more possibilities , Only through input and output coupling is the lowest coupling , This is Unix/Linux The foundation of Philosophy .
Whether it's GUI Or multi parameter CLI, It is not convenient for multi program cooperation .UI It's for people, not for programs .
You might as well compare GUI And multiple parameters CLI.
GUI The operation interface is a two-dimensional screen control , It's easy for the human eye to recognize controls , And know the purpose of the control , For example, one that says “ determine ” perhaps “ Cancel ” The button , perhaps “ View ” Under the menu “ Zoom in ”.
If you want to GUI Programs work together , Then the program should not only understand the control description and find its location , Also understand the classification of controls , Whether it's a button , Or the menu , all GUI Controls must be positioned in both dimensions , It is impossible for the program to understand this positioning . It's hard even for people , I just finished an article for my daughter Word draft , It's hard to find out how to adjust the margins . Hard to return , But as long as it takes time , You can always “ find ” Control , Because self describing GUI Control “ Somewhere ”.
The problem of control positioning is CLI It's much better ,CLI The command line is just one line , One line is one dimension , One dimensional command lines do not need to be positioned ,append Add parameters , But the parameters and their functions must be known in advance , If you don't know the meaning of the parameter in advance , You can never “ find ” it ,CLI Parameters are not self describing , In you append Before it , It's not anywhere . This means that for CLI,help or manual It's very important , No, help or manual,CLI Can't use .
GUI Since the description , Locate the control to be operated by finding it on the two-dimensional screen . Unskilled people can also find controls and operate them through self description , Skilled people still can't save two-dimensional positioning operation , The batch , Shortcut keys can't go anywhere .
CLI Non self description , One dimensional command lines do not need to be positioned ,append Parameters can be . The first use must check help or manual, Otherwise it won't work , Once proficient, you can script , comparison GUI The operation will be very fast .
That's all GUI and CLI Differences in . But no matter GUI still CLI, It's hard to expect programs to understand each other . about GUI, Tricks like mouse sprites have never been popular , And for CLI, Write a program to receive all the output of another program and understand its different meanings , Will make things extremely complicated .
The only thing that allows programs to collaborate in an easy way is to keep each program's separate input and output .
such as :
cat /opt/abc |grep '\<[0-9][0-9][0-9]\>'|uniq|sort
although iptables It's easy to stop a malicious IP Data packets of , But the premise is that someone needs to type out the whole order , It's hard to have a program that can output IP Address , Protocol port, etc match, The program outputs these parameters separately , It's hard to connect between procedures , There is only one root cause ,iptables Multiple parameters with meanings are required .
Human beings are intelligent , It's very inefficient to do things in a binary combination , People can recognize with their eyes GUI Control and manipulate it , People can also understand CLI Parameters and append it , But the program doesn't work , The program cannot find GUI Control and understand it , I can't understand CLI Parameters . If there are only programs in the world , Then the stupidest and most reasonable program can only converge to do one thing , Carry a clear input and output to do it , It becomes the of this program “ nucleus ”, This is it. Unix philosophy ,Unix Born for collaboration between programs .
Thought again GUI and CLI, I think it's interesting , I can't sleep , Write a composition .
Zhejiang Wenzhou leather shoes wet , It's not fat when it's raining .
版权声明
本文为[dog250]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230632463208.html
边栏推荐
- Go language self-study series | golang nested structure
- MySQL小练习(仅适合初学者,非初学者勿进)
- Open services in the bottom bar of idea
- 小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
- How to read excel table to database
- Technological innovation in government affairs in the construction of Digital Government
- Machine learning (VI) -- Bayesian classifier
- 《数字电子技术基础》3.1 门电路概述、3.2 半导体二极管门电路
- 搞不懂时间、时间戳、时区,快来看这篇
- Installation of data cleaning ETL tool kettle
猜你喜欢
資源打包關系依賴樹
A must see wechat applet development guide 1 - basic knowledge
Number of islands
Data visualization: use Excel to make radar chart
Introduction to matlab
Production practice elk
Valgrind et kcachegrind utilisent l'analyse d'exécution
npm ERR! network
kettle庖丁解牛第14篇之JSON输入
Valgrind and kcache grind use run analysis
随机推荐
JS prototype chain
How does kubernetes use harbor to pull private images
Unfortunately, I broke the leader's confidential documents and spit blood to share the code skills of backup files
valgrind和kcachegrind使用運行分析
LeetCode_ DFS_ Medium_ 1254. Count the number of closed islands
Node installation
Production practice elk
The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution
Employee probation application (Luzhou Laojiao)
EmuElec 编译总结
《信息系统项目管理师总结》第八章 项目干系人管理
Is Zhongyan futures safe and reliable?
ALV tree (ll LR RL RR) insert delete
Matlab draw five-star red flag
Two ways for flutter providers to share data
Go language self-study series | golang structure as function parameter
Colorui solves the problem of blocking content in bottom navigation
数字政府建设中政务中台中的技术创新点
ATSS(CVPR2020)
npm ERR! network