CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Delphi for .NET, strictly private

Last friday I had the opportunity to see Delphi for .NET on the meeting of the sdgn The sdgn started long long time ago as a Clipper user group. Over the years, amongst other, Delphi and .net have joined the show. The sdgn was alway great in Delphi, so it was a nice environment to meet Delphi for .net.

At this moment several betas of Delphi 8 are circulating. Delphi 8 is the same as Octane and Delphi for .NET. There will not be an other product to project your wishes or hopes upon. This is it ! It looks like C#-builder and houses the Delphi language targetting the .net platform. Not the Win32 platform, that will be added in a later release. You can port the source code of your Delphi VCL (the Delphi class libarary) app to Delphi 8. The VCL has been rewritten for the .net platform. A big difference between Delphi and a .net language is that you have to do your own memory management in Delphi and have a garbage collector in .net. Delphi still does have constructors destructors, their implementation is limited to the dispose pattern.

The actual demo was actually a total disaster. Part of this was due to the speaker having to switch to another (someone else's) laptop to do the show. This machine had another Delphi version and possibly (?!) another D8 beta installed. But even some of the simplest thing did not work. Importing a Delphi 6 project which had one form with just one button failed. Another problem was that the speaker didn't seem to know that much about .net. He raved about the Delphi datamodule but could not answer what that had to offer over a .net component. What did work was live data in the designer. Provided you use the Borland database provider. According to the speaker this provider is quite essential, alas he was unaware that .net has a oledb data provider.

The title of this post is from a new language feature of Delphi. In the current version fields scoped as private or protected are visible to other classes in the same unit (source file) Somewhat comparable to the internal scope in C#. To comply to the .net idea of private Delphi now also has strictly private and strictly protected. I don't like this either as it is further obfuscating the language. Now there is a destructor which does not destroy and there is a private which is not really private. If Delphi wants to make it into the .net area it will need the guts to do a cleanup. It will be a good tool to port existing Delphi apps to .net. But it's not inviting to build a future upon.

Maybe I am coming down to hard on Delphi 8. I havn't been to friendly on C# builder either. I really do care a lot about Delphi and consider it a bloody shame what Borland is doing to their own heritage. The presentation and the product made my toes curl. I am not the only one. For instance : during the presentation the speaker mumbled, after another failure, “we'll have to find a solution for that”. Somebody else spoke out aloud what I only dared to whisper : “Use Visual Studio...”

blog on,

Peter



Comments

Arno van Jaarsveld said:

Hi All,

A little bit disapointing that peter decided to form and base his opinion on just this one session. The session peter was talking about is on of the many sessions during the last CttP (Conference to the Point) of the SDGN. The problem with the presenters laptop was a low video signal, and a extremely long vga cable, resulting in a flickering beamer due to signal loss. So in the middle of the presentation we decided to change laptops and Dennis (the presenter) finished his presentation on mine. Off course my laptop install was a little bit different than his and that showed in his presentation but i think he still did a great job. You go ahead and try being productive on your someone else's laptop...

And for the record I totaly disagree on peter's oppinion about Delphi8 from a language point of view.
Delphi is and hopefully will be my first language of choice and lets wait before there's actually a finnished product before we start ventilating oppinions.

Blog on

Arno
# December 15, 2003 3:53 AM

Peter van Ooijen said:

Gentlemen, thanks for your constructive comments. Yep I did mean constructors and will correct that in the post.
My opinion on Borland for .net is not just based on this one presentation, the c#-builder trial inflicted the first damage. And the presentation just was a bad one. Sorry to say so, I know how hard it is to do one.

Concerning the Delphi language. It is a good thing Borland is trying to make migration as easy as possible. But the way they are doing that is imho spoiling the language. What they should have done is change the meaning of private and change former private declaration to internal. And they should have renamed the destructors to Dispose. This does require a little fiddling with existing sources but is making far better clear the way .net works. You have to look ahead, otherwise it makes no sense to migrate your Delphi project to .net.

I've been an early defector switching from Delphi to C#. At the time of doing so there was no choice and Borland claimed itself superior to C#. Remember the Dflat "discussions" ?. I still work with Delphi for win32 projects and still do consider using it on a .net project. Provided Borland will give me better tools than they are showing now.

But it is all, as my blog title states, just an opinion.
# December 15, 2003 6:04 AM

Bob Swart said:

Did we attend the same session? I agree with the fact that the presentation suffered from "bad luck" with the laptop/beamer/beta combination. But I think you are a bit to harsh in your comments on the speaker and the topic (Delphi 8 for .NET) itself - based on just one presentation. A shame you decided not to attend the next two sessions on Delphi for .NET as well...
IMHO, the presenter did give a good overview of important points to keep in mind when migrating Delphi Win32 projects to Delphi 8 for .NET.

By the way, your latest comment mentions constructors again while you probably mean destructor (I know you know the difference).
Also, the special keywords are strict private and strict protected (not strictly).
Finally, I hope you remember that the "Delphi 6 project which had one form with just one button" which failed to migrate was actually a COM Interop example, and not the simple demo you try to make it look like.

I understand that you are unhappy with C#Builder and the fact that you do not find in Delphi for .NET what you are hoping for, but I was hoping for a more constructive approach from your side, instead of making an effort to see only negative points. This does not add to your credibility, but that's my personal opinion, of course...

And yes, I am a long-time and loyal user of Borland tools, and like you I try to keep an open mind and approach their efforts with a critical eye. But unlike you, I try to be constructive in my approach (to use your own words)...
# December 15, 2003 7:45 AM

Nick Hodges said:



A couple of points:

First, you viewed a demo with a beta version, so yes, I think you are coming down a little hard on Delphi. :-)

Delphi is a "legacy" language, and unlike C#, has been around for about 20 years. Thus, it will have a few quirks, and will move forward in a way to maximize backwards compatibility. Thus, destructors are essential to that, and can't be removed or changed. In fact, destructors to see to the destruction of objects, if you will, it's just that it is done in the .Net way. In addition, I +like+ the fact that the language reminds you to explicitly "free" (if you will) your objects. Leaving things to hang around is bad programming practice. Keeping in the habit of "freeing" objects is sound, as many objects will need to free things other than memory, and of course, the Garbage Collector can't do that.

As for the private/strictly private: There is no "now" about the private the isn't really private. That's always been a quirk in the language. It always has allowed classes in the same unit to "touch each other's privates" as the joke goes in the Delphi community. (By the way, if you don't like this, give a shout to Anders Hjelsberg -- he designed it this way.) Thus, in order to conform with the CLS, and to to maintain backwards compatibility, strict private was introduced. You suggested cleaning this up, but again, backwards compatibility is an excellent feature, and changing this would simply make for a +lot+ of broken code. You are not, of course, at all required to use plain private, so your claim that starting a project in Delphi for .Net because of things like this seems a bit strained.

As for using Delphi, here's a reason to do so:

http://www.lemanix.com/lemanix/lemanixisapi.dll/Entry?ID=1167

Nick
# December 15, 2003 9:13 AM

Danny Thorpe said:

>>
What they should have done is change the meaning of private and change former private declaration to internal. And they should have renamed the destructors to Dispose. <<

What you're saying is that you would have preferred Borland to create a completely incompatible language and require people to make extensive, one-way modifications to their existing source code. If people have to make extensive modifications to source, they might as well port to some other language.

We retain the Delphi syntax specifically to avoid making Delphi a .NET-only language.

-Danny Thorpe
Delphi Compiler Architect
Borland
# December 15, 2003 12:53 PM

Peter's Gekko said:

# January 30, 2004 2:46 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!

Our Sponsors

This Blog

Syndication

News