Delphi 2006 Review: Imperfect Yet Irresistible - ' Text Editing ' (
Page 5 of 7 )
Text Editing
A series of seemingly minor changes to the IDE have added up to an environment that recalls the glory days of Delphi and Borland. This is where the energy to improve the IDE
seems to have been expended, with largely marvellous results. To start, we have line-numbers, numbering every tenth line and marking the rest with tasteful hashmarks (at the fives) and dots (at the ones). No more scanning the bottom of the page to figure out where you are.
ADVERTISEMENT
As you type, the structure window instantly shows all the errors you're making (and resolving), meaning that you seldom need to invoke the speedy compiler except when you're
ready to run. This could be intrusive, but it generally gives you just the right amount of feedback. The IDE keeps track of revisions (with the ability to rollback to previous versions as in D9), and alerts you to what's been changed but not saved (yellow lines) versus what's been changed and saved (green lines). Line numbers are marked, but only shown as numbers every 10.
And there are a host of new code completion features, including templates for loops that allow you to “fill in the blanks” smoothly most of the time. There are
also new features for developing your own code templates, surround templates (for turning code into a block), and completing blocks, and navigating between methods. The new features are easily adapted to and quickly useful.
At its best, the IDE is a masterpiece of usability, giving you all the clues you need to work smoothly without intruding on you.
The flip-side of that, of course, is that when it fails, it's very jarring. And it fails with disturbing frequency. One of the reasons I've never been a big fan of code
completion is that you sometimes end up chasing down why your code completion isn't activating rather than concentrating on your task. If you type in MyObject.X and the methods and properties of MyObject that begin with X don't pop up, you wonder if you've made an error, properly initialized your variables, etc. But
sometimes, it just doesn't come up. Or, instead of the appropriate class member code completion window, the new generic code templates window will come up.
The same sort of thing can happen with the underline used to show you in the IDE where your errors are. Things that aren't errors can end up underlined. It's disturbing to
have the IDE tell you your code is in error when you can run it and it works. Another killer, though this was common on the 512MB machine and not on the 1GB machines, is the occasionally long lag as the IDE struggles to bring up whatever thing it thinks will help.
I have a few issues with the refactoring warnings, which are a little sensitive. For example, an I declared in a local routine — the parent of which already has an I — generates a warning from refactorings, even though the I is not available to the local routine (because it's declared afterwards). In a different case, hitting Enter after a begin generated an end, even though the end had already been generated.
But these feed into the larger issue: “Helpers” which are misleading are worse than no helpers at all. (You can, of course, turn all these things off, but I'm
still finding them useful enough that I haven't done that. Yet.) And I have a long running gripe with things that type in code for me but don't allow me to customize how that code comes out. (I like to align my end with the block that it ends, not the begin that started the block.)
Then there are some things that don't quite make sense to me. You can mouse over a control, and Delphi helpfuly tells you which unit it was declared in. This unit indication is marked as a link. You can even click it! But all that happens is that the link changes color (to indicate that it's been clicked, I guess). The file doesn't open, though. Sometimes, as when the declaration is in the same unit, it shows an additional link, the clicking of which actually takes you to the declaration. (One thing you could do in D6 was press F10 on a symbol and then use the cursor keys to navigate the pop-up menu. This made jumping to a declaration a mouse-free breeze. But since D7, the F10 pops up the context menu, and the cursor keys end up manipulating the system menu, uselessly.)
Lumping the minuses (bugs real and imagined) together, they don't weigh significantly against the positives, however. The text-editing experience is a compelling argument for switching—but not the most compelling. But let's look at one big minus first.