Live data from Hacker News

Ed is the standard text editor (2014)

wiki.c2.com

21–30 of 125 posts

Re: Ed is the standard text editor (2014)

#21
post #18

There's no reason to use ed. It's a historical novelty at this point. Move on.

"oh no i reinstalled the os on my vps and now ssh has it on good authority (said authority is line 68) that someone is doing something nasty" ed .ssh/config 68d wq done, didnt fill my terminal with vim or emacs, didnt tab over to my gui editor then back again also it's a nicely "semantic"/compact/comprehensible way of expressing patches in things like portfiles or nix expressions: postPatch = '' ed Makefile etc etc s…

Now that Visual Studio Code has remote edit, you can do all that in a nice, modern way :)

Re: Ed is the standard text editor (2014)

#22

Not a "viitor". Not a "emacsitor". Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!! TEXT EDITOR.

Exactly. I assumed this would be a link to the glorious document https://www.gnu.org/fun/jokes/ed-msg.html I love reading C2, but anything in reference to ed(1) besides "Ed, man! !man ed" is wasting my VALUABLE time. :-)

It's reproduced verbatim lower down in the page.

Re: Ed is the standard text editor (2014)

#23
I have written several scripts -- some throwaway, some not -- that use ed. If you know what you need to do to edit a file and need it automated, ed is just super handy. Here is a shell script that deletes all comments from a yaml file, then comments out a particular key:

    ed $file 

Re: Ed is the standard text editor (2014)

#24
post #4

People make fun of ed, but the command line is basically ed with the ability to execute.

This enlightens me as to how people can code with ed (and why Ken Thompson famously said 'I don't want to see the state of the file when I'm editing.'). It's basically a REPL for writing code. Same as psql, the commands you use to view the state of the text (database) are different from the commands you use to edit the state of the text (database).

Still sucks though. Even in psql I regularly drop into vim with \e to edit whole queries before sending them out.

Re: Ed is the standard text editor (2014)

#25
For some reason it took me years to understand the need for a line editor. It didn't make any sense in my head. Then one day I saw the famous picture of Bill and Allen as kids in front of a teletype [1] and it finally clicked.

The way it worked was like this: As you keyed in your program, letter by letter, it was printed out on the paper immediately like a typewriter. If you ran the program and there was a problem, you'd just read (or re-read) the printout, find the line with the bug, then use a line editor to fix just that line. You might mark the paper with pencil to keep track of the change. After a while if you needed to see the latest version, you'd just print the whole program out, or just the lines you needed.

This realization finally clued me into what was going on when I was 10yo and programming BASIC on a TRS-80 Color Computer. It was essentially simulating a teletype (which makes sense given BASIC's inception at Dartmouth [2]), where you would type each line individually, then if there was a problem, you would edit the program individual lines at a time. I always thought it was an odd until I understood how actually using a teletype actually worked. Also explains why the command to write letters to the screen is called "PRINT".

1. https://www.gatesnotes.com/About-Bill-Gates/Early-Days-as-a-...

2. https://youtu.be/WYPNjSoDrqw

Re: Ed is the standard text editor (2014)

#27
Perhaps it's better to see for a minute how people used this kind of editors when they first appeared, than to keep reading about them for ages: https://youtu.be/b6URa-PTqfA?t=100 (BBC from '79, mentioning how people start working from home with the aid of newfangled microcomputers and network connectivity).

I'm reminded most of all of the fdisk util, where the workflow is pretty much the same: print, modify, print, save. But also I can see where Vi/Vim come from, as I regularly do the same thing as in the vid: %s/something/something else/g and then wq.

Re: Ed is the standard text editor (2014)

#29
post #27

Perhaps it's better to see for a minute how people used this kind of editors when they first appeared, than to keep reading about them for ages: https://youtu.be/b6URa-PTqfA?t=100 (BBC from '79, mentioning how people start working from home with the aid of newfangled microcomputers and network connectivity). I'm reminded most of all of the fdisk util, where the workflow is pretty much the same: print, modify, print,…

I am sure anyone who worked with gdb without GUI/"dual" mode is aware of this experience.

Re: Ed is the standard text editor (2014)

#30
post #18

There's no reason to use ed. It's a historical novelty at this point. Move on.

"oh no i reinstalled the os on my vps and now ssh has it on good authority (said authority is line 68) that someone is doing something nasty" ed .ssh/config 68d wq done, didnt fill my terminal with vim or emacs, didnt tab over to my gui editor then back again also it's a nicely "semantic"/compact/comprehensible way of expressing patches in things like portfiles or nix expressions: postPatch = '' ed Makefile etc etc s…

> ed .ssh/config

I think this is my ed use-case as well. I've noticed I need to "apt-get install ed" sometimes. The standard editor is not always standard, it seems.

Post reply on HN