18 ms·
Seven habits of effective text editing (2000)
- nnq 9y ago8. Switch to an editor that doesn't treat your code trees as dumb strings of text...
- TeMPOraL 9y agoWhich, beyond Emacs with Paredit, whatever is called Paredit-as-ported-to-vim, and some obscure Smalltalk stuff, generally doesn't exist. So yeah. Stay with Vim or switch to Emacs.
- skrebbel 9y agoJetbrains MPS does this. But admittedly it's not positioned as an allround code editor. Still, it does this and it does it pretty well.
- TeMPOraL 9y agoIsn't MPS for making weird DSLs that require special tooling, and not for editing your generic code? That was the impression I got after installing it and clicking around + reading some of the documentation. I understand 'nnq asked for editor treating code as trees; beyond Paredit mode for Lisp code, I'm not aware of anything like that being currently in use for regular code anywhere.
- skrebbel 9y agoYes, totally. But as a side effect it's also the best and most usable tool that I've ever seen that lets you edit the syntax tree directly. In that sense it can be seen as the most extensive exploration of this idea, and it could definitely serve as an inspiration to those who want to make a tree editor. Jetbrains poured some serious time and UX design into how to edit a syntax tree. It has a decent Java mode for example, which you could use to edit Java sources. It takes some getting used to but it really isn't half bad. You can't write code with it that doesn't parse.
- TeMPOraL 9y agoThanks. I'm going to check it out again, time allowing, and try a small project this time, instead of just casual clicking around. I'm very interested in the space around the idea of more structured code editing and different code presentations.
- nuriaion 9y agoStill very early but a good try: https://isomorf.io/ https://isomorf.io/
- aaron_kent 9y agoSome detail on isomorf.io editor: https://blog.isomorf.io/an-experiment-in-structured-code-editing-68b917a9157c https://blog.isomorf.io/an-experiment-in-structured-code-edi... https://blog.isomorf.io/the-economics-of-semantic-coding-7e8fd1b421e6 https://blog.isomorf.io/the-economics-of-semantic-coding-7e8...
- nnq 9y ago...web based and slow to load? Thanks, but >100ms latency is not something I can tolerate in a code editor. If I need a heavy IDE I can just run it on an overpowered machine and get to my target latency, but web based makes this unusable...
- nnq 9y agoFor the purposes of Lisps there's Emacs with Paredit (or other editor with Paredit, there are versions for most of them I think), for the purpose of notes there's Emacs with Org-mode. For the purpose of Java w.r.t. refactoring and navigation there's Intellij, Eclipse etc. For the purtpose of Python w.r.t. refactoring and navigation there's Pycharm. And so on. I use a combination of (1) Emacs & Org-mode for structured editing of notes and prose, and (2) Whatever IDE is most suited for the language I work in.
- sametmax 9y agoI'm not a big fan of Vim, but unless you can find any smart editor that have had half of the success of vim for half of its life time, I'd say maybe the way it threats text seems to be successful.
- nnq 9y agoEmacs and IDEs are also successful. No IDE in particular was long-time successful, but the general concept of "heavy program dedicated to structured editing of code" is successful. I still use Vim for config files though :P
- oblio 9y agoIt depends how you define "long time". Visual Studio was launched 20 years ago. Eclipse 15 years ago. Both of them seem to have at least as many years left in them.
- zeveb 9y agoEmacs is older than vim, almost exactly as old as vi (both emacs & vi started in 1976, IIRC), is quite smart and is capable of treating code as trees rather than strings.
- raverbashing 9y agoLooks like the site is already gone
- aargh_aargh 9y agoNot for me, but in case it is: http://web.archive.org/web/20171023122758/http://moolenaar.net/habits.html http://web.archive.org/web/20171023122758/http://moolenaar.n... http://archive.is/x850b http://archive.is/x850b
- mmirate 9y ago(2000)
- throwaway2016a 9y agoIt's Vim... it could be (1992) and probably still be useful to many vim users. Vim is regularly updated with new stuff but most of the stuff people use day to day to be more productive is decades old. I use vim every day and find these old articles are often helpful. Heck, sometimes I find articles from the 1970s/80s about vi to be still helpful in vim.
- TeMPOraL 9y agoA lot of it is timeless advice that will be applicable for as long as people use text editors. If anything, popular software only keeps regressing over time, letting you be less and less effective.
- tambourine_man 9y agoGoogle Talk with Bram Moolenaar from 2007 7 Habits For Effective Text Editing 2.0: https://www.youtube.com/watch?v=eX9m3g5J-XA https://www.youtube.com/watch?v=eX9m3g5J-XA
- miguelrochefort 9y agoWhy are we still editing text in 2017? Shouldn't someone have come up with something radically better by now?
- sametmax 9y agoComputing as we know it is not even a century old and we already had several radically shift in it. Compared to house building, medicine or transportation... We had millenniums of experience with them and yet we don't revolutionize them every decade. Things take time. Let's try find balance in what we got already. Once we have a hold on that, we'll have plenty of opportunity for the rest. Innovation is not an endangered concept in the human specie.
- Retra 9y agoOne wonders why you aren't asking the same questions of spoken word. The answer is probably that what we do right now is actually very efficient, well-tested, broadly applicable, and easy to learn.
- miguelrochefort 9y agoI am extremely critical of spoken words as well. I'm convinced that natural languages should and will be replaced by something better in the near future. I'm actually working on it.
- Retra 9y agoBetter in what way, exactly? More expensive? Doesn't use built-in biological facilities? Requires software updates and network synchronization? Children can't use it?
- miguelrochefort 9y ago- You'll never have to say the same thing twice (since the system you communicate through remembers) - You'll rarely have to say something explicitly (because most of the things can be anticipated for you) - You'll never say ambiguous things (because everything is semantically clear and verified) - You won't be able to contradict yourself or express paradoxes (because the meaning is verified and tested for coherence) - You'll never have to adapt your output to an other persons input (because the translation and contextual reformulation is made for you, think responsive speech)
- jimmaswell 9y agoI've used vim quite a bit but it still never beat GUI editors for me. The lack of a mouse cursor was always a pain point - for example simple copy/pastes take notably longer. Moving a block of code below another block of code takes 1 second in notepad++ while in vim you have to go V 10d x 13down P or something along those lines, figuring out exactly what numbers to use there probably takes more than 1 second alone. It always feels claustrophobic editing a file in vim, like I'm having tunnel vision, and jumping around files to understand the structure of a program or write a feature that changes many things is more time consuming, and pgup/pgdn and arrow keys just aren't as good as a scroll bar. Overall I'm glad vim exists so editing config files remotely is easier if I don't have the server mounted locally - it's definitely my favorite shell text editor so far but I'd take notepad++ or visual studio over it any day.
- siissussjskk 9y agoMaybe learn how to grok vim?
- lighthazard 9y agoHow do I select Lines 3, 16, 39, 50, 230, 420, 1302, and 2300 at random columns of my needs? With a mouse, I can cntrl/cmd + click the line I am interested in, wherever I am interested, and do any manipulation I want. Can VIM do this easily? I've never tried.
- bananicorn 9y agoMaybe you're looking for visual block mode?[0] Or the multi-cursor plugin[1]? I haven't tried the latter, ut I really like visual block mode for certain things. It's amazing how much new stuff I learn about vim every day... And I'm nowhere near done :) [0]https://stackoverflow.com/questions/21806168/vim-use-ctrl-q-for-visual-block-mode-in-vim-gnome#21808952 https://stackoverflow.com/questions/21806168/vim-use-ctrl-q-... [1]https://github.com/terryma/vim-multiple-cursors https://github.com/terryma/vim-multiple-cursors
- aoloe 9y ago
- samlittlewood 9y agoUsed to work with two programmers: First would type out a few lines of code incredibly fast with lots of mistakes (and not bothering to backspace over wrongness) - then go back and clear up damage using notepad level editing. Second would stare fixedly at screen for several seconds, whilst remaining still as a statue, then carefully emit the minimum string of editing commands to achieve the change. Their actual rate of progress was pretty much identical.
- mikegerwitz 9y ago> Second would stare fixedly at screen for several seconds, whilst remaining still as a statue That eliminates many of the benefits. Was your coworker relatively new to Vim? Or maybe pondering what change to make, not how to actually make it? This is what I've seen from a coworker who was learning Vim and forcing themselves to learn the "proper" way to do things. I don't consider that to be a bad thing, provided that you balance it with actually getting work done. I always do whatever allows me to edit the line without or with relatively short pause. That might be efficient vim commands, or it might be sloppy if the line isn't formatted in such a way that it fits my muscle memory. If I'm dissatisfied with the edit and think there might be a better way, I research it after the fact so I can later practice and know for next time. This comes with experience; I've been using Vim for over a decade. Any pause in my editing is because I'm actually figuring out what change to make, not how to make that change.
- samlittlewood 9y agoThey were reasonably experienced, but had an appetite for optimization beyond what most people would consider reasonable. In defense however, the task at hand was creating graphics microcode, so that mindset did pay off. As you rightly point out - there is a reasonable middle ground.
- fogleman 9y agoSurely there's a middle ground...
- 9y ago
- paultopia 9y agomental process: 1. "wow, the author seems to know a lot about vim!" 2. glance up at the name in the url ... ooooooh.
- sametmax 9y agoAnd if you look the urls up, you'll find people are regularly thinking the same: https://news.ycombinator.com/from?site=moolenaar.net https://news.ycombinator.com/from?site=moolenaar.net
- bunkerbewohner 9y agoPersonally I'm extremely happy with the vim plugin in Jetbrains IDEs like IDEA, Rider and so on. It gives me the best of both worlds. I can use vim commands for effective navigation but also have the great static code analysis, smart auto completion, project navigation (find symbol, class, file, ...) etc. of the IDE.
- deleted 9y ago[deleted]
- fokinsean 9y agoSame, I am a casual vim user and the IntelliJ plugin covers most of my needs.
- mezuzi 9y agoI was in primary school when this was published. I had never touched a computer by then and the closest I got to one was maybe 3 or 4 feet. The whole school had one computer in the library, and the librarian's son played games on it. That same child died in the Ukraine a couple years ago and I spent the majority of my waking hours now with a computer.. Life is strange!!
- ndh2 9y agoHere's my list of habits for effective text editing: 1) Observe other people edit text, then judge for yourself what is effective and what isn't, then decide for yourself what to learn and what not to.
- pka 9y agoMy dream is having an actually working/accurate to the character consumer-grade eye tracker that people can glue onto their screen. Then to move around in vim, look at where you want to go and just press a key. I think this alone would allow for a jump in effectiveness almost as great as the jump from notepad to vim.
- abakus 9y agoText editing efficiency is overrated, at least for coders. thinking >>> editing. If serious non-trivial editing effort is required, write a script to do it.
- lucb1e 9y ago> thinking >>> editing. I've heard that argument before but as a plus point for Vim. I just want to fix that typo in the next paragraph (}), not have to pick up a mouse and carefully place the cursor, or move down fifteen lines by hand or something.
- brandonmenc 9y agoWho uses mice anymore? Does anyone here seriously take more than sub-second time to get the cursor on any given character using a trackpad?
- cname 9y agoIt's true that you should think about what you're doing so you can avoid mistakes (and, as a side effect, type less), but you still end up typing quite a bit as a programmer, and you probably want to minimize the impedance mismatch while you're translating your thoughts into code. I've seen this play out in real life with two programmers who were roughly equal in terms of thinking in abstract terms. One of them was much better at typing (and using tools in general), so their code quality was better overall. The other would get frustrated in the translation/typing stage and produce lots of sloppy and incorrect code.
- altestova 9y agoLooks solid. Bookmarked
- z3t4 9y agoOne problem with key commands is that there's a lot of keyboard layouts. The same key can generate different letters depending on the keyboard. So when building an editor, do you listen to keys or whatever comes out after the key press(es) !?
- jokoon 9y agoSelecting text with shift and arrows, moving across words with the control key and arrow keys, using home and end keys, using CTRL F and CTRL G, all those are already plenty enough for me. I honestly don't understand why people use VIM or Emacs. I'm much more productive just with notepad. Most editors can fold code block, use syntax highlight to make code so much more readable (if you take time to choose the right colors), highlight braces, autocomplete (even sublime text can do a weak autocomplete which is already quite handy). To be honest, when you learn to type, using the shift, control, home and end keys should be the second thing you learn. Forget about vim and emacs, those were for times when people were coding over SSH. Use Nano if you're in a terminal. Also most of what coders do is read code, not write it.
- 59nadir 9y ago> Forget about vim and emacs, those were for times when people were coding over SSH. If you're struggling and have the suspicion that it might not be worth it for you in the end, sure. For everyone else, don't be afraid to learn how to be more effective by using a more expressive feature set for editing. I think your advice is potentially harmful. Just because you didn't end up learning this doesn't mean it's useless to other people. It's quite possible that you're just not learning effectively enough and you're not grasping the tools correctly. There's no shame in that, but to then advise people to not learn it only because you couldn't is completely pointless.
- jokoon 9y agoI'm just curious what kind of indispensable feature an editor like emacs or vim has. I don't see the productivity gain. Ultimately, it might just be pleasurable to learn to use something new and use it. You "feel" like you do things differently, but to me it's just another nerdy gadget thing.
- deleted 9y ago[deleted]
- jstanley 9y ago> those were for times when people were coding over SSH I do substantially all of my coding over SSH, and so do most of my friends.
- j2kun 9y agoFolks here assume "text editing" is just structured code editing. I use vim for more than just editing code trees in one language. I edit unstructured text (lists, notes, articles), semi-structured markup (latex, markdown), and machine-readable data that is not in the form of a tree (csvs, tsvs, scraper output, training data that comes in arbitrary formats). The mindset I've come to appreciate for vim is that the goal is to have a zen garden for editing text. Editing text efficiently and seamlessly is the end goal, and what that text is used for is incidental.
- ouid 9y agois this really the bottleneck for writing good code though? How quickly you can type?
- madhadron 9y agoStripped of the vim baggage (yes, I know vim; yes, I stopped using it as my primary editor in the 1990's), it comes down to: 1. Learn to use the code navigation features of your environment (or get a better environment). 2. Learn to use incremental search and replace in your environment (or get a better environment). 4. Make autocomplete work in your environment (or get a better environment). 3. Make your often used actions one click or one command. For (1) and (3), Visual Studio and IntelliJ are by far the best options available. (2) seems to be fine in any modern editor. For (4), acme is the best I've seen: you write your commands in a buffer, and click on the ones you want when you want them. If the buffer is a small one at the top of the window, it's the menu bar.
- wodenokoto 9y agoWhat is ACME?
- madhadron 9y agoAcme is an editor from Plan 9. https://en.wikipedia.org/wiki/Acme_(text_editor) https://en.wikipedia.org/wiki/Acme_(text_editor)
- foxylad 9y ago+1 for using abbreviations to fix mistakes. I use AutoKey (Linux, surely there are similar apps on OSX and Windows) to do system-wide abbreviations, including correcting "teh" and "hte". Along with abbreviating a few common phrases, this probably saves me hundreds of keystrokes a day.
- joshvm 9y agoAnyone who is wary of trying out an editor like Vim should play dwarffortress for a bit. It's amazing how fast you pick up the keyboard commands for common operations.