EMB Needs more Insight

Code Insight that is.

First, a disclaimer.  I am using Delphi 7 on my current project and have not yet tested this with Delphi XE or anything newer than D7.

Let’s say you have a descendant class and you want to implement a method override.  First you have to remember what the scope of the method is in the ancestor class, and then you have to type the prototype into the appropriate declaration section, and use Code Completion to get the implementation (or you can do the reverse).  In any event, you have to know the method prototype.

For instance, if you have the following class declaration and attempt to use CodeInsight to complete the prototype you’re SOL in D7 at least:

type
  TftInvoiceItem = class(ftInvoiceDesign.TftInvoiceItem)
  public
    function IsValid(XXX) :boolean; override;
  end;

Pressing Ctrl+Space after typing “func” provides no methods that can be overridden, and still nothing within the brackets containing XXX.  You are forced to navigate to the ancestor class and copy the method declaration so you can paste it in a descendant.

This wouldn’t be a big deal except that unlike C# Delphi requires forward declarations for the compiler.  That’s the trade off made for a fast compiler, and IMO a good one.  Managing method prototypes can be a pain though, because everywhere you want to add or change one, it has to be done in two places.  You would think the IDE would help by providing refactoring tools to do so, yet it is sadly lacking.  They pale in comparison to Resharper and CodeRush for Visual Studio.  Why?  I think it’s because Microsoft provides the Code DOM where EMB forces everyone to implement their own parser which means a slower IDE because you have 2 parsers at work, and less accuracy as the language evolves.

If EMB is developers developing tools for developers, then why doesn’t the Open Tools API expose the parser’s data or EMB at least provide better refactoring capabilities?  After all, we could still use Notepad if we didn’t need such functionality that an IDE should provide.  I’m sure the makers of Castalia, and ModelMaker would appreciate this, and every developer would benefit from having the fastest way to develop Windows applications, as opposed to the fastest way to develop Native ones.

3 Responses to “EMB Needs more Insight”

  1. Yogi Yang Says:

    +1 from me. Well said.

  2. markus Says:

    +1. I like that

  3. software development Says:

    Extremely interesting and useful article indeed. I read your post about software with a complete satisfaction? I must confess that I am a majorfan of it, so all information related with enterprise framework and patterns is very attractive to me. Thanks a lot for sharing this amazing entry and I will be waiting for other great blog pieces from you in the nearest future. By the way , I will for sure bookmark your website .

Leave a Reply