Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
gorsamp19507yJVM 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 -
Root825997yOne 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. -
@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... 😂
-
@irene This is the answer i was looking for.. 😂😂😂 At times I think microsoft just copied out the entire java stack
-
xalez19377ylast 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 -
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 -
@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
-
@gitpush thank you :)
It's true, devrant is an overall nicer experience than everything stack overflow :D
Ok. Question: Can someone please explain how is C# different from Java? Like major differences..☺
question