当前位置:网站首页>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
边栏推荐
猜你喜欢

The K neighbors of each sample are obtained by packet switching

nn. Explanation of module class

Data visualization: use Excel to make radar chart

NPM reports an error: operation not allowed, MKDIR 'C: \ program files \ node JS \ node_ cache _ cacache’

Correct method of calculating inference time of neural network

DJ music management software pioneer DJ rekordbox

Redis Desktop Manager for Mac

Using JS to realize a thousandth bit

Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice

机器学习(六)——贝叶斯分类器
随机推荐
112. Path sum
Experimental report on analysis of overflow vulnerability of assembly language and reverse engineering stack
LeetCode_ DFS_ Medium_ 1254. Count the number of closed islands
Unfortunately, I broke the leader's confidential documents and spit blood to share the code skills of backup files
ATSS(CVPR2020)
MYCAT configuration
[indexof] [lastIndexOf] [split] [substring] usage details
Two ways for flutter providers to share data
Installation of data cleaning ETL tool kettle
【SQL server速成之路】数据库的视图和游标
Number of islands
Wechat applet catchtap = "todetail" event problem
Kettle experiment (III)
机器学习(六)——贝叶斯分类器
《數字電子技術基礎》3.1 門電路概述、3.2 半導體二極管門電路
Node installation
Detailed explanation of delete, truncate and drop principles in MySQL database
2021 Li Hongyi's adaptive learning rate of machine learning
小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
node安装