[clug] Why do we do what we do in Linux? [was Re: Text editor]

steve jenkin sjenkin at canb.auug.org.au
Sat Oct 25 18:26:08 MDT 2014

On 25 Oct 2014, at 11:37 pm, Bryan Kilgallin <bryan at netspeed.com.au> wrote:

> I have been learning Vim via vimtutor. As recommended by Rute.
> Why in the 21st century, use a text-based editor? This reminds me of using CP/M decades ago on a minicomputer. Is it an exercise in industrial archaeology, like learning to make cast-iron railway lines?
> -- 
> www.netspeed.com.au/bryan/


This is a _great_ question, thanks for asking it.
It questions the Unix/Linux proposition & mindset from a fresh and unencumbered perspective.

I think there’s a more useful phrasing of this question, slightly anticipated by one reply already, that might answer what I perceive to be your underlying question:
  why should I invest time & effort in learning awful, seemingly obsolete, command-line tools, especially editors?

 - What editor, tools and development or admin environment do people use?
 - Why these, not others?

I _believe_ that both Tridge and Linus, arguably amongst the best Open Source developers around, both use a variant of ‘emacs’, which I wouldn’t recommend jumping into without a couple of close friends to guide you. [not ‘trolling’ here, just my personal experience. feel free to share your own journey]
[anyone confirm?]

These are very intelligent, highly competent professionals who are constantly improving their work practices and tools & aren’t afraid to change everything they use. Both are known to constantly question, modify and improve their tools and, when necessary, to invent whole new things (like ‘git’).

They’d be using other tools if it improved their ‘productivity’ or other essential aspects of their work.

So what do the best-of-the-best get from a “command line editor”, that they don’t get elsewhere? If anyone knows, I’m interested to hear.
[In practice, modern variants of ‘emacs’ aren’t just command-line, but whole environments that use windowing tools & concepts efficiently.]

steve jenkin


Why “text files?"

One of the radical design features of Unix was “Everything is a file” & files were just a “stream of bytes”.
From that “text files” arose, with the structure of a text file being “ASCII separated by newlines”. [A _convention_ not enforced.]
“Pipelines” and “filters” are how standard tools are bound together to perform useful tasks, prototyping, testing and even production scripts.
This only works because all the tools read and write a common format: unstructured text-file.

At the time, this was a radical change: files were usually “fixed-length records”, highly structured, often binary and manipulated only by a few purpose-built tools. Even sorting files was complex. Think of it as a binary dump to disk of an internal data structure.

Editing and viewing text is more important on Unix/Linux systems than on any other, because of this underlying architectural convention.

The ‘structure’ of a text file:
A ‘newline’ is a single linefeed (“\n” or ctrl-J).
Mac’s used a single carriage-return (“\r” or ctrl-M).
DOS/Winders use two chars, carriage-return+linefeed (“\r\n” or Ctrl-M Ctrl-J).

“Everything is a file"

Unix Filters and Pipelines


Useful Links:

Unix Philosophy
 - important enough that Ken & Dennis won multiple high awards for it. Others from their Lab also ‘highly decorated’.
 <http://en.wikipedia.org/wiki/Unix_philosophy> [IMHO, ESR’s rules belong elsewhere]

The Kernighan & Plauger book, “Software Tools”, was a critical part of this thinking, spawning a whole movement and awards.

Dennis’ page with a short history of “Dept 1127” at Bell Labs

Here’s a place to start unpicking the thread of the Labs' work and contributions.

Warren Toomey of The Unix Heritage Society has this short page. Haven’t checked the links still work (Internet archive is your friend)

"the unix oral history project” is an interesting read, but page is not opening today for me

Steve Jenkin, IT Systems and Design 
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA

mailto:sjenkin at canb.auug.org.au http://members.tip.net.au/~sjenkin

More information about the linux mailing list