Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From "The Zen of Programming":

------

Hearing a disturbance, the master programmer went into the novice's cubicle.

"Curse these personal computers!" cried the novice in anger, "To make them do anything I must use three or even four editing programs. Sometimes I get so confused that I erase entire files. This is truly intolerable!"

The master programmer stared at the novice. "And what would you do to remedy this state of affairs?" he asked.

The novice thought for a moment. "I will design a new editing program," he said, "a program that will replace all these others."

Suddenly the master struck the novice on the side of his head. It was not a heavy blow, but the novice was nonetheless surprised. "What did you do that for?" exclaimed the novice.

"I have no wish to learn another editing program," said the master.

And suddenly the novice was enlightened.



> Sometimes I get so confused that I erase entire files

OT, but just this week my wife did something that really got me thinking about how far computers haven't come in terms of usability.

I heard her say "O crap" from behind her macbook, and out of habit I came to assist.

For some reason unknown to both of us, she had pasted the text of an email into a document called "thesis.docx", and then saved it.

The text was completely unrelated to "thesis.docx", which of course was not backed up.

Now, I love my wife deeply. And she is no fool. On the contrary, she is a graduate student.

Moreover, I completely understand how something like this can happen. We have two small children, and it was the end of the day. It is just too much to expect of the human mind that one should not say something one doesn't mean.

I felt guilty on behalf of my profession that this was the best we had to offer. Microsoft word on a macbook, and your penultimate version of a file is not backed up. It truly is intolerable.

So, while I have had some of my greatest highs using emacs macros, I somehow feel that the brilliant tooling made by developers for developers never quite percolates into userland.


Sometimes I am boiling a stew, and while I am preparing another dish on the side, for some unknown reason I put the raw eggs on the stew instead of the fry pan.

Pans have been there for centuries, and there is nothing preventing me from throwing stuff in the wrong place, nor undo the eggs in the stew. It's so intolerable, and I feel so ashamed and guilty on behalf of all the pan makers.

Not. We are in a field where we can prevent a lot more stuff to happen than in the real world (and the real world is soooo broken...). We should try our best to make the state of usability and fool-proofness advance as much as we can, and surely there must already be something that would help your wife's case. But we should also be more realistic when voicing expectations.


No, no, no. This is why reasoning by analogy can lead you astray. We have enough control over the world of software that the problem described above should not exist. This control does not exist in the real world, but it does in software.


Do we have enough control over software to make it impossible for someone to delete something and make it unrecoverable when they will later realize they should not have done so?


Not impossible, no. But we absolutely have enough control over software to make it highly improbable for someone to accidentally delete something important and make it unrecoverable.


I don't think he's voicing an expectation so much as lamenting a pervasive and realistically solvable, or at the very least approachable problem.


His problem (or his wife's) is solvable, even right now. She could use time machine, dropbox works as well, using a versionning system would also work, she could switch to an editor that supports infinte undos, dozens of other solutions exist.

But all these require preparation, settings and some care. It could get better, even 'magical', but it would be an achievement that should not be taken for granted.

Btw we could make a pan for stew that checks if you are adding eggs to it, but no one would want the tradeoffs IMO.


> "thesis.docx", which of course was not backed up.

Something I find hard to belive from a woman whose husband is reading hacker news.

'thesis' and 'not backed up' are forbidden to appear in the same sentense by "the Universe(tm)". This law is enforced by _always_ deleting the contents of 'thesis'.


> Microsoft word on a macbook, and your penultimate version of a file is not backed up.

From that sentence, I interpreted it as the latest version of the thesis was not backed up, and that she may have lost several days' work.


Vim persistent undo solves this problem:

http://vimdoc.sourceforge.net/htmldoc/undo.html#undo-persist...

...I'm sure Word will catch up eventually.


Emacs autobackups (which are on by default) would have also helped here.


Exactly, and the fact that previous / older editors (and operating systems) have solved this "problem" supports the Zen Master parable.


Not in this case. If you accidentally `:w! thesis.txt`, persistent undo isn't going to help you.


Clipboard manager. Set to record X selections too. That does it for me. Every bit of text I select is copied to clipboard, just below the value currently held there. In this case I'd have the full content of the docx file as a second item in my clipboard manager list with an email as a first one. I set the size of the clipboard items list to 500, just in case.

I couldn't live without some kind of clipboard manager. It was Ditto on Windows and klipper now on Linux. Dunno about Mac OS, but I bet there is something with similar functionality. It adds another layer of protection to Ctrl-Z everywhere and undo-tree-mode in Emacs. As a programmer I deal with text all the time and I need to be able to recover as much as possible if I make a mistake and this (clipboard manager + undo-tree + version control + normal undo) is the most robust system I could find.


Re: OS X clipboard/pasteboard manager.

I've used ClipMenu [1] for years after using Jumpcut [2] as far back as 2003.

[1: http://www.clipmenu.com ] [2: http://jumpcut.sourceforge.net ]


I actually have some scripts which take textual snapshots of all my open non-idle terminal windows every 10 seconds.

This has saved my butt a number of times.


For this purpose I set very large history in tmux and I almost never use terminal outside tmux anyway. The panes and windows in my tmux are very long-lived, but when I decide to close one I need to go through it's history and manually extract interesting/important bits. It's annoying and automating this would be really nice though.


Seems to me that a clipboard manager as a solution is indicative of how this type of a problem comes up in the first place...


Works for me. Across multiple vim sessions. Unless, you mean a new file thesis.txt, in which case the old file is untouched.


Time Machine is perhaps the most elegant, least intrusive backup software ever. And it's free with OS X. I can't recommend it highly enough, especially for someone in your wife's position.


To belabor the obvious: Time Machine saves old versions for you even if you don't have a separate backup disk, subject to available disk space.


I literally just discovered this when using a terminal and navigating to /Volumes and seeing the /Volumes/MobileBackup.

Hopefully I never have to use it, but pretty cool none the less.


VMS file versions solved that problem in the late 70ies. We are not learning anything from out history as a profession.


I'm a loyal unix guy but as a millenial without much actual hands-on experience with VMS I always love to hear anecdotes like that :) The first time I read about it was in Clifford Stoll's Cuckoo's Egg where it seemed as if there was constant competition between UNIX/VMS folks over which was the more sophisticated/elegant operating system - mostly good hearted competition of a more civilized age of course ;) I vividly remember the one encounter I had with it's weird shell where I had to re-configure an application running on an Alpha machine which had a consecutive uptime of something like 12 years...

One of humanity's biggest enemies to progress are "Not invented here" and the cult of youth. It's often better to start with a blank slate ("being ignorant") because amongst other things like simply having a different perspective (worth 100 IQ points ~Alan Key) it helps with actually starting to build something. Eventually though we should still be aware of what we as a collective have learned already.

To be fair I think Github folks should know their history so this project might be one of the exceptions - looking forward to it! <3


How do you differentiate "the cult of youth" from "it is better to start from a blank slate"?

Side note: Neither of the two issues you mentioned are "one of humanity's biggest enemies to progress."


I guess it boils down to respect - for both sides, young and old. Thanks for the compiler error ;)


being ignorant

"Ignorance is Strength" (1984)


Only in the same sense that public-key cryptography in the 1990s solved the problem of secure electronic communication between two parties. Creating the technology is on big hurdle; getting enough people to adopt it so that it's actually useful is sometimes a bigger hurdle.


I wouldn't say "solved", as it's still pretty easy to accidentally overwrite old versions, but it was a step in the right direction. VMS is full of good ideas that never went anywhere.


Netware too, but that was in the eighties.


I like DragonflyBSD. It versions everything by default. (But no one uses DragonflyBSD of course.)


+1 for VMS.... so good, but so proprietary & doomed to extinction... so unfortunate.


Amen brother. Tragic that we haven't even good back to the 80s


Btrfs and ZFS would have helped, too.


It's not her fault. One should be able to undo file system changes. Bell Labs solved this long ago by storing every file version forever http://en.wikipedia.org/wiki/Fossil_(file_system) Storage is cheap


No, storage is not cheap! It may be if you're only counting files like "thesis.docx" that involves directly the user, but in reality we have a lot of programs that do automatic file operations and that would be nothing but storage trashing not to count the performance handicap.


Sure I'm talking about user generated data. Other bits are just cache or temp, easy to recreate.


"Microsoft word on a macbook, and your penultimate version of a file is not backed up."

Your comments makes me think that neither you nor your wife knew about tracking changes in office documents: http://office.microsoft.com/en-us/word-help/track-changes-wh...

But then considering that the unfortunate loss of data happened after an already lengthy sequence of manual actions, I wouldn't be surprised if the "o crap" would come after a longer sequence that involves disabling whatever should have been prevented the unpleasant events. I'm sorry for the loss, but I don't find my profession responsible more than I would find a car designer/engineer responsible for a car accident caused by driver's deficient attention.


Although really software should be idiot friendly and default to not letting you delete stuff by accident. As an aside I've managed to delete my code more than once in a similar manner in PyScripter which makes me feel rather silly but is quite easily done.


As mentioned time machine is a great feature, but doesn't OS X auto save files you're working on with its versions? You might want to double check that it hasn't got past versions saved.


Except that Microsoft Mac software neither follows OS X conventions (e.g. putting Office system files in the user's doc dir) nor implements many of the important features (e.g. leveraging the automatic file versioning introduced three years ago in OS X Lion).


The current version of Office Mac predates Lion, which is probably why it doesn't use Lion features.


The file revision history is - to the best of my knowledge - an OS X API that applications have to use (opt in). I don't think it comes "for free" with an OS upgrade, unless you mean Time Machine.


How exactly can he check it? As a user of another OS, I'm asking to learn how this feature actually works.


It's easy. Right there in the File menu near the Save command is Revert To, which leads to a submenu with Previous Save and Browse All Versions... options. The latter uses the slick Time Machine UI (http://support.apple.com/kb/ht4753).

Except, per my other comment, Microsoft doesn't bother writing Mac software that works like Mac software. It's kind of like running Java desktop software (actually worse)... neither native feel nor integrated with the OS like other Mac apps.


As you say "Microsoft doesn't bother writing" and his girlfriend uses MS Word on OS X if I understood. Can she then use that feature to recover her work after she had done the "Save" from the MS Word or not?


No, she's probably not going to be able to recover her lost work. What OP and others are trying to point out is that OS X has support for saving revisions to documents if application developers (like Microsoft) would just take advantage of it.


What did you do? Was her whole thesis gone??


I would like to recommend http://crashplan.com. It is set and forget online backup that keeps versions!

Inexpensive and truly unlimited storage. Windows, OSX, and Linux too!


It's a daily backup, so no it doesn't keep versions. Nice try crashplan employee...


I believe the default crashplan setting is 15-minutely. It saved me and my from the described situation many times.


You'd need something like ElephantFS whose presmise was precisely this. Modern file systems still don't protect user's data the way they should.

http://shiftleft.com/mirrors/www.hpl.hp.com/personal/Alistai...

Why even give users control of the data? No, that should rest squarely with the file system and ait should never delete things unless it is running out of space.


Even worse, Mac apps are trending towars the "save as you go" model of Google Docs, which has the one advantage of you don't lose your work if an app crashes but if you started editing the wrong document, or make some changes and then change your mind and want to revert back to the last saved version you are tearing your hair out. The latter happens to me much more often.


Assuming the app has implemented the new saving model correctly, it will also keep a history of every version:

File > Revert To > Browse all versions


Indeed - the OS X model fixes (to some extent) the problem in question, not exacerbates it.


As evident from the comments above, one of OS X's biggest weak points is feature discoverability.

I love how OS X stays out of your way, but most regular users never get to take advantage of greater complexity. You have to be in the mindset of one of 'us' (reading every update to Apple's PR) to get a handle on everything OS X can do.


Hardly, it was well advertised when Lion came out.


Exactly. If you got your first Mac post 10.7 (and you're the average user) you've got no idea you have such a feature.

Maybe you find it one day trolling through the menubar. Maybe you don't.


My 6-year old version of Word 2008 has an option to always make a backup of the previous version when saving, which (unfortunately in this case) is off by default.


I'm using dropbox for document backups. Just edit your files inside your dropbox folder and your documents will be versioned.


Same here. As well as Time Machine. Just in case Dropbox ever breaks.


When I started working on my thesis, I immediately set up my entire document directory for it to be in Dropbox. At the time I paid extra for versioning but now I think it'd built into even the basic model. This also saved my friend when she was in writeup and someone stole her Macbook.


Not sure if this will help regarding change tracking in MS Word...

http://office.microsoft.com/en-us/word-help/track-changes-wh...


Why wasn't she using versions?

http://support.apple.com/kb/PH14378


> It is just too much to expect of the human mind that one should not say something one doesn't mean.

Careful, that is quite a slippery slope...


Cmd z?


She probably had closed the file before the "o crap". Undo does no good there.


Then this really isn't a usability issue, if you replace the entire contents of a document with the clipboard, then click or shortcut to save, then click or shortcut to quit the application, that's really a human issue. It's too many steps to be labelled as a usability problem.

⌘-Z should have been adequate.


> "that's really a human issue ... ⌘-Z should have been adequate."

I hope you don't work in usability.

I've made exactly the mistake described, several times. When making small changes to a bunch of files, it's common to go through the whole open-edit-save-close sequence in a few seconds, and if you've got a few things open and someone's talking to you, it's easy to fuck up.


Whether it's a human issue or a software issue it could still be solved by better software.


> In other words, always blame the software.

> I get it, but the convenience of things like ZFS and Time Machine have a cost. It takes time to implement such things and they take resources. And even then a failure is possible.

You need to weigh the development cost of a feature against the cost to the user of not having it times the number of users. It is usually cheaper to make the software do the tricky stuff than to make your users do it.


In other words, always blame the software.

I get it, but the convenience of things like ZFS and Time Machine have a cost. It takes time to implement such things and they take resources. And even then a failure is possible.

E.g. you decide to do some kind of Garbage Collect on a HD, because you lack disk space and you don't want to buy a disk, but you forgot to backup a file you deleted a month ago.


I'd break it into two categories. There's software that expects you to be an expert.

Then there's software that's designed to allow lay-people to get stuff done with the promise that it will hide the nasty things of the world from them.

Microsoft Word really is the perfect example of this. The main use-case it's built around is being a lovely place for a new user to write and print a small document. It captures users from this simple use-case, and then tries to upsell them to large document and multi-user scenarios with madness like mail-merge wizards and sharepoint.

The promise of Microsoft Word is to bring functionality to users while shielding them from the nasty realities of the world. It's reasonable to be vicious about it when it fails to protect the user from themselves.


If the computer remembered every modification of every document, then users would be protected from incidents like this.


What about when they accidently release private information because the information was at some point in the software. I'd rather a single backup system like time machine than every application reinventing the wheel with all the bugs that entails.


Yes, but in that case we would be talking about yet another privacy issue here.


That's why it should be the file system storing backups, not the document itself.

One should also consider a logarithmic decrease in backups: while I'm writing, a backup of the state a few seconds ago is useful, but I don't need every second from weeks ago. Say the system keeps a backup of every few seconds for the last few minutes, every few minutes for the last few hours, every few hours for the last few days, every few days for the last few weeks, every few weeks for the last few months, every few months for the last few years--the odds are then pretty good that I'd be able to revert to a version I find useful, but not requiring an awful lot of versions.

Back of the envelope: 5 versions/minute for 5 minutes = 25 versions; 4 versions/hour for 8 hours = 24 versions; 3 versions/day for seven days = 21 versions; 4 versions/week for four weeks = 16 versions; 1 version/month for 4 years = 48 versions, so a grand total of 134 previous versions of a document, which really isn't that much space, particularly assuming efficient differencing algorithms.


Dropbox!


Still a privacy issue.


I wrote software to handle this a long time ago never got off the ground www.foldertrack.com


Doesn't Word store old data in the .docx, for things like revision diffs and to make saving quicker? Unless the filesize is really small, there might be a way to extract the previous data... Maybe that was only in the old .doc format, though.


ummm.. if you didn't do it then, i suppose it's already too late, but ctrl-z (i guess that's option-z on a mac?)


"Now, I love my wife deeply. And she is no fool. On the contrary, she is a graduate student."

No offense, to you or your wife, but this statement is hilarious for several reasons!


Could that also be interpreted as:

------

Hearing a disturbance, the master programmer went into the novice's cubicle.

"Curse these search engines!" cried the novice in anger, "To find anything I must scroll through three or even four pages of results.

Sometimes I get so confused that I just give up. This is truly intolerable!"

The master programmer stared at the novice. "And what would you do to remedy this state of affairs?" he asked.

The novice thought for a moment. "I will design a new search engine," he said, "a search engine that will replace all these others."

Suddenly the master struck the novice on the side of his head. It was not a heavy blow, but the novice was nonetheless surprised.

"What did you do that for?" exclaimed the novice.

"I have no wish learn another search engine," said the master.

The novice packed his bags, left and went on to create Google, which gives him exactly the results he's looking for.

While his former master was left sifting through multiple pages of results on (insert other search engine here).

One day the master stumbled upon Google and the master was enlightened.


learning the facets, quirks and customisations of a text editor can't really be likened to the 'pick-up and go' model like a search engine.


Google UI is basically the same as the rest. Can't compare learning a professional tool to that of lay infotainment service.


I think the first assertion is simply untrue, and without it the rest is nonsense. You don't need to learn how to use multiple editors to do anything.

I suppose there are some languages/environments that are somewhat tied to certain editors (java and eclipse, C# and visual studio, objective-C and xcode), but that's not what is proposed here. It's a general purpose programmer's editor that anyone can use for anything. Are you really upset that it's being written? Why do you think you'll have to learn it?


I think it's also worth mentioning that Atom, like Sublime, looks straight-forward out of the box. You don't need to learn much to be productive. It doesn't have the learning curve of vim/emacs, but it's more powerful than Sublime/Notepad++/Gedit etc.

Also, I don't think anyone needs more than one general purpose text editor like vim or Sublime or Notepad++, and possibly a full-featured IDE like IntelliJ or Visual Studio. If there's a counter-argument, I'd like to read it.


tbh with you i've used both omnisharp and eclim with vim.

you get full IDE features as well as refactoring inside of vim. for most things you can use vim as a full featured IDE these days.

well for refactoring you might have a few issues on, say, c++ and objective-c

[] http://eclim.org

[] https://github.com/nosami/Omnisharp


The solution for n competing standards is n + 1 competing standards.[0]

[0] https://xkcd.com/927/


If the master thinks that the human race has reached the absolute pinnacle of human/machine interfacing for text editing after just a few short decades of trying then he needs to go away and have a little sit down and a think about where he went wrong in life.


Nah man, you're not enlightened. He's not saying don't build a new editor, just that you had better think long and hard before you decide to foist another learning curve on the world, and act like you're doing it a favor.

Also, https://xkcd.com/927/


Nobody foists a text editor on anybody, they live or die on their merits as a text editor. And besides, where would the world be know without people trying to make things better? The master's wisdom is weak in this case! I strike him on the side of his head! Slap!


It's a fair point, but by this rationale no new DBs or PLs should be made. Most of these die off or become niche, the ones that really become fundamental are few and far between. This idea that we have to drop everything and go "learn" this new thing is bogus. Folks in tech often seem to buy into the hype of some new technology all too easily, riding the wave of excitement. So their shouldn't be any concerns, of "yet another editor”.

BTW, I'm not saying this won't be successful! It looks interesting and I am excited, GitHub does great work, but you keep it in perspective.


somewhate relevent: https://xkcd.com/927/


I love learning new things! If it's better then I am more than happy to learn it, otherwise we'd all still be using EDT...

This "master programmer" need to stop abusing his novices, stop resting on his laurels and get back to some learning.


It's interesting that people keep using the word "better" when it comes to new editors/languages/frameworks/etc, yet as an industry we have very little evidence to proof it.

I've been doing this programming thing since the 80's, and the only thing I've seen that has really made software development better have been better practices.

Maybe we should first review our definition of "better" before we label something with it. Too often it's used as a synonym for "ooh, shiny!".

Having said that, Atom looks nice and shiny.


Nonsense, you didn't even have CVS in the 80's.


Maybe not, but I'd take pass-the-floppy over AccuRev or Perforce any day.

Yeah, git and its kin are really nice, but the expensive version control systems I've been required to use in enterprise settings are awful. So awful that many people actually just email source files back and forth so they don't have to deal with it.

So, version control has made things better in some areas. But enterprise version control feels more like a step back to me. AccuRev has literally stolen entire mornings from me because what should have been a simple two-minute check-in took almost 3 hours to complete and was interactive! Yay!


That's a shame. All the enterprise places I've worked so far have used Subversion (whether officially or not).


Hence the name.


we all have far less time than it would require to learn all of the interesting things. Once you get good with an editor your time is much better spent learning a new data structure, algorithm, language paradigm, etc than learning a new editor.


Thats maybe true for the vims and emacses of the world, but these new editors come with a fancy pants thing called a GUI. These GUI thingys adhere to certain standards and customs that are set by the OS. I do some web development work from time to time and therefore I have multiple browsers installed on my machine. I can switch between them without having to dig through a manual! I have to learn hardly anything!


I don't know how long Emacs has had a GUI, but it's at least 20 years.

I don't remember what the graphical capabilities of GNU Emacs are like, as I only use the command line version, but XEmacs at least also has extensive support for bitmaps graphics in buffers that far exceeds most of these "new editors".


GNU emacs can show bitmap images. I'm on the latest version 24.x and just tried it out, so I'm not sure when it was added.


It's hard to track down when it was introduced, but it looks like there was at least some bitmap support as far back as Emacs 18, which predates the XEmacs split and indicates that at least basic support may date back to 1986.


You aren't using your editor in the sense that most people here are talking about if you don't have to learn anything.


As others have pointed out, Emacs has a GUI. But the fact that you didn't know this might suggest that the GUI part of Emacs isn't integrally linked to the killer features of Emacs.

Learning tools like Emacs is for many a matter of productivity. If you want productivity, you want to streamline your most commonly used actions. Streamlining things in an editor will probably mean to use keybindings, since you're using the keyboard to input text anyway. Then you have to memorize the keybindings (or: your fingers have to), and you have to practice using it to the point that it actually becomes more productive than whatever previous routine you had - you have to fight your old habits.

Building these habits is what takes time. The fact that Emacs has a GUI helps with feedback and discoverability, not that much with building habits. When you have finally built these habits, only then can you know if you are more productive. If you aren't you might have to unlearn a lot of your habits (for example by learning modal text editing).

- Written in my Emacs




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: