{"id":4961,"date":"2025-07-03T19:55:25","date_gmt":"2025-07-03T19:55:25","guid":{"rendered":"https:\/\/research.swissdigitization.ch\/?p=4961"},"modified":"2025-07-03T19:55:25","modified_gmt":"2025-07-03T19:55:25","slug":"how-did-people-use-ed-unix-line-editor","status":"publish","type":"post","link":"https:\/\/research.swissdigitization.ch\/?p=4961","title":{"rendered":"How did people use ed? (Unix Line editor )"},"content":{"rendered":"\n<p><a href=\"https:\/\/retrocomputing.stackexchange.com\/questions\/5341\/how-did-people-use-ed\">https:\/\/retrocomputing.stackexchange.com\/questions\/5341\/how-did-people-use-ed<\/a><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>It&#8217;s a line editor (meaning, you can&#8217;t see all the text at a time. You query line numbers and it spits it back, but it came before vi, where you can use&nbsp;<code>hjkl<\/code>&nbsp;to navigate up and down the screen).<\/p>\n\n\n\n<p>How was it used? I find it hard to believe that people memorized their code well enough that they could remember what was going on in line 5 when working on line 20?<\/p>\n<\/blockquote>\n\n\n\n<p>Using a line-based editor isn&#8217;t that hard.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For one,\u00a0<strong>yes, real programmers<\/strong>\u00a0(as we all were back then)\u00a0<strong>do remember their lines.<\/strong>(*1)<\/li>\n\n\n\n<li>Next, when on a\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Teleprinter\">writing terminal<\/a>, one lists the working on section once, so all you need to do to take a look is pull the paper.<\/li>\n\n\n\n<li>On a dump terminal one could just issue a list (print) command for the actual range, or\u00a0<code>,p<\/code>\u00a0for all, as often as needed.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Did people write code on a paper and then type it in (sort of like in the punch-card days), editing the paper and then modifying code through ed?<\/p>\n<\/blockquote>\n\n\n\n<!--more-->\n\n\n\n<p>Yes and no. Before writing a program one sits down and draws a rough structure. Something I&#8217;d assume everyone still does today.&nbsp;<em>How else do you get a first glimpse if your idea for a structure is valid?<\/em>&nbsp;After that,&nbsp;<code>ed<\/code>&nbsp;(or similar editors on mainframes) is all a programmer needs. A program grows in your head; the screen is just to dump the result, isn&#8217;t it?<\/p>\n\n\n\n<p>Also, assembling\/compiling did usually produce a listing which could be used to go thru on paper (if printed out), add remarks and new lines before hacking them in again. And no, you didn&#8217;t compile every few seconds and remove just the top warning\/error. One worked thru the whole error list before compiling again.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Programs weren&#8217;t too long in the 70s. There just wasn&#8217;t enough RAM for them. But even a short 20 line program is still too complicated to fully keep in my brain, line by line.<\/p>\n<\/blockquote>\n\n\n\n<p>How are you able to understand your own program if you can&#8217;t visualize it in the first place? (I&#8217;m serious here: I couldn&#8217;t, and I don&#8217;t know how it would work otherwise.)<\/p>\n\n\n\n<p>And again, in all seriousness, I worked with line editors over years and on programs with more than 200 lines. In fact,&nbsp;<code>ed<\/code>&nbsp;already has more features than are absolutely necessary, as&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Edlin\"><code>edlin<\/code><\/a>&nbsp;has everything you really need to program.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>*1 &#8211; I can&#8217;t stop myself from adding a &#8218;little&#8216; story about&nbsp;<em>how real programmers remember their code<\/em>&nbsp;here:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>From Grandpa&#8217;s Vault:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Real Programmers Remember Code<\/h2>\n\n\n\n<p>In the mid &#8217;80s (~1985) I was working mostly for a somewhat large, \/370 based, mainframe application. At that time the software consisted of about 1.1 million lines of hand written assembly (~1.2M including secondary programs,&nbsp;<code>Only<\/code>&nbsp;statements, excluding empty lines, etc.). It had its own database engine (*2), screen handling (more than 800 different screen layouts), own editor (*3), own networking stack, own runtime and so on. A typical installation had, at this point about 100-300 full-time users.<\/p>\n\n\n\n<p>The project had been around since the early 1970s. We worked on a policy of&nbsp;<em>no-wrappers,<\/em>which means only modules were used which we did understand and if necessary were modified to fit the system, and redoing the whole code base every 4-6 years, to avoid ageing code. After all, in a real world application requirements change all the time and so does code. It&#8217;s a matter of style to avoid rucksack solutions. Nonetheless, &#8218;lint&#8216; accumulates over the years and a start over was done every 4-6 years.<\/p>\n\n\n\n<p>At that time we also had scored a new contract with a very promising customer(*4), so a lot of changing and adaptations were needed to incorporate the functionality of two other large scale systems and put them out of business. So a perfect time for a 100% redesign. We were a core team of 4 programmers. Unlike previous times we didn&#8217;t have a relaxed schedule, but had to implement everything until an already agreed roll-out date, set less than 3 years away. Not cool. We still had (wanted and needed) to go ahead with a total redesign, so management (*5) did assign 14 additional men and we were moved into something like a designer and lead programmer role.<\/p>\n\n\n\n<p>Of course, these were all &#8217;super specialists&#8216; and way better than anything we were &#8230; the usual game. And as so often they came up with the same questions, why not use a high level language(*6), a standard DBS and so on. The usual crap. Seriously, with an application of that size, writing such components is just a minor add on. Eventually needing less code than using a standard interface requires &#8211; not to mention being faster because being tailored exactly to our needs.<\/p>\n\n\n\n<p>Anyway, let&#8217;s go for the story. One of these &#8217;specialists&#8216;, lets call him Mr. W., claimed that no one can oversee such a large codebase, not even partially. Heck, no one can even remember all code written by himself in 5 or more years.&nbsp;<em>Ha!<\/em>&nbsp;<em><strong>That was a claim that I couldn&#8217;t let stand uncontested, so one word yielded the next. Bottom line: we agreed for a bet, one beer, that I will be able (he said not able) to identify source name when presented a 10 line snippet, from random programs I did within the existing codebase.<\/strong><\/em>&nbsp;We agreed on 10 examples. Date was set the next morning.<\/p>\n\n\n\n<p>Morning came, I didn&#8217;t prepare nothing, but he came up with a stack of paper and a case of beer. I guess his intention was to show how much I didn&#8217;t gain by presenting every fail with a bottle. Also, he was so generous as to make the snippets a whole page each. I didn&#8217;t really need that. I named not only each routine he handed me, but also which module it belonged to, what&#8217;s the purpose, some workings, why variables are named the way they are, some caller or what was to be found on the pages before or after. Further, I also named the original programer (*7), as he inserted a few pages from programs I didn&#8217;t write and identified a piece of code that was no longer used, told why and what has replaced it &#8211; he pulled it form a&nbsp;<em>very<\/em>&nbsp;old version :))<\/p>\n\n\n\n<p>The whole case of beer, bottle by bottle, changed sides :))<\/p>\n\n\n\n<p>The same time Mr. W. became more and more quiet. Needless to say that there was no further argument about readability of code or the ability to handle a large code base. Sure, there was still the database fight, but that&#8217;s a different story.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/retrocomputing.stackexchange.com\/questions\/5341\/how-did-people-use-ed It&#8217;s a line editor (meaning, you can&#8217;t see all the text at a time. You query line numbers and it spits it back, but it came before vi, where you can use&nbsp;hjkl&nbsp;to navigate up and down the screen). How was it used? I find it hard to believe that people memorized their code well [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4961","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=\/wp\/v2\/posts\/4961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4961"}],"version-history":[{"count":1,"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=\/wp\/v2\/posts\/4961\/revisions"}],"predecessor-version":[{"id":4962,"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=\/wp\/v2\/posts\/4961\/revisions\/4962"}],"wp:attachment":[{"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/research.swissdigitization.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}