Jump to content
Mike Torrettinni

Delphi Native Code: Fast or Reliable?

Recommended Posts

A question for Delphi developers who also use .Net:

 

I'm reading this OLD (2008) Marco's blog and the comments: https://blog.marcocantu.com/blog/delphi_native_code.html and wondering if it's still the same today: that .Net world changes so fast they need to keep updating to latest framework versions of old stuff is not working anymore, opposite of Delphi?

 

My oldest project is running for 15+years, and except for code updates to use the latest Delphi feature, I don't remember any Windows changes that I needed to take into consideration or project would not work anymore. Was I just lucky and there was a breaking change in Windows where Delphi projects had to be updated or Marco is still right about Delphi today - it just works, while others don't?

 

  • Like 1

Share this post


Link to post

for me... 21 years of freelance development.. zero changes due to Windows issues. But.. I use third party components; so, I ignore if really that components has been updated due to Windows changes. I means 'complex' components like reportBuilder, or exporters to Excel.. 

  • Like 1

Share this post


Link to post

There have been changes in Windows that required updates to the applications. For instance UAC introduced with Vista. Occasionally, there are also some other tweaks in Window that can cause some "minor" issues and require code update.

 

It is that Microsoft has really great track record of providing compatibility options for older applications, so even very old applications can keep running. but this is more Windows feature than Delphi one. It helps that Delphi mostly relies on very stable core WinAPI, and that it creates single executable. But on other platforms Delphi apps don't have such longevity.

Edited by Dalija Prasnikar
  • Like 2

Share this post


Link to post

There were a few changes to Windows that required changes to Delphi programs but these were mostly minor and I don't remember most of them. One that comes to mind was that the known ways to prevent the screen saver from activating stopped working one after another. I think I had to change that code at least 3 times to make it work for XP, Windows 7 and then Windows 10.

 

Then of course there was the major headache of UAC Virtualization and the corresponding entries to the manifest. But that was mostly because I did not keep up with the Delphi versions so I had to fix Delphi 2007 projects to manage these correctly. And more recently there was high DPI and scaling. Again, these could be solved at least partly by updating to the latest Delphi versions.

 

I have no experience with dotNET, so I can't compare.

Edited by dummzeuch
  • Like 1

Share this post


Link to post
1 hour ago, Dalija Prasnikar said:

this is more Windows feature than Delphi one.

100% this - any other program built with a programming language that directly is built ontop of winapi works as well - you only need to change applications in order to use and embrace new features or recommendations (such as not storing configuration or user specific data next to the binaries in programfiles)

  • Like 2

Share this post


Link to post

It's a 12 year old article. I think it's reasonable to assume that a lot of things have changed since it was written!

 

Although a statement like "Delphi compiled programs are fast" is just as wrong now as it was then.

Edited by David Heffernan

Share this post


Link to post

I just remembered that with one of the first versions I was asked why am I storing user data in Registry and not INI file.I don't remember their reasoning, but I do remember looking into if Windows is getting ready to remove Registry.

That would be a breaking change also for Delphi programs, I guess. Luckily they didn't do it.

 

1 hour ago, Stefan Glienke said:

(such as not storing configuration or user specific data next to the binaries in programfiles) 

That's exactly what those developers were expecting, to have user INI file right there with exe. I guess this was in Windows XP era.

 

Share this post


Link to post

There are subtle changes with new versions of windows.

 

Getting the actual windows version is much harder than it used to be since Windows now fakes old versions to keep old applications happy. 

 

Auto running from the registry is harder if your application has admin rights, since that is something hackers try to do to gain admin rights. 

 

There must be a list of these things somewhere, these are just two in the old application I'm maintaining today.

 

But generally, Delphi applications compiled 20 years ago still run today, as do new applications compiled with 20 year old compilers (mostly). 

 

Never used .net, but I know security holes are fixed every month, and Microsoft keeps breaking Delphi 2007 by regularly deleting the  Borland.*.Targets files from the Framework directory.  I would never sell an application that Microsoft can so easily break. 

 

Angus

 

 

  • Like 2

Share this post


Link to post
9 minutes ago, Angus Robertson said:

Microsoft keeps breaking Delphi 2007 by regularly deleting the  Borland.*.Targets files from the Framework directory

Are you sure? Never seen that.

Share this post


Link to post

I remember  a change in the way application was displayed in task bar (twice). If I recall it was an issue specific to application built with Delphi. 

Edited by Stéphane Wierzbicki

Share this post


Link to post
14 minutes ago, Attila Kovacs said:

Are you sure? Never seen that.

Absolutely, I keep the four targets files that Microsoft deletes when it you re-install or patch framework v2, they are in a Microsoft folder atter all, so maybe it was Borland's error. 

 

Angus

Share this post


Link to post
49 minutes ago, Stéphane Wierzbicki said:

I remember  a change in the way application was displayed in task bar (twice). If I recall it was an issue specific to application built with Delphi. 

I only remember such issue with splash screen, but then implemented it right and all was good. Do you remember what was the cause in your case?

Share this post


Link to post
1 hour ago, Attila Kovacs said:

Are you sure? Never seen that.

Yes, he is correct. I had to restore those files several times after a Windows update.

 

Not sure whether that's a Microsoft/Windows or a Borland/Codegear/Delphi 2007 problem. Are we supposed to add additional target files to the dotNet installation directory?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×