Archive for September, 2009

Where I Think RAD Studio Falls Short

Wednesday, September 30th, 2009

I upgraded to RAD Studio 2007 a while back as a show of my faith in CodeGear, and to put my money behind the future of Delphi.  Although I own a license, I never really used it that much until recently.  Many of my projects remain in Delphi 7, but as an old time user I thought it was about time to learn some of the new features and functionality in a more recent IDE and reap some of the benefits of that investment.

IMHO BDS releases before D2007 were far too slow and used to much memory, but most importantly they weren’t very stable.  So far, while the D2007 IDE is stable and seems almost as fast as Delphi 7 (this is one of the primary reasons I bought the upgrade),  I still I have a number of issues:

1) Compilation cycles are longer.  Most likely this is due to MSBuild integration, but anything that slows down the compile/debug cycle is detrimental to developer productivity.  I don’t think making a single change to one line of code in one unit and re-compiling should take 20 seconds, even if it’s in a VM on a 2.5 Ghz MacBook Pro.

2) The IDE pauses for extended periods as it re-parses the code, while I am trying to type.  When a re-parse gets triggered an hour glass appears and I’m dead in the water until it’s done.   This is apparently addressed in D2010, but it really makes you wonder if they broke it sometime after D7 so they could fix it later and get developers to “upgrade”.  I’ve never had this happen in Visual Studio, and wouldn’t expect any professional development tool to impede your coding ability.

3) Code navigation

If you don’t practice one class per unit, you definitely need some way of navigating between classes and different sections in the unit.  I loved CodeRush’s navigation editor toolbar.  GExperts is now my tool of choice since it’s free, works well and is still supported.  I tried an older version of Castalia since it seemed to have a lot of the features of CodeRush, but it didn’t work as intuitively IMHO and it wasn’t as stable as I hoped.  What GExperts is missing is a way to jump to different sections in a unit, like the uses clause in either the implementation or interface, or an object definition etc.  The uses clause manager (Shift+Alt_U) covers some, but not all of this need.

While the structure pane has been around for eons, and has been further enhanced in D2010, I don’t use it for code navigation.  I guess I got used to CodeRush’s navbar, and the structure pane has additional, distracting information like units used, fields etc.  I suppose you can turn them off but if you have a method like Dummy() on two classes, searching finds the first one, but AFAIK there is no way of locating subsequent ones directly using the keyboard.  It’s also amazing to me that it’s called the Structure Pane, yet if you Rt. Click and select Properties on the local menu, the property dialog is titled Explorer Options.  Nothing like consistent names in UI design.

You would think that advanced code navigation would be one of the primary reasons for buying an IDE, but apparently it’s not since the concepts embodied by now defunct commercial tools like CodeRush, and open source efforts like GExperts still have not found their way into the IDE.  Those that have, seem to be more limited in capability, and you have to ask why…

4) Templates and other productivity features

CodeRush has some pretty good template support with the ability to drop markers and jump to them at a later point.  It’s a snap to define your own, and IMHO it’s still far better than anything available in Delphi today even though there are some bugs that affect insertion mode on occasion, and it’s parsing is not always 100%.

When was the last time you looked into writing your own live template?  Could you even find good documentation?  How do you tie in a scripting engine and access the editor buffer so you can manipulate the code?  It might be easier if Embarcadero exposed the Kibitz parser through the OpenTools API.  Right now, any IDE Add-in has to parse the code itself, and that leads to support issues as Embarcadero evolves the language.

Mark Miller left the Delphi world and created CodeRush for Visual Studio, and there is also of course ReSharper.  I have used both, and I must say that RAD Studio still lags behind the intuitiveness, and intelligence of these IDE add-ins.  While I understand that Embarcadero doesn’t want to put any partners out of business, there aren’t that many players in the market any more, and the lack of smart productivity features isn’t doing Delphi any favors.

Some of the features like declaring a variable using Ctrl+Shift+V are available, but unlike CodeRush which coincidentally uses the same key binding, it will not allow you to define a Field variable only a local.

Ctrl+Shift+C can be used to declare a method prototype if you have created it’s body in the implementation section, or the reverse (which I have seen used more often).  Unfortunately, in the former scenario it places the method prototype in the private section, not providing an opportunity to specify the method’s scope, or any additional directives such as overload, override, reintroduce etc.  CodeRush had this back in D7 days.

Error Insight is nice, but not as useful as it could be if you don’t know where all the errors are.  Resharper shows all potential problems adjacent to the scrollbar so you can navigate to the code by clicking on the colored indicator, and correct the error before re-compiling.  When compilations take longer, it would be nice to locate and fix as many errors as possible without having to re-compile to find them.

5) Refactoring

Much of the refactoring support relies on enabling modeling.  Even then, it doesn’t always seem to work, and I can write better documentation on how to use it, than what is supplied.  I attempted to rename some variables across units with Ctrl+Shift+E, and after I clicked on Ok, the code didn’t change, nor did the preview of changes dialog appear.

One of the features of CodeRush that I used the most was it’s ability to surround a selected block of code with a try/except or try/finally.  I tried D2007’s Surround tryf and it does inject the code, but it never indents it properly.  Maybe thats why they incorporated a code formatter in D2010 ;>)

Sync edit is a great concept, but it requires you to highlight the code block first.  Most of the time, you either want to rename a method variable, or a field variable so I don’t understand why it cannot determine the scope for you based on the identifier you’re changing rather than requiring you to highlight the code, invoke sync edit and then change what you want.  I wonder if Embarcadero has someone who actually looks at usability.  Hopefully this will improve as they increase use of Delphi internally.

6) Advanced Search

CodeRush and GExperts both contain a much better GREP/Search across units than the native IDE.  This appears to have been addressed in D2010.

7) Documentation generation

One of the reasons I bought D2007 is because I read the compiler would now generate XML documentation.  It may generate the raw information, but it’s a long ways from real documentation so I’m still using external documentation tools which must again, parse the code themselves.

Conclusion

While I am still learning what D2007 has to offer, I am compiling my list of “must haves” for me to upgrade to D2010.  For now, even with the BOGO offer and all the great new things in D2010, I’m not putting out $620 CAD until I see that D2010 has addressed the issues above.  Time to checkout the CodeRage replays…

What would make you upgrade?

Code Documentation - What Do you Use?

Friday, September 11th, 2009

I have been looking for a tool to generate documentation from embedded comments in hcOPF.  I am more familiar with JavaDoc than XMLDoc conventions, but I really don’t care which one I end up using as long as the tool can accurately parse Delphi code from D4 on up.

With the introduction of generics and class helpers in the latest versions of Delphi finding a tool that can parse Delphi source is not a trivial concern.  Although hcOPF doesn’t currently use any language features that would exclude earlier Delphi versions, it may at some point.  Even if it’s done using conditional directives, this may break the documentation parser, so selecting a robust parser that is going to be maintained in the future is important.

Needless to say, hcOPF is an open source offering so I’m not about to drop big $ on a tool to provide documentation on the framework.

I even went so far as to purchase Rad Studio 2007 because the feature matrix indicated it had documentation generation built into the compiler.  Unfortunately, the documentation on the parser and live templates that would be used to support the commenting efforts, is practically non-existent.  Since not everyone who will choose to use hcOPF will be using BDS2006 or higher, they won’t have the ability to use this documentation system, so I am leaning towards an independent toolset.

What do you use, and why?