Wednesday 18 May 2016

C# better than java or not???

Here are a few things C# now has that Java does not:

Lambdas, which are route superior to anything mysterious internal classes. (C# has unknown inward classes, as well.)

Delegates. You can sort of do this in Java, however it's not as perfect.

Administrator over-burdening. This component can be manhandled all to hellfire, however it is still every so often valuable, particularly in libraries and in DSLs.

Wherever C# online training gives you the clarity why C# is better than java.

Properties. No compelling reason to compose getters and setters. Everything resembles an immediate field access, regardless of the possibility that it isn't. This is Python's colloquialism, and Scala's, as well, and once you begin utilizing it, you never need to uncover unequivocal getters and setters, until the end of time. foo.x += 1 is quite a lot more clear than foo.setX(foo.getX() + 1).



A yield coroutine capacity. Despite the fact that I favor Python's language structure (and Scala's) to C#'s, this is an intense and very helpful ability. On the off chance that you've ever utilized it to fabricate apathetic iterators (in Python, Scala, C#, whatever), you recognize what I mean.

Augmentation techniques. These are what might as well be called the Scala verifiable sort transformation include, and they're cursed helpful. They allow you to "broaden" existing classes, regardless of the fact that they're last, without really expanding them. Like the Scala form, there's a component for getting the verifiable changes scope; they don't happen consequently. (Consider them a sort of degree controlled monkeypatching.)

(Note: As Tony Morris calls attention to, in the remarks to this article, expansion techniques are not by any stretch of the imagination what might as well be called Scala's verifiable sort transformations; Scala's implicits are substantially more effective. Still, unmistakably C# has obtained one helpful part of this thought, and it's similarly clear that Java does not have a component that is even remotely near either Scala's implicits or C#'s augmentation strategies.)

An invalid combining administrator that gives a basic linguistic structure to dereferencing a reference and supplying a default if the reference is invalid.

Likewise, C# has a large portion of the same elements as Java, including:

interfaces

generics

autoboxing and auto-unpacking

explanations (however C# calls them "qualities")

Despite everything I lean toward the JVM to CLR. The JVM is vigorous, full grown, quick, and (most importantly) versatile. Be that as it may, Java, the dialect, has fallen behind, and it now does not have a considerable measure of the helpful elements C# has. One reason I'm all over Scala nowadays is that it revises those imperfections in Java, giving numerous a la mode highlights while as yet allowing me to utilize the force and comfort of the JVM. Either by means of libraries or constructed ins, Scala gives the same components as C#, with a couple of more tossed in for good measure. (I additionally happen to think Scala is a superior dialect than C#, however I'll spare that digression for some other time.) But, in the .NET world, C#, not Scala, is the most widely used language. Furthermore, C#, and .NET, are the greatest hearts-and-brains contender Java has.

Sun and the Java people group have permitted Java, the dialect, to stagnate to the point where, contrasted with C# and Scala, it is verging on difficult to utilize. As a long-lasting Java software engineer, I need to say, that makes me somewhat miserable.

No comments:

Post a Comment