Generics (like C++ templates) in our future? 
Author Message
 Generics (like C++ templates) in our future?

Does anybody know for sure whether or not generics will be supported in C#
for the next release of VS.NET?

Will it be in the ECMA standard for the C# language?

yours,

// A stab at the potential syntax
generic <Matt_Griscom> GenericClass
{
...

Quote:
}



Fri, 24 Dec 2004 12:17:45 GMT  
 Generics (like C++ templates) in our future?

Quote:
> Does anybody know for sure whether or not generics will be supported in C#
> for the next release of VS.NET?

> Will it be in the ECMA standard for the C# language?

> yours,

> // A stab at the potential syntax
> generic <Matt_Griscom> GenericClass
> {
> ...
> }

http://research.microsoft.com/projects/clrgen/

Ryan LaNeve



Fri, 24 Dec 2004 13:23:31 GMT  
 Generics (like C++ templates) in our future?
I can only find old information here (at least 6 months) and nothing
definitive. There may be a reason that generics have NOT shipped with the
initial release from MS, and I'd just like to know with more confidence
whether they will be offered in future.

Thanks for any info


Quote:


> > Does anybody know for sure whether or not generics will be supported in
C#
> > for the next release of VS.NET?

> > Will it be in the ECMA standard for the C# language?

> > yours,

> > // A stab at the potential syntax
> > generic <Matt_Griscom> GenericClass
> > {
> > ...
> > }

> http://research.microsoft.com/projects/clrgen/

> Ryan LaNeve



Fri, 24 Dec 2004 21:08:08 GMT  
 Generics (like C++ templates) in our future?
Why are they so important? Just out of curiosity.

-c


Quote:
> I can only find old information here (at least 6 months) and nothing
> definitive. There may be a reason that generics have NOT shipped with the
> initial release from MS, and I'd just like to know with more confidence
> whether they will be offered in future.

> Thanks for any info





> > > Does anybody know for sure whether or not generics will be supported
in
> C#
> > > for the next release of VS.NET?

> > > Will it be in the ECMA standard for the C# language?

> > > yours,

> > > // A stab at the potential syntax
> > > generic <Matt_Griscom> GenericClass
> > > {
> > > ...
> > > }

> > http://research.microsoft.com/projects/clrgen/

> > Ryan LaNeve



Fri, 24 Dec 2004 22:32:59 GMT  
 Generics (like C++ templates) in our future?
Generics allow you to create type-safe generic collections. That is, you can
create a stack that can take any type, but that type must be defined at
run-time. Today collections take collections of objects, and then you
down-cast to the actual type when you extract the object. Generics are less
error prone but more complex.

-j

--
Jesse Liberty
Liberty Associates, Inc.
.NET Training & Programming
http://www.LibertyAssociates.com


Quote:
> Why are they so important? Just out of curiosity.



Fri, 24 Dec 2004 23:09:25 GMT  
 Generics (like C++ templates) in our future?
Important partly for intellectual curiosity, partly because I've written my
own typesafe collections wrapping .NET classes but it isn't determined at
runtime as Jesse mentions would be possible with generics.

In C++, the equivalent of "generics" are called "templates" and they are
extremely useful. I'd love to use them in my C# code.

Jesse, do you know whether generics will happen, or if they're blocked for
some reason? Maybe you would have mentioned this in your answer if you
knew...


Quote:
> Generics allow you to create type-safe generic collections. That is, you
can
> create a stack that can take any type, but that type must be defined at
> run-time. Today collections take collections of objects, and then you
> down-cast to the actual type when you extract the object. Generics are
less
> error prone but more complex.

> -j

> --
> Jesse Liberty
> Liberty Associates, Inc.
> .NET Training & Programming
> http://www.LibertyAssociates.com



> > Why are they so important? Just out of curiosity.



Fri, 24 Dec 2004 23:36:53 GMT  
 Generics (like C++ templates) in our future?


Quote:
> Why are they so important? Just out of curiosity.

        Well, the complete .NET Api objects can then be written using
        generics, so you can avoid casts / conversions from then on, like
        the silly conversions yuo have to do when you read data from a
        column of a data-table into f.e. an int variable.

        Also no more 'This cast is not allowed' exceptions.

        Because the .NET api is so complete, few implementations of
        users will have to use generics (or for C++ wizards: templates)
        in their own code, but if you would, you could. The .NET api
        by itself written using generics would be a big step up.

                FB

Quote:

> -c



>> I can only find old information here (at least 6 months) and nothing
>> definitive. There may be a reason that generics have NOT shipped with
the
>> initial release from MS, and I'd just like to know with more confidence
>> whether they will be offered in future.

>> Thanks for any info





>> > > Does anybody know for sure whether or not generics will be
supported
> in
>> C#
>> > > for the next release of VS.NET?

>> > > Will it be in the ECMA standard for the C# language?

>> > > yours,

>> > > // A stab at the potential syntax
>> > > generic <Matt_Griscom> GenericClass
>> > > {
>> > > ...
>> > > }

>> > http://research.microsoft.com/projects/clrgen/

>> > Ryan LaNeve

--
=======  You can't sell what's free  ====================================

Get my free, open source .NET software at   :  http://www.sd.nl/software
=========================================================================


Fri, 24 Dec 2004 23:48:29 GMT  
 Generics (like C++ templates) in our future?


Quote:
> Important partly for intellectual curiosity, partly because I've written
> my own typesafe collections wrapping .NET classes but it isn't
> determined at runtime as Jesse mentions would be possible with generics.

> In C++, the equivalent of "generics" are called "templates" and they are
> extremely useful. I'd love to use them in my C# code.

> Jesse, do you know whether generics will happen, or if they're blocked
> for some reason? Maybe you would have mentioned this in your answer if
> you knew...

        There is a big issue: what to do with the current, non generics
        using code that is written every day? -> 2 .NET api's, thus
        1 using no generics (the current one) and one using generics,
        or 1 generics based .NET api (thus a new one) with new compilers
        which compile code like this:

        ArrayList foo = new ArrayList();

        to:

        ArrayList<Object> foo = new ArrayList<Object>();

        (below the surface).

        I don't think they can pull that off in a short timeframe. The
        CLR has to change (it passes extra info around to methods),
        the API and the compilers, not a small thing to do.

        But because Sun is pushing generics in Java and the JVM, I don't
        think microsoft won't include generics in the CLR. And the longer
        they wait, the more code is written using the current api, which
        makes the issue about 'what to do with legacy code?' bigger by
        the day.

                FB

Quote:



>> Generics allow you to create type-safe generic collections. That is,
>> you
> can
>> create a stack that can take any type, but that type must be defined at
>> run-time. Today collections take collections of objects, and then you
>> down-cast to the actual type when you extract the object. Generics are
> less
>> error prone but more complex.

>> -j

--
=======  You can't sell what's free  ====================================

Get my free, open source .NET software at   :  http://www.sd.nl/software
=========================================================================


Fri, 24 Dec 2004 23:53:13 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Generics (templates in C++)- in our future?

2. generics (templates) what are they???

3. Future of C++ and Windows Programming :: C++

4. FUTURE SOFTWARE FUTURES

5. C++ compiler bug: template and non template function overload resolution

6. templates: does C# support templates (metaprogramming) as C++?

7. Abou C++ future

8. future of c++ ?

9. The future of C++ and VC++ ...

10. C/C++ Future - A standard proposal for numbers

11. continue to use ISO C instead of C++, java or future hypes

12. C++ and the future of C

 

 
Powered by phpBB® Forum Software