Patrick Dunford wrote:

anton wrote:


What objects don't have to be created? They all do.

hmm. I thought you said you developed with Delphi?

Yes, Delphi, not Turbo Pascal 7.


type TCrap = object a : Integer; end;

...
var
b : TCrap;
begin
b.a = 1;
...
= no error.


This is not a definition of a Delphi class. It is old Turbo Pascal code. If I create a class like this
type TMyLovelyObject = class(TObject)
public
a : integer;
end;


...

var b: TMyLovelyObject;
begin
b.a := 1; //<<< Runtime error: access violation here (nil pointer dereference) >>>
end;


TP code is supported for backward compatibility reasons. The help discourages this kind of coding.

Backward compatibility is endemic throughout the computer industry for obvious reasons and is therefore extremely commonplace. The architecture of the Intel IA32 CPUs is a case in point. The 8086 was structured in a certain way for backward compatibility with the existing large base of code already written for the 8080 / 8085 processors. Likewise the Z80 CPU was backward compatible with the 8080/8085. Even today's Itanium CPU is backward compatible at code level with the 8086 at a certain level.

If we look at C++ and PHP as a couple of languages, both for backward compatibility reasons have the old languages included in them (specifically PHP5 which uses some new architecture), Delphi likewise. Of course you can go the route of say Jade and develop a completely new language and software architecture, and then develop everything from scratch. I don't intend to get into this debate which I'm sure could go on and on. But I write stuff in Delphi because I enjoy using it. If you don't enjoy your work, don't take it out on me.



Reply via email to