The ed Editor

If you’re a Vim or Emacs user, you’ve seen a lot of jokes like this one from XKCD:

real_programmers.png

They usually end the chain with cat but sometimes, like the above, they go all the way to butterflies.

All that’s good fun if a bit whimsical, but you sometimes see serious assertions that “real programmers” use ed. If you’ve never used ed, as most of today’s programmers probably haven’t, it’s no doubt hard to understand how silly that argument is. If you’re working on a teletype, ed is just the thing. If not, it’s just masochism.

Or so I thought. Others disagree:

Dominic van der Zypen makes the case that ed is great for everyday use. I’m not convinced but you can read it and judge for yourself. I will say, though, that just because a lot of Unix development was done with ed doesn’t mean much because that development was also done on, you know, teletypes. It’s like saying that just because Sun Tzu fought with swords, today’s armies should use them too.

Regardless, it’s fun, if a bit surprising, to see someone champion ed for everyday use. If you’re running on some sort of Unix/Linux system, including macOS, you’ve almost certainly got ed installed so fire it up and see what you think.

This entry was posted in General and tagged . Bookmark the permalink.
  • Perry Metzger

    The last programmer I knew who used ed every day worked with me in the late 1980s.

    I never learned ed myself, but it turns out I know it. Around 1994, I found myself needing to debug a machine being installed that had crapped out. The only editor on the install floppy set was ed, and I had nothing around with working man pages as the machine wasn't yet installed.

    Having used vi (including) in open mode, sed, perl and other tools for years, I guessed what the command to do the edits would be. Every guess I made was right. It was creepy how much ed's DNA had filtered into subsequent tools, and how much one could guess about the common ancestor based on that. It felt like reconstructing proto-Indo-European from the examples of all the languages that descended from it, only a much easier job.

  • Beobachter

    I disagree with the perception that Windows people don't care about minimality. If there was a native ed for Windows, I'd use it. ed replaced vi on my servers though and I don't miss a thing. Goodbye, waste of space.

    • Perry Metzger

      The MinGW ed isn't good enough for you?

      • Beobachter

        Non-native solutions are not really solutions.

        • Perry Metzger

          What's non-native about it? It's compiled C code linked against the native libraries. I didn't say cygwin.

          • Beobachter

            I just downloaded the current win-builds package to check if I was wrong. Well, there is no option for installing "ed", it is probably a part of a larger other package (sadly, nobody says which one).

            What do I have to install to get an ed.exe without any other non-native dependency?

          • Perry Metzger

            The packages in MinGW don't have dependencies on third party libraries.

          • Beobachter

            There is no "ed" package in MinGW (tried the mingw64 build as described), hence my question.

        • jcs

          What does "non-native" mean? Third Party? Not bundled? I'm in the position of not having used a Windows systems for some years so I can't speak with any authority about the current state of affairs but last I knew, not even the C compiler "came with the system." If by "non-native" you mean "doesn't come with the system," I fail to see how that makes it any less of a solution.

          MinGW is free (in both senses) software so there's no obstacle to simply installing it if you want to use ed. Or am I misunderstanding you?

          • Beobachter

            "Non-native" = artificially tied to an emulation layer that simulates a POSIX environment (e.g. cygwin1.dll) and/or demanding POSIX file paths instead of native ones.

            I have been using Windows for 21 years, the current state of affairs is still the same; but at least the .NET stuff is preinstalled. But my point is not that it "does not come with the system". Windows is not really known for its great default set of applications. Notepad is the standard Windows text editor because people can use it. Well, well.

            I don't care about "it does not cost money" nor about "I can see its sources" when it comes to software that makes my life easier. But I'd actually prefer a Windows version that knows Windows's different environment. If I wouldn't, "GNU ed for Windows" would probably be "good enough". (It's not.)

          • Perry Metzger

            MinGW doesn't have an emulation layer. I believe I already indicated that above. It uses the native Microsoft DLLs only.

            I do not use it, so I cannot tell you which part of it has "ed" in it.

          • Perry Metzger

            Anyway, I've become rapidly disinclined to spend more time on this.

  • grimnebulin2

    As a freshman in college ca. 1991, I achieved level 20 on the local LPMUD and earned the right to create new dungeon objects using LPC. The only editor supported on the server was ed, so that's what I used. I was already familiar with vi, so it wasn't too hard.

    My roommate, who achieved wizardhood about the same time as me, came up with a scheme to transfer his LPC files to his local machine, edit them there, and then re-upload them, a scheme that I found needlessly baroque.

  • Eric S Fraga

    I started with ed, many many years ago now. The nice thing about knowing ed and being comfortable with it is that it makes it very easy to use sed for scripts.