Update
This commit is contained in:
parent
8b530b5952
commit
64fd120266
35 changed files with 2034 additions and 2007 deletions
|
@ -37,7 +37,7 @@ What Is Less Retarded Software/Society/Wiki?
|
|||
|
||||
In the command the pipes (`|`) chain multiple programs together so that the output of one becomes the input of the next. The first command, *[wget](wget.md)*, downloads the [HTML](html.md) content of the webpage and passes it to the second command, *[grep](grep.md)*, which [filters](filter.md) the text and only prints lines with headings (using so called [regular expressions](regex.md)), this is passed to *[sed](sed.md)* that removes the HTML code and the result is passed to *sort* that sorts the lines alphabetically -- as this is the last command, the result is then printed out, but we could also e.g. add ` > output.txt` at the end to save the result into a text file instead. We also use [flags](flag.md) to modify the behavior of the programs, for example `-i` tells *grep* to work in case-insensitive mode, `-q` tells *wget* to be silent and not print things such as download progress. [This whole wiki](lrs_wiki.md) is basically made on top of a few scripts like this (compare e.g. to [MediaWiki](mediawiki.md) software), so you literally see the manifestation of these presented concepts as you're reading this. This kind of "workflow" is a fast, powerful and very flexible way of processing data for anyone who knows the Unix tools. Notice the relative simplicity of each command and how each one works as a **[text](text.md) [filter](filter.md)**; text is a universal communication interface and behaving as a filter makes intercommunication easy and efficient, utilizing the principle of a [pipeline](pipeline.md). A filter simply takes an input stream of data and outputs another stream of data; it ideally works on-the-go (without having to load whole input in order to produce the output), which has numerous advantages, for example requiring only a small amount of memory (which may become significant when we are running many programs at once in the pipeline, imagine e.g. a server with 10000 users, each one running his own commands like this) and decreasing [latency](latency.md) (the next pipe stage may start processing the data before the previous stage finishes). When you're writing a program, such as for example a [compression](compression.md) tool, make it work like this.
|
||||
|
||||
Compare this to the opposing [Windows philosophy](windows_philosophy.md) in which combining programs into collaborating units is not intended, is possibly even purposefully prevented and therefore very difficult, slow and impractical to do -- such programs are designed for manually performing some predefined actions, mostly using [GUI](gui.md), e.g. painting pictures with a mouse, but aren't designed to collaborate with each other or be automatized, they can rarely be used in unintended, inventive ways needed for powerful [hacking](hacking.md). Returning to the example of a compression tool, on Windows such a program would be a large GUI program that requires a user to open up a file dialog, manually select a file to compress, which then might even do nasty things like loading the whole file into memory (because anyone who can afford Windows can also afford a lot of [RAM](ram.md)), perform compression there, and then writing the data back to some other file. Need to use the program on a computer without graphical display? Automatize it to work with other programs? Run it from a script? Run it 10000 at the same time with 10000 other similar programs? Bad luck, Windows philosophy doesn't allow this.
|
||||
Compare this to the opposing [Windows philosophy](windows_philosophy.md) in which combining programs into collaborating units is not intended, is possibly even purposefully prevented and therefore very difficult, slow and impractical to do -- such programs are designed for manually performing some predefined actions, mostly using [GUI](gui.md), e.g. painting pictures with a mouse, but aren't designed to collaborate with each other or be automated, they can rarely be used in unintended, inventive ways needed for powerful [hacking](hacking.md). Returning to the example of a compression tool, on Windows such a program would be a large GUI program that requires a user to open up a file dialog, manually select a file to compress, which then might even do nasty things like loading the whole file into memory (because anyone who can afford Windows can also afford a lot of [RAM](ram.md)), perform compression there, and then writing the data back to some other file. Need to use the program on a computer without graphical display? Automatize it to work with other programs? Run it from a script? Run it 10000 at the same time with 10000 other similar programs? Bad luck, Windows philosophy doesn't allow this.
|
||||
|
||||
**Watch out! Do not misunderstand Unix philosophy.** There are many extremely dangerous cases of misunderstanding Unix philosophy by [modern](modern.md) [wannabe programmers](soydev.md) who can't tell [pseudominimalism](pseudominimalism.md) apart from true [minimalism](minimalism.md). One example is the hilarious myth about "[React](react.md) following Unix philosophy" ([LMAO this](http://img.stanleylieber.com/src/20872/img/small.1527773532.png)), the devs just show so many misunderstandings here -- firstly of course [JavaScript](js.md) itself is extremely [bloated](bloat.md) as it's a language aiming for things like comfort, rapid development, "safety" and beginner friendliness to which it sacrifices performance and elegance, an expert hacker trying to write highly thought through, optimized program is not its target group, therefore nothing based on JavaScript can ever be compatible with the Unix way in the first place. Secondly they seem to imply that basically any system of modules follows Unix philosophy -- that's of course wrong, modularity far predates Unix philosophy, Unix philosophy is more than that, merely having a package system of libraries, each of which focuses on some thing (even very broad one like highly complex [GUI](gui.md)), doesn't mean those tools are simple (both internally and externally), efficient, communicating in good ways and so on.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue