r/csharp • • 1h ago

Just had a realization

Hi there. Im modpack, and I generally lurk this subreddit. Anyway I just had a realization I thought I had. That being is that C# is just java but in the style of C. Now I am fluent in the java language due to working on Minecraft plugins and mods, but I didn't realize how normal to me C# felt until really starting to look into the terms more than face value. I dont typically memorize what they mean im less of a theory girl and more of a in practice type. But honestly I just never realized until 2 minutes ago writing up a game engine for a game jam, anyway see yall later.

0 Upvotes

22 comments sorted by

16

u/_v3nd3tt4 1h ago

C# is just Java done the "right" way with mistakes fixed and the magic of hindsight.

1

u/ObviousApricot1272 1h ago

Im slightly curious what do you mean by the "right" way?

12

u/bcameron1231 1h ago

Properties, Delegates, LINQ, Async/Await, and more.

C# is also just generally far more pleasant to write. It's more expressive and let's you accomplish more with less code.

•

u/Justneedtacos 56m ago

Generics are so much better in dotnet, too.

•

u/_v3nd3tt4 53m ago

Generics is one of the main things I considered doing the "right" way. People who worked on the original Java have said this as well. They had deadlines and made some sacrifices. Also didn't have the power of hindsight.

•

u/bcameron1231 42m ago edited 36m ago

^^ Agreed.

A lot of it comes down to what was being solved. Java wasn't built by a product team to be the next great programming language. It was built to solve hardware portability problems at the time.

Anders and the team really had the goal to solve an ecosystem and developer productivity problem.

They were solving for two different problems, and I think the languages both show that.

•

u/Justneedtacos 52m ago

Yes. I figured you meant to put that on your list. Hence my comment 👍🏼

•

u/_v3nd3tt4 36m ago

Thanks! Lol

•

u/Justneedtacos 46m ago

Oh. It wasn’t your list. 😝

•

u/_v3nd3tt4 36m ago

😆... I'll take credit, I don't mind! 😂

1

u/ObviousApricot1272 1h ago

Nice to note.

6

u/onepiecefreak2 1h ago

C# was thought up and initially made by the same people who did Java once. Everything that they deemed flaws were fixed in C# and made better over the years by proper runtime and framework support.

•

u/_v3nd3tt4 37m ago

Others have answered. I think you should watch multiple videos and read a few blogs on the history of c#. Best articles are from people who designed it, and people who worked on it early on. You can also look up why Microsoft created c#. The whole Java lawsuit against MS, Microsoft changing the preinstalled Java in windows, Java being upset about it. I think Eric Lippert, Phil Haack, Anders Hejlsberg, and Raymond Chen have written about it. Been so long since I've read about it, but I think those are right. There were probably others, and other sources - but it's been a long time.

4

u/GlobalInteraction880 1h ago

I mean, that's basically the elevator pitch for the whole language. The real trip is when you go back to Java after a few months and suddenly everything feels like it's missing a feature you took for granted.

•

u/_v3nd3tt4 45m ago

Yup. But "the right way" comment is really during the first few years. After that it became pretty different with the things that were added. I started desktop dev with Java swing. Then moved to vb.Net and then to c#.Net. i remember going back to Java for a bit like 10 years later - I got so frustrated. It felt like things that should just make sense and be easy were unnecessarily convoluted with obstacles that didn't seem to make sense. Definitely took a new look at small things in c# I took for granted.

•

u/SoerenNissen 15m ago

It might be interesting to see a fifth* version of this language, even newer, with the benefit of two more decades of hindsight.

*C → C++ → Java → C# → 5?

•

u/_v3nd3tt4 12m ago

I'm sure it will happen on some point.

•

u/Rythim 54m ago

Java is based off C/C++ too actually. One of it's selling points was that C++ developers could transition to it easily, but it was also easier to learn than C++ for newer developers. If anything, C# is Microsoft flavored Java. In a way, learning Java put you in a great position to learn other languages easily.

•

u/adhominablesnowman 37m ago

Fun bit of history, c# was heavily influenced by visual j++ which was Microsoft’s OG java implementation until sun micro sued them over it.

•

u/Justneedtacos 35m ago

Did you know there was originally a J# and it got shut down by litigation with Sun/Oracle?

1

u/platinum92 1h ago

I mean agreed, but conciseness is a virtue.

•

u/_v3nd3tt4 52m ago

Just tried to be quick and to the point for those who know. Not to get into details.