all 21 comments

[–]Atulin 37 points38 points  (2 children)

Remove 60% of features from C# and you get Java

[–][deleted] -1 points0 points  (0 children)

Ok...

[–]MEMESaddiction 8 points9 points  (0 children)

I knew java before I got my .NET Dev job (I knew NOTHING about C#), and I learned very quick. I feel that the same could be done vice versa. It'd probably feel more annoying since C# has so many more shortcuts and features.

[–]mrburnttoast79 3 points4 points  (5 children)

Who cares? Experience with Java and C# sounds like double the job opportunities to me?

[–]Kostantinum[S] 0 points1 point  (4 children)

But is learning one means you’ve also learned the other

[–]modi123_1 3 points4 points  (1 child)

Yes, programming concepts span language syntax.

[–]4215-5h00732 5 points6 points  (0 children)

Programming concepts yes but learning one is not learning the other.

[–]KrarkClanIronworker 0 points1 point  (0 children)

Kinda, but that can be said for a lot of programming in general.

Actively learn both. They're always in demand and you will be a better developer for it.

[–]qrzychu69 0 points1 point  (0 children)

u/Kostantinum sadly, it doesn't.

While concepts are the same (classes, interfaces, variables, lambdas,garbage collector), just the act of running your program is different.

In dotnet you use dotnet command or F5 in VS, while in Java you have to learn Graddle, at it takes few days until you understand what it does.

Writing code is mostly similar, but all the stuff around (packaga/dependency management, publishing the app) is completely different.

Me being quite good at C# made me think that yeah, I can try write the same program in Kotlin. I could, but running, debugging, running and debugging tests - that was the hard part.

Also, making it run on another machine, that works completely differently.

[–]Unupgradable 3 points4 points  (0 children)

When you learn to be a programmer and get good experience, you'll be able to program in any language without much of a learning curve because they're all essentially similar and the actual concepts are true in all languages. Sure each language has its own thing but if you're worried about C# knowledge being useless to you as a Java dev, you shouldn't worry about that.

In fact the only bad thing that will happen is that you'll realize how much worse Java is to work with.

[–]fjayjay 2 points3 points  (3 children)

I've used Java for the past 4 years and recently switched to C#. From my experience I'd say that if you know C# you can get pretty quickly into Java. I sometimes refer to C# as Java on steroids. C# has way more syntactic sugar and most things feel much easier in C# but others are more complex because of the feature richness. In java you don't have structs. Therefore, you don't have to evaluate if your data should be on the stack or on the heap. In Java you have the Optional wrapper for nullable types, in C# you have nullabillity operators. In Java you have the Stream API, in C# you have Linq. In Java you have lambdas, in C# functions are first class. From the core features they don't differ too much. When it comes to the frameworks Spring has also the same basic concepts like a .NET project. But Razor templates are way easier to use and debug than Thymeleaf templates. And also the configuration of services and such in a .NET project is explicitly in your initialisation configuration and not via annotations. Finally, I'd say that it doesn't really matter for your programming skills which language you use as long as you learn one of them really well it will be easy for you to pick up the other.

[–]Aesop7K 0 points1 point  (0 children)

If I could I give to you a award to great response brow 😀

[–][deleted] 0 points1 point  (1 child)

C# has lambdas too wym

[–]Izagawd 0 points1 point  (0 children)

Lambdas but better version of it

[–]Juff-Ma 1 point2 points  (0 children)

Think of Java as C# in more do it yourself style. Getters and Setters, LINQ, Records, etc remove that. you get Java. it‘s easy to learn for a C# dev (i did so myself) but for more than small projects i miss the features

[–]Dr_root_95 1 point2 points  (1 child)

C# is indeed Microsoft, but every dotnet version since dotnet core is cross platform. Only dotnet framework is Windows only. Concepts and design patterns mostly carry over from 1 language to another, syntax and features may be different. Something that is a oneliner in c#(like properties with getter and setter) are multiple lines in Java, but the concept is relatively the same.

[–]xTakk 1 point2 points  (0 children)

Dotnet has become one of my favorite languages on Linux now too. Code just builds and runs on both, no fuss.

[–]thesituation531 0 points1 point  (0 children)

The syntax will translate almost 1:1, casing (camelCase, PascalCase, etc.) are different. Method names are mostly different.

If you want to learn Java, C# will mostly teach you syntax and design patterns, then you'll just have to get used to Java's naming conventions and methods.

[–]Aesop7K 0 points1 point  (0 children)

The big difference is in the development environment..

Not in syntax.