Board index » delphi » Re: Evangelizing

Re: Evangelizing


2005-09-18 01:23:49 AM
delphi69
Quote
Look at .Net 2.0, many (most?) of the new language features are
taken directly from the functional world.
Which features would they be?
Cheers,
Jim Cooper
__________________________________________
Jim Cooper XXXX@XXXXX.COM
Tabdee Ltd www.tabdee.ltd.uk
TurboSync - Connecting Delphi to your Palm
__________________________________________
 
 

Re: Evangelizing

Jim Cooper writes:
Quote
>Look at .Net 2.0, many (most?) of the new language features are
>taken directly from the functional world.

Which features would they be?
Things like anonymous methods and iterator blocks.
Yesterday, I found it quite weird to read an article about VB(Visual Basic) (9), and see
terms like lambda expressions, closures, query comprehensions...
msdn.microsoft.com/vbasic/future/default.aspx
Cheers,
Jarle
 

Re: Evangelizing

Jarle stabell writes:
Quote
I agree that behaviour is the core.
If we had dynamic dispatch for free-standing routines, and inheritance
for records, would classes give you anything essential that records
wouldn't except for information hiding?
(You wouldn't get private, protected, public scope, but then, these are
rather limited in the first place, another accessibility mechanism wouldn't
have to be very advanced in order to be an improvement)


As from blogs.teamb.com/RudyVelthuis/archive/2005/05/13/4311.aspx
In D2005 Strict private, Private, Public directive inside a record:
---
unit TestRecord;
interface
Type
TUrec = record
Strict private
StrictPrivateValue : integer;
Private
PrivateValue : integer;
Public
PublicValue: Integer;
end;
implementation
end.
---
program TestRec;
{$APPTYPE CONSOLE}
uses
SysUtils,
TestRecord in 'TestRecord.pas';
type
Trec = record
Strict private
StrictPrivateValue : integer;
Private
PrivateValue : integer;
Public
PublicValue: Integer;
end;
var TR : Trec;
TUR :TUrec;
begin
with TR do
begin
StrictPrivateValeur:=1;
PrivateValeur:=2;
PublicValeur:=3;
end;
with TUR do
begin
//StrictPrivateValeur:=1; // error E2003 : Identifier not declared
//PrivateValeur:=2; // error E2003 : Identifier not declared
PublicValeur:=3;
end;
end.
 

Re: Evangelizing

Quote
Things like anonymous methods
Hmmm. Just because methods can be declared inline? It still seems quite
procedural to me (and ugly). For example, anonymous methods can have
side-effects which is decidedly non-functional.
Quote
and iterator blocks.
I don't see the connection to functional languages here at all, sorry. That just
looks like an extension to the sort of generics that have existed in many
procedural languages for some time.
Quote
Yesterday, I found it quite weird to read an article about VB(Visual Basic) (9), and see
terms like lambda expressions, closures, query comprehensions...
Thanks for the link. Be interesting to see whether having a built-in query
language will make code more or less clear. I am not sure I entirely liked the
idea of anonymous types.
Cheers,
Jim Cooper
__________________________________________
Jim Cooper XXXX@XXXXX.COM
Tabdee Ltd www.tabdee.ltd.uk
TurboSync - Connecting Delphi to your Palm
__________________________________________
 

Re: Evangelizing

Quote
But I think this is just a design issue; I seriously don't consider that
it
is mandatory, under OO principles, that separate objects be created in a
case like this. I see nothing wrong with having one "list" object that is
designed to manage a block of raw data and present any single item or set
of
items from that raw data as needed in object form.
It is mandatory when those individual objects affect each other and can be
individualy observed, and accessed or modified simultaneously by multiple
threads. At least I think so. It seems to work, but has taken years of
ingenuity by various people to make it work fast enough.
Quote
E.g. assuming for example-sake that all 100,000 entities are of the same
type, then instead of creating 100,000 TSprite objects, the list class can
use *one* TSprite object as a "cursor" that is able to view any one of the
items in the list. If there is something that requires concurrent sprites
to
exist (interaction, comparison, etc) then the list can create as many as
needed, but that would still most likely only be a few at a time, and they
can be designed to be reused (set to view different sprite data) rather
than
contantly created and destroyed. That way you can maintain very efficient
raw loading of data and still get full benefit of OO access to that data.
How would you manage subject observer patterns like this, and how would it
scale to a tree structure rather than a list?
Quote
To put it another way, if the application is going to process one or a
small
number of objects at a time (especially if it is serially) then there is
no
value in having 100,000 objects created and existing at the same time
(that
is a waste in all cases, no matter the type of application), or to
serially
create and destroy the same type of object 100,000 times just because it
will look at different data.
Absolutely to the second part. But it is not a waste (in my current
understanding of the problem) to have many active objects interacting with
each other and therefore created simultaneously. Also if the amount of data
per object is significant (not sure what significant would mean here, but
lets say 200 bytes or more) or worse, there are child objects, the cost of
pointing your instantiated object at each data block in turn is expensive.
I'm afraid I can not give details of my solutions as we are way ahead of our
competitors' technology and I don't want to give them a head start.
Bryan
 

Re: Evangelizing

Quote
I'm afraid I can not give details of my solutions as we are way ahead of our
competitors' technology and I don't want to give them a head start.
Alternatively, you could explain it to them and make their heads hurt. At least,
that's what happened to me :-)
Cheers,
Jim Cooper
__________________________________________
Jim Cooper XXXX@XXXXX.COM
Tabdee Ltd www.tabdee.ltd.uk
TurboSync - Connecting Delphi to your Palm
__________________________________________
 

Re: Evangelizing

Jim Cooper writes:
Quote

Alternatively, you could explain it to them and make their heads
hurt. At least, that is what happened to me :-)
lol
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: www.logicfundamentals.com/RADBooks.html
"Nature abhors the vacuum tube." - J.R. Pierce, Bell Labs engineer who
coined the term 'transistor'
 

Re: Evangelizing

Bryan Crotaz writes:
Quote

It is mandatory when those individual objects affect each other and
can be individualy observed, and accessed or modified simultaneously
by multiple threads.
If literally a 100,000 objects (or a majority of them) must interact
concurrently on every 10ms frame update then that is certainly a tall order,
I've assumed some reasonable subset of them would be required for any given
frame, not all of them at once.
Quote
How would you manage subject observer patterns like this,
If you are not using objects, how are you using an observer pattern now? If
an item needs to do something that needs to be observed, then it would
necessarily have an object representation created at that point (in order to
do something anyway).
Quote
and how
would it scale to a tree structure rather than a list?
Again it would be a tree of objects actually being used instead of a tree of
all 100,000 items.
Quote
Also if the
amount of data per object is significant (not sure what significant
would mean here, but lets say 200 bytes or more) or worse, there are
child objects, the cost of pointing your instantiated object at each
data block in turn is expensive.
Don't follow this; pointing an object at some data is no different than
pointing a record pointer at it. The child objects possibly could be treated
the same, if they are in a raw stream somewhere than they can be pointed at
as required.
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: www.logicfundamentals.com/RADBooks.html
"The only reason some people get lost in thought is because it's
unfamiliar territory." - Paul Fix
 

Re: Evangelizing

"Jarle stabell" wrote
Quote
My favourite OO guru
Well don't be coy. Name? Publications available?
 

Re: Evangelizing

Bob Dawson writes:
Quote
"Jarle stabell" wrote
>My favourite OO guru

Well don't be coy. Name?
heim.ifi.uio.no/~trygver/
Quote
Publications available?
heim.ifi.uio.no/~trygver/www-documents-overview.html
Cheers,
Jarle
 

Re: Evangelizing

Quote
heim.ifi.uio.no/~trygver/www-documents-overview.html
Comments like this one (pg 4 of "Towards A New Discipline of
Programming") :
I no longer miss the once cherished goto-statement
are kind of scary :-)
This chap also doesn't seem to have heard of patterns. There are ways to do what
he wants without trying to invent a whole new programming paradigm.
Cheers,
Jim Cooper
__________________________________________
Jim Cooper XXXX@XXXXX.COM
Tabdee Ltd www.tabdee.ltd.uk
TurboSync - Connecting Delphi to your Palm
__________________________________________
 

Re: Evangelizing

Jim Cooper writes:
Quote
>heim.ifi.uio.no/~trygver/www-documents-overview.html

Comments like this one (pg 4 of "Towards A New Discipline of
Programming") :

I no longer miss the once cherished goto-statement

are kind of scary :-)
As he started programming around 50 years ago, he probably became quite used
to it. :-)
Quote
This chap also doesn't seem to have heard of patterns.
He invented the MVC pattern before I wrote my first goto. :-)
Cheers,
Jarle
 

Re: Evangelizing

Quote
As he started programming around 50 years ago, he probably became quite used
to it. :-)
Still no reason to cherish it
Quote
He invented the MVC pattern before I wrote my first goto. :-)
Then why does he seem to be going to inordinately complicated lengths to avoid it?
Cheers,
Jim Cooper
__________________________________________
Jim Cooper XXXX@XXXXX.COM
Tabdee Ltd www.tabdee.ltd.uk
TurboSync - Connecting Delphi to your Palm
__________________________________________
 

Re: Evangelizing

Quote
He invented the MVC pattern before I wrote my first goto. :-)
Also, he is not mentioned anywhere in the references in the GoF book.
Cheers,
Jim Cooper
__________________________________________
Jim Cooper XXXX@XXXXX.COM
Tabdee Ltd www.tabdee.ltd.uk
TurboSync - Connecting Delphi to your Palm
__________________________________________
 

Re: Evangelizing

"Jim Cooper" <XXXX@XXXXX.COM>writes
Quote

>He invented the MVC pattern before I wrote my first goto. :-)

Also, he is not mentioned anywhere in the references in the GoF book.
You seem to be spending a lot of energy trying to discredit this guy. Did he
kick your dog or something?