On favorite editors

With 7 separate trackbacks to my weblog (6 of which now manually deleted) I feel compelled to respond to Dominic's post regarding favorite editors. Before I do though, Scott, if you're reading this, any chance of updating .Text to remember previous trackback pings sent out and not resend them on updates? That would save me and others the manual delete effort...

But back to Dominic's entry. While I have on several occasions proclaimed my love for IntelliJ IDEA, there is one VS.NET feature in particular I wish IntelliJ would add: when closing a block of code using "}", VS.NET automatically formats the block you just closed - so if you need to wrap an existing piece of code in an if-block for instance, it auto-indents when you close that block - a very useful feature indeed.

Dominic mentions he's most impressed by VS.NET's colorizing perf. While the performance of this (and VS.NET in general) may be better than IntelliJ, it is IntelliJ's colorization preferences that has truly impressed me. As just one example of this, IntelliJ allows the user for instance to choose different settings for local variables, instance fields, static fields and parameters. I admittedly have not experimented much yet with VS.NET's preferences in this regard but would be surprised if they can match this level of customization. Dominic says he'll be blogging about his colorization strategy soon though so I'll be awaiting that entry to get some more info...

TrackBack URL for this entry: http://www.hutteman.com/scgi-bin/mt/mt-tb.cgi/83


When I said that I was going to blog about the colorization strategy that I've hit on, I was thinking in terms of perf considerations:


Incidentally, in this regard, I believe that I've hit the perf limit on the underlying RichTextBox; indeed Spy++ reveals VS.NET's editor window class to be a "VsTextEditPane", not a "RichEdit20W" like my editor.

In terms of the strategy used to color tokens, I use a dumb binary text search on each token to determine what class of SQL token it's in, if any. I also add a list of all database object names, so that they can be colored specially, so the user can identify them easily and right-click them to perform actions on them.

So basically it's a pretty dumb text-based comparison on each token: there's no proper SQL grammar parsing, like there is in VS.NET's background compile. Empirical observation reveals that isqlw.exe also uses a similar dumb strategy. It sounds like IntelliJ is performing at least some sort of partial background compilation in order to differentiate between instance members, statics, locals etc. That's some pretty hardcore stuff! There's loads of cool stuff that I'd could do if I had a full SQL parser running in the background: imagine typing "SELECT * FROM sometable WHERE " and then having the editor automagically popup a list of all the columns on "sometable"! That would be pretty damn cool!

I'm honestly surprised that Query Analyzer doesn't highlight database object names; it would be a very helpful feature indeed, and _really_ easy to implement, what with DMO. I'm guessing it's only a matter of time, maybe in the next version of SQL Server?!

Posted by Dominic Morris at September 14, 2003 5:48 PM


Yeah... it is nice for VS.Net to auto format blocks of code based on the closed '}', although it still isn't a too bad to select some text in IDEA and then select Format Code from the menu bar.

One thing I find frustrating is that with VS.Net you seem to be forced to use the "MS" Coding standard, whereas IDEA allows maximum customizability. (unless that is a feature in VS I'm not aware of)

Although any editor discussion is highly subjective, I find IDEA superior for lower level programming and VS better WIN/Web support and it's sweet integration with SQL Server.

BTW... props on SharpReader.


Posted by Harris Reynolds at September 15, 2003 1:41 AM

More on Colorization

Trackback from autoCode( my_dotnet_baby ) at September 15, 2003 5:39 AM

VS C# Editor

Trackback from autoCode( my_dotnet_baby ) at September 22, 2003 4:04 PM
This discussion has been closed. If you wish to contact me about this post, you can do so by email.