3

Ok. Question: Can someone please explain how is C# different from Java? Like major differences..☺

Comments
  • 2
    JVM vs. .NET, but honestly I don't understand low level of .NET.

    Nuget vs. Jars

    Linq vs. idk

    Iheritance, most of the syntax, garbage collection, the biggest difference is PascalCase and camelCase
  • 5
    One starts with a C,
    The other with a J.

    Both are weirdly verbose and kinda creep me out.

    C# tries to be fancy, but just ends up really awkward. Java is more boring, but makes more sense.
  • 0
    @gorsamp Its in my final year of engineering and I find that I can write programs with almost the same syntax as java with minor modifications... 😂
  • 0
    @Ashkin yeah. The effort to type stuff out...😧😧
  • 1
    @irene This is the answer i was looking for.. 😂😂😂 At times I think microsoft just copied out the entire java stack
  • 3
    last time I wrote Java was ages ago, but C# added some nice stuff since it started out as a Java clone, a few:

    Linq

    async/await, TPL

    var something = myObject?.MyProperty?.AnotherValue; //null conditional

    (var a, var b) = GetStuff(); //deconstruction

    GetStuff(someInput, out string someOutput); //out declaration

    dynamic x = GetBla();
    x.NewProperty = 1; //dynamic

    private void DefaultParam(int v, int x = 0); //default parameters

    var str = $"this is {myVariable}"; //string interpolation

    those are a few things I didn't see in Java, not sure if any similar features were added to it

    search C# 3, 4, 5, 6, and 7 features. starting with 3.0 a lot has been done
  • 0
    also .net core, .net standard, and Xamarin
  • 0
    Doesn't c# also compile quite differently and is not VM based?
  • 0
    @irene Welp yeah, just researched, .net IS VM based... My bad :)
  • 0
    C# is basically an more advanced version of Java with more versatility
  • 0
    I once wrote a lambda function in C# that took three lines, and is till nice and easy to read
    Wrote same shit in Java 8 and it took 7 lines and has fucking ugly look.

    Microsoft created C# to compete with Java, made it it look so similar so that Java devs can have an easy transition.

    Microsoft originally had only VB and now they sort of ignore VB in favor or C#.

    Basically they just solved Java code mess and delivered it in a neater way then started adding their own features.

    The ones I love the most is LINQ, Optionals (new feature thought), async/await/yield and of course it is not VM based
  • 1
    Huh? @gitpush @irene

    Now i am confused.. is .net vm based or not?
  • 0
    @jeanlucami sorry my mistake, CLR is a vm what I should have said is it is not JVM based, because I'm using Kotlin, though it has good performance but it still needs JVM, and Microsoft was kind enough to create their own CLR and get us done with that issue
  • 1
    @gitpush thank you :)

    It's true, devrant is an overall nicer experience than everything stack overflow :D
  • 1
    @jeanlucami yup a so much better place than StackOverFlow :D
  • 0
    @xalez Thanks for the reply!
  • 0
    This has been a really illuminating thread!
Add Comment