r/csharp • • 2d 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

24 comments sorted by

19

u/_v3nd3tt4 2d ago

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

6

u/GlobalInteraction880 2d 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.

3

u/_v3nd3tt4 2d 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.

1

u/ObviousApricot1272 2d ago

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

15

u/bcameron1231 2d 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.

10

u/Justneedtacos 2d ago

Generics are so much better in dotnet, too.

6

u/_v3nd3tt4 2d 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.

3

u/bcameron1231 2d ago edited 2d 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.

2

u/Justneedtacos 2d ago

Yes. I figured you meant to put that on your list. Hence my comment ๐Ÿ‘๐Ÿผ

1

u/_v3nd3tt4 2d ago

Thanks! Lol

1

u/Justneedtacos 2d ago

Oh. It wasnโ€™t your list. ๐Ÿ˜

1

u/_v3nd3tt4 2d ago

๐Ÿ˜†... I'll take credit, I don't mind! ๐Ÿ˜‚

1

u/ObviousApricot1272 2d ago

Nice to note.

7

u/onepiecefreak2 2d 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.

1

u/_v3nd3tt4 2d 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.

1

u/ObviousApricot1272 2d ago

All right I will look for that ty for the advice

2

u/SoerenNissen 2d 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?

2

u/_v3nd3tt4 2d ago

I'm sure it will happen on some point.

5

u/Rythim 2d 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.

1

u/adhominablesnowman 2d 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.

1

u/Justneedtacos 2d ago

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

1

u/Best_House07 2d ago

C# did feel cozy coming from Java yeah

1

u/platinum92 2d ago

I mean agreed, but conciseness is a virtue.

1

u/_v3nd3tt4 2d ago

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