Tech Off Post

Single Post Permalink

View Thread: Features you like added to vb.net, c# or any other .net language.
  • User profile image
    spivonious

    AdamSpeight2008 said:

    The ability to blend the different .net languages in a the same sourcecode, through the use of a new # tag.

    Just like vb.net has XML Literals.

     

    #Language="vb.net"
    Public Module Module1
    
     Sub Main()
    Dim n1 As Double=2
    Dim n2 As Double=3
    Dim result = Addition(n1,n2)
     Console.WriteLine(result)
     Console.ReadKey()
     End Sub
    #EndLanguage
     
    #Language="c#"
     public  double Addition(double x, double y) {
     return x + y;
    }
    #EndLanguage
    

    The c# is probably wrong (not my best) but you get the gist.

    Developers coding in prefered language.

     

    I don't think it be that hard to implement, all the required mechnisms are already built; the compilers. It may need a new linker.

     

    Blending languages would be nice, although I'd be happy with files being in one language but projects being in multiple. So if I find a neat class on the web that's in C# but I want to use it in my VB project, and I don't want two DLLs, I don't need to translate the C# to VB (and inevitably introduce errors).