Make a better Delphi
Delphi is a good language and Delphi IDE is a good development environment and together they make a good pair, but admit it - Delphi language is missing some modern language constructs (parameterized types, for example) and Delphi IDE can be rough at the edges. We can't do much about the former, but Delphi IDE can be greatly enhanced by installing third party add-ons (and great thanks to Borland/CodeGear for enabling us to do so). Recently I've noticed that I can't really function well on a bare-bones IDE. I'm heavily dependent on three IDE extensions - GExperts, DDevExtensions, and ModelMaker Code Explorer. I decided to dedicate some blog space to them and describe what they do and why I like them. It would take too much space to describe every aspect of those three add-ons, so I decided to focus on a navigation in a broad sense - moving inside unit, between units, between code and design view etc. Even more, I won't cover every navigational helper in those three, I'll just focus on the features I'm using regularly. Delphi IDEDelphi IDE has some neat navigation tools built in. First, there are markers. You can drop ten markers by pressing <Ctrl><Shift>number, where number is a numeric key from 0 to 9 (you don't have to use numeric keyboard keys, standard keyboard numbers will work just fine). By pressing <Ctrl>number you'll be transferred to the line containing the marker. To delete a marker you just press <Ctrl><Shift>number while the caret is positioned in the line containing the marker. Another neat feature of the Delphi IDE is the ability to jump from method implementation to its declaration and back. The shortcut for this operation is <Ctrl><Shift><UpArrow> or <Ctrl><Shift><DownArrow> (both work the same).
I'm also using the unit list (<Ctrl><F12>) and form list (<Shift><F12>) regularly. First shows the list of units in the project and second the list of forms. Just double-click the unit/form or select it and press <Enter> and it will open in the IDE. GExpertsGExperts is a set of freeware experts that enhance Delphi IDE in various ways. Only small subset is connected to the navigation.
Another useful tool is procedure list expert. As the name suggests, it presents a list of methods in the current unit, which you can, of course, filter by typing. Double-click or <Enter> will beam you to the selected method.
The last navigational help in the GExperts is hidden in the form designer pop-up menu. It is extended with the find component reference command. Right-click on a component or control and select this option and GExperts will bring up the editor, focused on the part where this component/control is declared. Or used for the first time in the code. Sometimes former and sometimes latter and I can never guess which one it will be. DDevExtensions
DDevExtensions also redefines unit list and form list keyboard shortcuts so that display a list that can be filtered - similar to the GExeperts' open file expert. ModelMaker Code Explorer
An important part of MMX interface is the Explorer window. It lists every class and method in the current unit, has movements synchronized with the editor and is filterable.
MMX also offers extended up/down navigation. Delphi's shortcuts <Ctrl><Shift><UpArrow>/<DownArrow> are redefined to jump (in addition to the default behaviour) between propery declaration, its getter and setter, between constructors and destructors and between overloaded methods. Highly useful.
Other enhancementsThat's all by me, I've exhausted my knowledge. Here's where you, dear reader, can help. If you know a trick that I didn't mention or a helpful expert that I don't have installed, do tell me about it in the comments. You'll help me and other Delphi programmers. |
15 Comments:
Not to be forgetten: CnWizards. It is now my choiced IDE add-in. (together with GExpert and DelphiSpeedUp).
How about CNPACK ?
(http://www.cnpack.org)
Agreed on all you said in the post.
One more vote for cnWizards, although there is quite a bit of overlapping functionality between GExperts and cnWizards.
(I saw the Home key functionality but where not aware it is ddevextensions that added that functionality)
I think the reconfiguration of the Tab-key to indent a block of code and Shift-Tab to unindent is not a feature of DDevExtensions.
It don't work in my IDE and it is also missing in the feature list of DDevExtensions (and thats sorry because I like to have it). Is there a hidden Option?
Perhaps an other tool is responsible for this behavior.
CnWizards do have all unit list, form list, open file and tab order wiz, and much more...
@JabulaZA: Yes, the cnWizards build heavily on the GExperts codebase.
@Heinz Z.: Sorry, I forgot to mention that you need a snapshot build of DDevExtensions. Snapshot builds are not linked from Andy's main web site. You have to follow a link he published in an old blog entry (where he also announced the Tab support): http://andy.jgknet.de/blog/archives/48-DDevExtensions-for-Delphi-2007-snapshot-builds.html
Some other modern language features that show Delphi's age:
The inability to declare variables locally (must use a VAR section)
The need for separate declaration and implementation areas for object methods, properties etc.
The inability to declare local scope blocks in a procedure (WITH would do it, but it's implementation in Delphi is ambiguous and the IDE doesn't help you.)
These made sense in the days when processors were slow and RAM was expensive, but C# has opened my eyes to how development speeds up when you leverage the huge power of modern PCs. Pity there's no W32 C# compiler.
Thanks a 1000-times for pointing med to DDevExtensions. Finally I can leave some of the dark-ages-shortcuts behind me (Ctrl+K+I / Ctrl+K+U).
Castalia!
Things I love about it:
1. Structural Highlighting!!! The colored lines to link begin/end pairs (as well as try/end, repeat/until, etc.) together help visualize code.
2. Flow Control Highlighting. I have it put the markers in the gutter so I can glance through a procedure and find various exit points in the code. While I try not to have Exits at random points in code, sometimes exceptions need to be raised in strange places.
3. Parenthesis Matching. I prefer its style to BDS 2006's.
Those are the main things I love about it. The Navigational Toolbar is pretty nice too. It also has its own implementation of Code Templates and Refactoring for those still hanging onto (or stuck on!) Delphi 7 and earlier.
The things I hate about Castalia - 1. unstable. 2. unstable. 3. unstable.
I never found any other add-on that crashed Delphi more than Castalia.
Things may be better with newer versions but I'm so scared of it I don't even want to test it.
I've been using gexperts and castallia 4 in d2006 and now Castallia 5 since d2007 came out and except for the menu crash lockup due to a memory locking issue, I've never seen a crash that I can contribute to Castallia in the almost year since C5 has been out. Wish I could say the same about d2007 itself but it hasn't lost any of my code and the main error I see is when the ide is closed.
I really like the tab/shift-tab in(un)dent feature and the one-click block comments and the unit navigation bars and have come to depend so much on the block matching highlighting that I feel lost in d7 now. I like the paragraph matching in C5 much better than Delphi's also.
I have to say about my program Comfort On-Screen Keyboard.
It is convenient to use as a shortcut reference for applications.
See shortcuts for BDS 2006 here: http://www.comfort-software.com/images/delphikb.jpg
Something else I forgot: Ctrl+click on identifier will jump to it's declaration. Higly useful. Works in all modern Delphi IDEs (can't remember when it was implemented).
Ctrl+click to go to the declaration was introduced in 5 I believe. It is a great feature.
I've used the latest version of Castalia and it is stable. I turn off a lot of the features (templates and the search) because I am familiar with how Delphi does those natively, and I don't think it adds much over the native support. I imagine if you were using an earlier version of Delphi these features could be a lot more valuable.
With Delphi 2007, I use:
Delphi Speedup
GExperts
Castalia 2008.2 (30-day Trial)
Delphi Speedup is a must-have.
GExperts is free and includes really nice experts (I use the messagebox wizard often and the code snippets library is nice too).
Castalia 2008.2 isn't free but it is really nice (I installed it recently). An older version I tried a couple years ago was buggy as hell, but the current one has been very stable for me--I'm buying it unless I run into serious bugs over the next week or two.
With Castalia, I can declare variables in the middle of my functions and it will automatically put them in the correct spot for me. And it adds two dropdowns above the editor so I can navigate quickly to a function (in fewer clicks than GExperts).
I haven't tried ModelMaker Code Explorer (MMX) yet but I'm going to try it later this month.
Post a Comment
Links to this post:
Create a Link
<< Home