Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith <jsmith@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Sep 2007 12:16:47 +1200
In article <46f08b71@xxxxxxxxxxxxxxxxxxxxxx>, David Clegg says...
I humbly apologise for attempting to help you in what I thought was a
genuine quest to determine where generics can be useful outside of the
oft quoted example of type safe containers.
And I humbly apologise for pointing out that the article you used as
reference did no such thing.
Your actions in this
sub-thread (and others as well) strongly suggest to me that you are
more interested in nit picking and fighting than actually finding out
if generics may be useful.
Quite the reverse, but the abject failure of anyone (so far) to provide
any such evidence, despite often thinking that they have done so, is
quite illuminating in and of itself.
I am reminded of The Emporers New Clothes....
I suspect your mind has already been made up
on this, so any example shown to you is then manipulated in such a way
as to support your current stance.
Give me an example that shows what you think it shows, then we can talk.
Your reference article thus far cited an example that it did not provide
and which would suffer numerous problems that even you seem to accept
make it a less than useful example.
The example it DID provide was in itself a good one, albeit clumsily
implemented - it SHOULD have shown a generic METHOD, not a generic TYPE,
since in the form in which it was presented it was arguably more
cumbersome and unwieldy to use than an overloaded function (and the
algorithm that it provided was hardly the sort of thing that would be
arduous or risky to repeat in overloaded methods as needed - the sort of
example, in other words, that shows how generics are a lazy mans tool,
not a genuine contribution to code quality/productivity).
Which is not to say that such an example does not exist or that such a
case cannot be made, just that this isn't it.
Also, the article didn't fully explore (or make the case for) the
benefits - and disadvantages - that accrue from using a generic
approach.
e.g. an array reverser might have hade a good example if approached
correctly.
How about an array copier?
In a generics based approach you would have to size a new array and copy
each member one item at a time from one array to the other.
In an overloaded approach you can exploit the fact that you are NOT
restricted to a type-agnostic approach in some cases. So for an integer
array, where you know that the array is 4 x array length bytes in size
you can allocate a chunk of memory and just CopyMemory() the entire
array in one go.
What about discussing the potential risk to productivity/code quality
that having a needlessly diverse array [sic] of approaches to any one
problem could lead to?
If there is no such risk, an exploration of how we can know that might
be useful.
--
JS
www.deltics.co.nz
.
- Follow-Ups:
- Re: Announcing CodeGear RAD Studio 2007
- From: David Clegg
- Re: Announcing CodeGear RAD Studio 2007
- References:
- Announcing CodeGear RAD Studio 2007
- From: Tim Del Chiaro \(CodeGear\)
- Re: Announcing CodeGear RAD Studio 2007
- From: Bruce McGee
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: Bruce McGee
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: Bruce McGee
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: Marco Caspers
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: David Clegg
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: David Clegg
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: David Clegg
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: David Clegg
- Re: Announcing CodeGear RAD Studio 2007
- From: David Clegg
- Re: Announcing CodeGear RAD Studio 2007
- From: Jolyon Smith
- Re: Announcing CodeGear RAD Studio 2007
- From: David Clegg
- Announcing CodeGear RAD Studio 2007
- Prev by Date: Re: 3rd Rail newsgroups.
- Next by Date: Re: Delphi 2007 and dual monitor support
- Previous by thread: Re: Announcing CodeGear RAD Studio 2007
- Next by thread: Re: Announcing CodeGear RAD Studio 2007
- Index(es):
Relevant Pages
|