3 ms·
Yeah, I think that the newspaper example obscured her larger point that converting machine-readable data into human-readable data and then using text parsing is
by jt2190 7y ago
Yeah, I think that the newspaper example obscured her larger point that converting machine-readable data into human-readable data and then using text parsing is both error-prone and unnecessary compared to just using tools that work directly with the machine-readable data.
Edit: The meat of the article:
> This gets into a whole thing I call "scripter mentality". It seems like some people would rather call (say) tcpdump and parse the results instead of writing their own little program which uses libpcap. Calling tcpdump means you have to do the pipe, fork, dup2, exec, parse thing. Using libpcap means you just have to deal with a stream of data arriving that you'd have to chew on anyway.
Edit 2: “Scripter” here refers to operating on text files. The Rule of Composition [1] encourages the use of text processing, for example:
> Text streams are to Unix tools as messages are to objects in an object-oriented setting. The simplicity of the text-stream interface enforces the encapsulation of the tools. More elaborate forms of inter-process communication, such as remote procedure calls, show a tendency to involve programs with each others' internals too much.
[1] The Art of Unix Programming: http://www.catb.org/~esr/writings/taoup/html/ch01s06.html#id2877684 http://www.catb.org/~esr/writings/taoup/html/ch01s06.html#id...