October 31, 2005
After I discovered the CTRL+I incremental search function in Visual Studio, I never used the standard find dialog again. Incremental search is so good that it makes traditional search dialogs completely obsolete. If you think that's hyperbole, consider that Chris Sells calls incremental search "pure sex".
This particular find dialog is from Notepad, but it's the basically the same find dialog that appears in every Windows application:
The delimited search dialog has a lot of problems:
- It's a dialog. A dialog right smack dab in the middle of the text, potentially obscuring what you're searching for. In some apps it's even modal!
- It provides very little feedback. There's no indication whether your search term matches anything until you type the complete search term and press return or click Find.
- It's an all-or-nothing operation. Once you initiate a search, you're committed until the search completes. If you just mistyped a search term in a 5 megabyte text file, have fun waiting for that to complete.
- It forces you to think about directionality. If your cursor happens to be near the bottom of the file, you may not find any matches even though some exist at the top of the file. And you get nagged with yet another "no matches found" dialog.
Jef Raskin, in his book The Human Interface, has some choice words for the delimited search dialog:
This traditional method is rather punishing to the user, although most computer aficionados have become so accustomed to it that they no longer feel the pain.
Now compare that Notepad search dialog with the incremental search in Firefox:
The advantages of incremental search are numerous:
- There aren't any dialogs in your way. The search interface is blissfully dialog-less. There's nothing getting in the way of you and your search results. You can search, find, and resume working with minimal interruption. This is arguably handled even better in Visual Studio, where the interactive search indicator is a cursor change after you press CTRL+I.
- It wastes less of your time. The search begins as soon as the first character is typed. You know immediately when you've got a good enough match and you can stop typing.
- Mistakes are clearly evident. If you mistype something, you'll know that immediately, too. Press backspace to correct the typo and you're back to the previous match.
- It's interactive. Immediate search feedback alows you to adjust your search strategy in real time. The net result is far better searches than you'd ever get from a traditional OK-then-try-again dialog box cycle.
After you've worked with incremental search for a few hours, you'll probably wonder why incremental search isn't included as a standard feature in every single Windows application. As Jef Raskin notes:
From the point of view of interface engineering, the advantages of incremental searches are so numerous and the advantages of delimited search so few that I can see almost no occasions when a delimited search would be preferred.
Jef also adds an amusing footnote to that sentence: If it isn't incremental, it's excremental. Amen, brother. I can barely stand to use editors without an incremental search mode any more. I'm so glad that (after a little prodding on my part) the latest betas of EditPad Pro 6 include this feature.
Posted by Jeff Atwood
Interestingly, and typical of its heavyweight, 'belt-and-suspenders' design, the current version of Opera has both a dialog search and and incremental search toolbar. Unfortunately, the default binding for ctrl-F is for the dialog search, but the fact that it has the incremental search is quite appealling. Now if only the browser were more stable under heavy loads...
incrememental search has been around for a long time - I'm happy that it's finally found it's way into visual studio.
Vim users have been using it forever. I've been bitching about the standard ctrl+f 'find' dialog for two years - but no one has been willing to venture outside of their IDE for long enough to discover it.
the fact that (as Jef Raskin stated) so many "computer aficionados have become so accustomed to it that they no longer feel the pain" ... is, in my opinion, a contributing factor to the intellectual stalemate faced by the software industry.
Thanks for the tip for Visual Studio. I recently experimentally switched to Firefox (I was using NetCaptor, one of the pioneer multi-browsers on the market that wraps IE) PRIMARILY because of the excellent search functionality. I didn't know this kind of "modeless" search had a name, but it is by far the coolest way to search.
Spot on post.
Of course, the default search mode in Emacs is incremental, and has been for some time :-)
oh my. this was built into Progress 4GL as long ago as 1989, when i first started using it.
This is a prime case of MS needing to re-visit existing MS user interface standards.
Mind you the MS office team seems to have taken a long hard look at tradtional office interface wisdom.
I hope the Vista core tools folks do the same.
For Visual Studio searching, I also like the mztools search (a 3rd party addin), which presents all the search results in a list (broken down by class and method). You can then clcik each one to go to that result in a code window.
Also has a Find Procedure Callers which does exactly what it says and is super useful.
Conventional search is handy when searching through multiple files; incremental search in VS.NET seems to be limited to the current file. Also, sometimes it is handy to see a complete list of all the matches, not just the first one, and in that case Visual Studio handles it just right: you get a list of all the matches and clicking on one jumps you to that match. But most apps do this brainlessly and just show you the first one and then you have to keep clicking ok to see the next ones.
For reasons unknown to me, my VS.net 2003 maps 'incremental search' to Ctrl+Alt+I, not Ctrl+I.
Also - little tip for ya - pressing Ctrl+Alt+Shift+I does a 'reverse incremental search' (or should that be a 'decremental search'? ;)
On the Firefox downside: the previous search facility could find text in textareas, the incremental search cannot. That's a major bummer when you edit wiki pages :/
Consider that the Firefox incremental search isn't even as feature complete as the age-old one in Emacs: when you enter the string in Emacs, not only do you see your current match, you see all other matches highlighted (in a different color) below and above as well.
This is often _very_ useful if it's a variable or somesuch, and you get a kind of a "preview" if the match wasn't exactly what you thought you looked for. Or if you're browsing a log file where all lines look the same.
And, here's another little UI gem from Emacs' incremental search: when you have started the search, press Alt-w to expand the search string to the current word. Alt-w again to expand the search to the next word, etc.
The one complaint I have about Firefox's implementation of incremental search is that when I hit CTRL+F5 the first time, I didn't even notice it. I couldn't find the search because it's docked at the bottom in the same color as the status bar. Even now, I get confused as I switch between apps.
I'd prefer it to be on top and in a different color. Perhaps with an option to display a list of matches. But all modeless!
the previous search facility could find text in textareas, the incremental search cannot. That's a major bummer when you edit wiki pages :/
Indeed, I've run into this as well when editing posts for this blog :P
which presents all the search results in a list (broken down by class and method). You can then clcik each one to go to that result in a code window
Doesn't CTRL+SHIFT+F, then F8 already do this?
Firefox will highlight other matching terms if you click the "highlight" button on the search toolbar. It highlights text in edit boxes, too, although the "next" and "previous" buttons won't select text in edit boxes.
For any Delphi users reading this, its incremental search command is Ctrl+E.
try F3 !
it works in FF and even in Notepad...
Joseph Osako: Yes, but since opera isn't editor, you can search instantly by writing .the_word_im_searching_for - i doubt there is any of the applications I use left where I didnt try to use this :)
"Incremental search is so good that it makes traditional search dialogs completely obsolete."
Sometimes incremental search is NOT what you want. I find it incredibly bothersome when I'm searching for something that turns out to NOT be in the document, that incremental search leaves me at some random place in the document based on the last matching substring. If the search fails, you want your cursor location to be back where you started the search, not at some random place without a full match.
I like incremental search, but to say it makes normal searching completely obsolete is short-sighted.
"After you've worked with incremental search for a few hours, you'll probably wonder why incremental search isn't included as a standard feature in every single Windows application"
Try HandyFind (http://www.handykeys.com). It seemlessly provides incremental search on top of Notepad, Internet Explorer, Word, Excel, and more.
Unfortunately, the incremental search in VS does not do regular expressions (or, at least, I can't figure out how to make it do them), so we can't quite retire the dialog box yet.
I'm not fully in agreement with your view on code folding and #region but I love that I found out VS has incremental search via your link to this post.
What about Find and Replace? I haven't seen that enacted in an incremental search function before. I think the Excremental dialogue is slightly better for that... until I see an ingeniously-implemented incremental search do it.
Notepad++ has the exact same intremental search as Firefox !!!
Ah, forward slash, how do I love vi [improved]? Let me count the years... 10 ... 20 ... 30?
Inline search is the best reason to love vi, and yes emacs can get a little love too.
And just to show I'm not archaic, I use Resharper on VS2008 for my fancier searches, I've docked my find/replace dialog in an unpinned self-hiding tab at the bottom (near output, take that control-f) and I really like Notepad++ v5+ highlighting all the occurances of a word for me when I doubleclick a word to select it.
Yet I must point out that 'I' is just not close enough to my control key to see much rapid use. Yes, I use the Sun type 7 unix layout keyboard for my typing, though really any kbd with control in the middle of the left will do.
(I know this is an old post, but maybe this will help somone.)
@whm if you use incremental search and get lost in your code, try Ctrl minus to go back to your last position.
Ctrl+- (minus) is Navigate backward, Ctrl+_ (underscore) is Navigate forward. There are also buttons on the toolbar (with a blue arrow).
The problem I have with Visual Studio's incremental search is that case-sensitivity keeps turning on (because I use it in the regular find dialog). I wish I could make it always off. Or, even better, it would work like Vim's smartcase: Only case-sensitive if I use capitals.