tags:

views:

107

answers:

5

What is the most prohibitive aspect of having a universal comment identifier for all .net languages?

For example, in each language the symbol "??" would identify a comment. (I'm not saying that it should be "??"... just an example.)

A: 

Backwards compatibility is probably the biggest problem with changing the comment token.

David
Yes. Thank you for answering my question.
+3  A: 

In C#, the '??' operator denotes null coalescence. Repurposing this for comments would render a large amount of code non-operational.

I know you said it's just an example, but this is the problem you're facing - finding a single token that isn't used in any .NET language. I don't think it's a practical goal.

One of the goals of .NET was to allow multiple languages to target the runtime environment, while allowing those languages to retain their own distinction. Your idea runs directly against the grain of this goal.

Erik Forbes
+2  A: 

I don't really see a point to having a "universal comment identifier" any more than I see a point to unifying the way .NET languages implement looping constructs or class constructors. At some point, you'll be unifying-away the uniqueness of each language and we'll all by writing IL.

Jim H.
+1  A: 

I'd be happy if the universal comment indicator was // ... But then that's because I'm used to c/c++/java/c#. :-) they're the majority anyway, right? ;-)

mezoid
Agree!
TheSean
+1  A: 

Something you might want to look at is Xml comments. Each language retains it's own comment identifier, but the schema used for the comments is the same across all languages and the compiler for that language knows how to strip them out into an xml file that works with intellisense.

Joel Coehoorn