As a dev who works on both Java and C# code, modern Java (17+) and C# feel almost exactly the same (not sure if Java has extension methods though).
Bonus points for using Kotlin instead tho. I dislike both Java and C# just because they both allow any object to be null and that’s usually a headache whenever a null exception shows up.
The only thing I like better about C# is the Fixture library for testing. I haven’t found any mature libraries like it for Java yet.
they both allow any object to be null and that’s usually a headache whenever a null exception shows up.
C# has nullable reference types now: https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references. If you enable it, you have to explicitly make reference types nullable (like ?string) and you’ll get build warnings if you try to use a variable that’s potentially null.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
Hahaha I’ve never heard that before. Seems legit.
C# was originally “Java: The Good Parts” but but these days it’s a much more advanced language and runtime compared to Java.
As a dev who works on both Java and C# code, modern Java (17+) and C# feel almost exactly the same (not sure if Java has extension methods though).
Bonus points for using Kotlin instead tho. I dislike both Java and C# just because they both allow any object to be null and that’s usually a headache whenever a null exception shows up.
The only thing I like better about C# is the Fixture library for testing. I haven’t found any mature libraries like it for Java yet.
C# has nullable reference types now: https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references. If you enable it, you have to explicitly make reference types nullable (like
?string
) and you’ll get build warnings if you try to use a variable that’s potentially null.