Using ed, the standard UNIX editor

Some time ago I wrote about the sam text editor, a UNIX text editor that incorporates many features that are cherished by UNIX users, such as regular expressions and programmability. It turns out that many of these features were already present on the standard UNIX editor: ed. For many, it seems crazy that one might…

What is the right way to handle exceptions?

There are several ways to handle exceptions in a program. An exception, that is, a condition from which the program cannot recover locally, can be handled by checking the result of function, or using a try/catch mechanism (which can be simulated in C by a long jump). Between these two extremes of the spectrum, a…