The C# Design Process

[quote]Does the above imply that information about Type (Type ~= class name?) is indeed saved or not? ???
[/quote]
That’s just the statically compiled type parameter information. You can’t retrieve the actual type a class was instantiated against. Type erasure means that the types aren’t carried around at runtime - the information just isn’t there, in any form or fashion.

God bless,
-Toby Reyelts

[quote]Argh! Confusion reigns. I don’t care, so long as it means I don’t have to type so much.
[/quote]
Confusion only reigns because people can’t be bothered to RTFM.

As far as less typing goes, generics will save some casts here or there, but it sure won’t help out those people (say everybody who posts to this board) who need primitive-based, parameterized collections.

God bless,
-Toby Reyelts

…but it will greatly help library and middleware authors. We actually seriously considered the insane step of using a beta JVM (1.5) for a production system, because of the amount of programmer time it would save.

I’m not sure that greatly is the expression I’d use, but the JDK1.5 language is a significant improvement over 1.4, even if generics aren’t all they should have been.

As far as the 1.5 beta goes, I wrote a tool, Retroweaver, that translates 1.5 class files to 1.4. So we compile with JDK1.5 beta, taking advantage of generics, extended for loops, static imports, yada yada, and we deploy to a production 1.4 VM. So, maybe you should reconsider using 1.5. :slight_smile:

Check it out - http://retroweaver.sf.net

God bless,
-Toby Reyelts

@Metadata seems to have been overlooked. To my mind it appears to be as useful as generics, if not more so. The amount of crappy boilerplate code I keep having to write is just insane. How excellent is it that I can automate most of it with metadata? :slight_smile:

And how un-excellent is it that I can’t use 1.5 properly in Eclipse? :frowning:

Cas :slight_smile:

[quote]And how un-excellent is it that I can’t use 1.5 properly in Eclipse? :frowning:
[/quote]
Most (or possibly all) existing IDE require upgrades to work with 1.5. In at least some cases this is true even if you don’t use the new features (because they don’t understand the new classfiles).

[quote]@Metadata seems to have been overlooked. To my mind it appears to be as useful as generics, if not more so.
[/quote]
For me, it seems both useful and dangerous. One of the strengths of java was inability to create your own dialects of language (which was possible in C with heavy use of macros). I’m afraid that with overuse of metadata, you can become lost with number of magic modifiers which will appear in class definition and change way it works in program in subtle ways.

Not that there is any viable alternative - putting metadata in separate config files (like currently in J2EE) is probably even worse. But at least it was tiring enough for people to use it only when really needed, not just-for-fun.

I wonder what will happen when aspectj will meet metadata (pointcuts on annotations seems most obvious).

Me too. For a lot of the boiler plate I encounter in java, there are more elegant or less dangerous ways of generating it than metadata (sometimes as simple as just more intelligent use of OO; or the use of 3rd part libs that go to great pains to make it easy fo ryou to not need to boilerplate nor need to use something as powerful as metadata). But IME nothing that comes close to being one unifying “always at least as good or better than metadata”; you’d need a whole bag of tricks instead.