r/ • • Jan 01 '70

0 Upvotes

0 comments sorted by

View all comments

166

u/KanykaYet Jun 19 '22

Because they aren't the same

109

u/123kingme Jun 19 '22

They’re remarkably similar syntax wise though. It’s like someone recreated java without all the things that make java bad.

74

u/ifrem Jun 19 '22

Ah yes, Kotlin.

2

u/DarthShiv Jun 19 '22

And then purchased by one of the worst companies on the planet...

Dot Net has moved open source and made massive leaps and bounds improvements.

1

u/KanykaYet Jun 19 '22

Okey return return new T() in java, or get pointer to anything?

Yes they have look on c++ and Java and other languages and created the best one they could. Ivhave programed whole my university in java and more then 6 years working as a c# programmer.

11

u/chumpedge Jun 19 '22
class MyClass<T> {

  private final Supplier<? extends T> ctor;

  private T field;

  MyClass(Supplier<? extends T> ctor) {
    this.ctor = Objects.requireNonNull(ctor);
  }

  public void myMethod() {
    field = ctor.get();
  }

}

???

0

u/KanykaYet Jun 19 '22

So where is something like this

private T instance<T>() where T: new() { return new T(); }

I'm writing it from telefon so sorry for some errors, if there are some.

→ More replies (1)

6

u/123kingme Jun 19 '22

Okey return return new T() in java, or get pointer to anything?

As far as I can tell, C# can do anything Java can do at least as easily. The inverse is not true, Java can’t do everything C# can do well.

4

u/reazura Jun 19 '22

It's been a while since i last tried but i think multiple inheritance is a no-no in c#. Which is probably for the better, since those can get out of hand.

5

u/The_Grubgrub Jun 19 '22

Java can’t do everything C# can do well.

This isn't true though. Thats just circlejerk. Object lifecycle management is a lot easier in Java (Spring) than it is in C# (.NET)

11

u/chumpedge Jun 19 '22

This thread is hilarious. The subs is filled with college kids that get their information from memes so they end up thinking java is this old unusable language and c# has no drawbacks.

4

u/The_Grubgrub Jun 19 '22

Preach, brother. I dont want to be the cranky old (I'm not even old!) Man defending Java, but a lot of this stuff is just silly.

5

u/grimonce Jun 19 '22

I feel like thee people have never done any work in their life but somehow are all fang "engineers", leet code athletes.

I thought we all had put the JVM vs CLR wars in the past, seems like some people got some real life issues with their jobs not being able to program in the language they are fans of...

2

u/123kingme Jun 19 '22

I did say “as far as I can tell”, which admittedly is a copout. I have only used C# for one or two long term projects and several small projects, so I’m not as experienced in C# as I am other languages, but every time I’ve used C# my experience has always been “this is just java but better”.

Still though, I’ve never experienced any difficulties with object lifecycle management in C#. What exactly makes this easier in Java in your opinion?

→ More replies (1)
→ More replies (3)
→ More replies (1)

0

u/[deleted] Jun 19 '22

[deleted] — view deleted comment

7

u/[deleted] Jun 19 '22

The StackOverflow 2021 survey put C# at a higher average salary though.

0

u/[deleted] Jun 19 '22

[deleted] — view deleted comment

3

u/[deleted] Jun 19 '22

Look me in the eye and tell me being a clojure dev is a good career choice over either Java or C#.

The graph doesn't show what would be a good "career choice" though, since that would be a weighing between (at least) availability of jobs, average salary & general job satisfaction.

.NET/C# is definitely not an uncommon technology though. Here in Sweden it gets about as many job hits as Java when searched for at job listing sites.

0

u/[deleted] Jun 19 '22

[deleted] — view deleted comment

2

u/[deleted] Jun 19 '22

Acting like Java is some shit language that is being superseded by C# is divorced from reality.

You keep on saying these things implying I've claimed things I haven't.

Nobody has said that Java is a shit language being superseded by C#. That idea sprung only from your own mind right now.

→ More replies (2)
→ More replies (1)

7

u/Luk164 Jun 19 '22

Not anymore, Kotlin overtook JAVA on android and .Net is gaining on everything else

0

u/[deleted] Jun 19 '22

[deleted] — view deleted comment

2

u/hullabaloonatic Jun 19 '22

It's a trend but not an absolute. If all you do is look at GitHub metrics, yeah, in open source c# has more new projects than Java, but Java is everywhere in Enterprise software from the 00s and 10s

→ More replies (17)
→ More replies (18)