sam(and acme) sounds like an interesting method at first, but when you try it out, its really weird and slow to get stuff done. Its because for me, mouse is really inferior to keyboard to do the majority of the tasks.
This is an except from coders at work:
Seibel: Is there anything you would have done differently about learning to program? Do you have any regrets about the sort of path you took or do you wish you had done anything earlier?
Thompson: Oh, sure, sure. In high school I wish I’d taken typing. I suffer from poor typing yet today, but who knew. I didn’t plan anything or do anything. I have no discipline. I did what I wanted to do next, period, all the time. If I had some foresight or planning or something, there are things, like typing, I would have done when I had the chance. I would have taken some deeper math because certainly I’ve run across things where I have to get help for math. So yeah, there are little things like that. But if I went back and had to do it over I’m sure that I just wouldn’t have it in me to do anything differently. Basically I planned nothing and I just took the next step. And if I had to do it over again, I’d just have taken the next step again.
It would be interesting to know if Ken Thompson is using sam because he is a slow typist and hence doing stuff the sam way (mouse oriented) boosts his productivity or simply because he likes using sam.
I suspect ken spends most of his time thinking rather than typing, and I have found this to be true of most great hackers.
Other famous Sam users include Brian Kernighan, Bjarne Stroustrup(!) and Tom Duff. Kernighan writes at least as much English as code and I wonder how that affects his editor usage patterns, but I suspect that even when writing natural languages most time is best spent thinking (his writing style is very concise and clear, one could say similar to ken's code).
I think the obsession with saving keystrokes is very misguided, I still use editors like vi frequently, and having to think about what magic combination of commands to use to perform a task can be very distracting, is fun and feels good, like a tiny puzzle game built into your editor, but it doesn't help you write better code faster IMHO.
P.S.: Is interesting who has stuck with Sam and who moved to Acme (Dennis Ritchie switched to Acme, and most of the Go team Google besides ken use it too).
See also: http://sam.cat-v.org/
> I suspect ken spends most of his time thinking rather than
> typing, and I have found this to be true of most great
> hackers.
Who cares? Slow input is still not a desirable property in a text editor.You say it sounds like an interesting method at first, but then you try it out and it's weird and slow. How much of a try did you give these editors? In the same way that a new Vim user will basically use the arrow keys, "i", ":w", and ":q" and nothing else, a new user to Sam or Acme can very easily miss a lot of the power.
The Sam language is pretty powerful. For instance, you can use the "X/regexp/ command" form to apply a command over every file whose filename matches the regex, so you can (for instance) make a change to every .c file while leaving README alone. Acme lets you use the same command language, but also lets you execute other arbitrary commands by simply typing them and mid-clicking on them--yes, I know Vi lets you do something similar, but with Acme you'll typically build up a "guide" file, full of convenient commands that you just sweep over with the middle mouse button and release to execute. Acme also presents files in a sort of tiling window manager fashion that makes it one of the most convenient editors I've used. I'll frequently have up to about 50 files open, which in Emacs or Vi would drive me nuts trying to constantly switch around them or split the screen into one or two panels (oh boy, C-x b!). In Acme, I can always see the titles of the individual buffers, and if I need to see into the file I can with a mouse click or two expand the buffer into a convenient size.
I think one change that could really have a big impact is making the ESC key switch back to the command window; this makes things a lot more familiar for Vi-heads, and it makes sense to eliminate a mouse movement for something that simple and frequent.
That ended up a lot longer than I intended, but I wanted to try and share a little bit of my thoughts on Acme and Sam, and encourage others to give them a more thorough try. At this point, I use vi for quick edits, but when I have to write a lot or make a lot of changes, I bring out Acme. When I'm stuck on a strange system that's not my own, I have a tarball of an old version of Sam which, with a little tweaking, has compiled on every version of Unix I've had to use.