On Sun, Jan 11, 2004 at 10:47:18PM -0800, Neil Parker wrote:
> >Object Pascal is probably the target to aim for, and a compiler that
> >supports Object Pascal is (or at least was) necessarily a superset of
> >Borland Pascal.  Neil can comment about how much Delphi has evolved since
> >the 16 and early 32 bit days I hope.
> 
> Not as much as you might think.  I've only been seriously exposed to three
> points along the Borland Pascal evolutionary continuum:  Turbo Pascal 3.0,
> Delphi 4, and Delphi 6.  Though Delphi 4 is clearly a descendent of Turbo
> Pascal, so much has been added that it's practically a whole new language.
> Lots of new classes were added between Delphi 4 and 6, but the language
> itself doesn't seem to have changed in that interval.

I generally meant between versions of Delphi.  I know the evolution of
Pascal through Delphi 2.


> Delphi's support for classes feels like it's been ripped right out of
> Java.  I consider this a plus:  Java's class model always struck me as
> much cleaner than the complex and unwieldy C++ class model.  The
> predefined classes that ship with Delphi, however, don't bear much
> resemblence to Java's class library...you get lots and lots of support for
> Windows API objects and COM and Active X and web services and the like,
> but not much in the way of abstract data type classes (the latter is
> sometimes annoying--I have occasionally wished Delphi came with something
> like a Perl %hash or a Python dictionary (well...TStringList can be
> shoehorned into service, but it's just not the same)).

TStringList is definitely not the same.  =)  It probably wouldn't be hard
to write one, but like C++ you'd need to write objects for all of your
primative data types which do not have one already conveniently usable.
This is annoying about Java as well, but they at least thought about it in
the design of the language.

> Yes, Pascal supports pointers.  But you don't use them as much as you do
> in C--Pascal's ability to pass parameters by reference eliminates one of
> the major uses of pointers in C.  Delphi implements classes with pointers
> just like Java does, but (also like Java) it works very hard to prevent
> you from needing to know that.

Pascal's pointer syntax is a little confusing for newbies.  "Was it
^foo.bar, foo^.bar, or foo.^bar I wanted?"  The usual advice I have seen
newbies who have managed to get them to work (but still don't understand
them) is "don't use any ^s at all, then try to compile it.  Put one where
it complains you're missing one."  I went on a long explanation which
involved borrowing a set of those brightly colored plastic things from a
kid for a day.  You know, the ones that have aa connector on one end and a
hole on the other to form a chain.  Less than half my audience got it.
The other half followed that other piece of advice.  *shudder*

Pass by reference is one of the major saving graces of C++ if you ask me.
Most programmers tend to use a lot of globals in C because it's easier
than dealing with C's passing mechanism.  Bleh.

_______________________________________________
EuG-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug

Reply via email to