当前位置:网站首页>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
边栏推荐
猜你喜欢
Detailed explanation of delete, truncate and drop principles in MySQL database
Principle of synchronized implementation
653. Sum of two IV - input BST
Download and install bashdb
Project upload part
Valgrind et kcachegrind utilisent l'analyse d'exécution
112. Path sum
Common errors of VMware building es8
Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice
NPM reports an error: operation not allowed, MKDIR 'C: \ program files \ node JS \ node_ cache _ cacache’
随机推荐
Write down the post order traversal of the ~ binary tree
数据清洗 ETL 工具Kettle的安装
STM32 and FreeRTOS stack parsing
Kettle实验
RSA encryption and decryption signature verification
How to render web pages
Kettle experiment
Summary of common concepts and problems of linear algebra in postgraduate entrance examination
Multi view depth estimation by fusing single view depth probability with multi view geometry
基于ThinkPHP5版本TRC20-资金归集解决方案
DJ music management software pioneer DJ rekordbox
Kettle experiment (III)
Employee probation application (Luzhou Laojiao)
GoLand debug go use - white record
成功的DevOps Leader 应该清楚的3个挑战
MySQL小练习(仅适合初学者,非初学者勿进)
Non duplicate data values of two MySQL query tables
Data visualization: use Excel to make radar chart
ATSS(CVPR2020)
Chapter VIII project stakeholder management of information system project manager summary