Re: Delphi 2007 Language Feature: Generics



In article <45b3ea7e$1@xxxxxxxxxxxxxxxxxxxxxx>, Micha Nelissen says...
Jolyon Smith wrote:
One key different that I see is that a generics based solution cannot be
thoroughly tested due to the infinite set issue that I touched on
before.

I think this is already a problem with all software.

I guess the difference is that I don't see this as an excuse, let alone
a justification, for making things worse (by increasing the ways in
which bad developers can demonstrate their ineptitude) at least not in
this case.

aiui generics are pretty much a necessity to avoid performance problems
with the boxing/unboxing that can occur in non-generics equivalent
implementations in .net.

i.e. it is a language feature driven by an environmental imperative.

In much the same way that partial classes are/were driven by the need to
better separate runtime initialisation of design-time artefacts from the
rest of the runtime code.

Take these things away and there remains little else (imho) to justify
either generics or partial classes, and lots to be said against them
(especially w.r.t partial classes).


I can't otherwise think of any other reason why these two technologies
would have remained in the realm of language design, rather than
language implementations, for so long.

It seems to me that the clamour for them now is driven primarily by the
language equivalent of "Keeping Up With The Jones'".

If someone could point me at a real-world exploration of the tangible
benefits that generics brings to practical software development I would
be genuinely interested.



i.e. a TCustomerList can be demonstrably proven correct. A TList<Any>
can only be shown to be correct for a given subset of <any>, which
doesn't establish correctness for all <Any>

No, you can make assumptions on the 'Any', so that you can finish your
proof.

IIRC, a proof that contains an assumption by definition isn't a proof?

I am reminded of "2 + 2 = 5 (for sufficiently large values of 2)"

;D


--
Jolyon Smith
Say, do any of you guys know how to Madison?
.



Relevant Pages

  • Re: Static vs. Dynamic typing (big advantage or not)---WAS: c.programming: OOP and memory management
    ... >> cannot be made in statically typed languages. ... > untyped by definition (i.e. enumerations, generic collections, dictionaries ... a dynamically typed language this type is not named but assumed. ... In a statically typed language generics and ...
    (comp.object)
  • Re: Static vs. Dynamic typing (big advantage or not)---WAS: c.programming: OOP and memory management
    ... >> cannot be made in statically typed languages. ... > untyped by definition (i.e. enumerations, generic collections, dictionaries ... a dynamically typed language this type is not named but assumed. ... In a statically typed language generics and ...
    (comp.programming)
  • Re: User-defined type attributes (replacing genericity)
    ... What's wrong with having control over the semantics? ... (Control over the semantics of the language. ... But the compiler is in an even worse position. ... Sorry, but it is generics which constitute a meta language, so this ...
    (comp.lang.ada)
  • Re: why doesnt ruby have generics?
    ... Why would you bind to a type in a language that doesn't really care ... cannot have generics in a language whose variables are typeless as ... Listin Java.) ... In Ruby you can do neither: you cannot cast because variables are ...
    (comp.lang.ruby)
  • Re: Partial classes not good OO design
    ... In addtion to what some of the others has said, I believe partial classes ... allow some other language features to be possible. ... problematic improvements I've generated in that short time. ... Then I run across this partial class feature. ...
    (microsoft.public.dotnet.framework)