r/ProgrammerHumor • • Oct 04 '26

Meme architectureDependentChars

Post image
3.0k Upvotes

372 comments sorted by

View all comments

Show parent comment

30

u/techy804 Oct 04 '26

As a C# user I was wondering why people act like the C-series only consists of C and C++

85

u/darkslide3000 Oct 05 '26 • Bravo

C# has about as much to do with C as JavaScript has with Java.

9

u/sisisisi1997 Oct 05 '26

I mean C# was inspired mainly by Java and C++, from which Java is a C-style language and C++ is a direct expansion of C (or at least started out as one). JavaScript and Java both have similarly looking syntax on account of both being C-style languages, but that's where the familiarities stop.

So saying this is like saying your grandson has as much to do with you as your two neighbours who like your style enough to copy it have to do with each other - your grandson may feel as different from you as the neighbours from each other, but that's because the family tree has acquired new genetic material through your wife and your son-in-law, and the times have changed so his behaviour is different - and not because he actually doesn't have anything to do with you.

14

u/darkslide3000 Oct 05 '26

C# has nothing to do with C or C++ that Java doesn't have. It is entirely a Java clone.

6

u/Kovab Oct 05 '26

Nonvirtual methods, reified generics, value types, just a few examples of features from C# that don't exist in Java, but do in C++...

2

u/pblokhout Oct 05 '26

C# used to be called Microsoft Java as a meme

1

u/conundorum Oct 05 '26

I'm not very familiar with C#, but I know that C# has...

  • Generics that actually template, versus Java's just being typecasts in drag. (Specifically, type-based parameters, C++-style, that can also be constrained to a named interface. So, C++20-style concept constrained templates, years before C++ concepts were worth talking about.)
  • Finalisers (destructors) that actually get called, versus Java's being a trap that the garbage collector is explicitly allowed to ignore. Java can't do RAII; C# can.
  • Actual user-defined value types, which can be constructed on the stack. They're just C structs with a different name, though, unfortunately.
  • Crosslinking with C or C++ code, provided the C/C++ code is compiled as managed C++/CLR.
  • A preprocessor, with GCC-like #warning directives. I wish MS would add them to the C preprocessor too.
  • Actually got Microsoft to warm up to making their products available on Linux, instead of being stuck inside the Windows ecosystem.

Overall, C# is basically what Java should have been. It's the UTF-8 (with BOM) to Java's UCS-2, so to speak. It's not perfect (hence the BOM), but it's a definite step up, and explicitly being designed to interop with "managed C++" forces MS to keep it more C++-like than Java's mess.

2

u/darkslide3000 Oct 06 '26

I am not hating on C# but calling C# related to C++ is still wrong. Yes, C# has a few features that Java doesn't have, but these are relatively generic / well-known OOP features, not C++ exclusives that somehow imply a closer relationship between C# and C++ (C++ didn't invent OOP and most related concepts, it just made them popular).

31

u/AyrA_ch Oct 04 '26

Probably because the syntax more closely resembles Java than C

5

u/SuitableDragonfly Oct 04 '26

This meme doesn't mention any languages. Like many memes on this sub, it's about a specific language, and it's up to you and your knowledge of programming languages to figure out which one is being talked about. Just because the meme is not about C# doesn't mean that everyone forgot that C# exists. 

12

u/aberroco Oct 04 '26

Because most devs still think that C# is proprietary Microsoft language developed specifically and exclusively for Windows, like it's 2006.

63

u/sb8948 Oct 04 '26

No it's because C# is way closer to Java than C/C++ both in philosophy and execution.

16

u/QuaternionsRoll Oct 05 '26

It concerns me that this wasn’t the first and only answer to the question

14

u/guyblade Oct 05 '26

That's because Microsoft was going to make a .NET version of Java that was incompatible with standard Sun Java (the standard embrace, extend, extinguish playbook), then got sued over it (twice). C# is what fell out the other side of that fight.

10

u/-suspended- Oct 05 '26

Yup. C# is Microsoft Java.

3

u/kookyabird Oct 04 '26

Incorrect, they also think it’s magically cross platform when used in Unity!

1

u/guyblade Oct 05 '26

I don't know where Mono is today, but C# was still very finicky on non-Windows platforms up into the early-to-mid 2010s.

9

u/sisisisi1997 Oct 05 '26

Mono has died, and C# is now natively cross-platform.

Microsoft still sucks at the UI framework front (seriously, there is not a single normal desktop UI framework they managed to create still winforms), but there are excellent 3rd party cross platform UI frameworks like Avalonia, which is essentially a spiritual descendant of WPF, but done a bit better and not windows-only.

VS is also still windows-only, but it's not the only good C# IDE anymore. Even if you don't classify VS Code with C# extensions as an IDE, JetBrains Rider is there for the rescue and arguably better than VS, or they are at least equals.

2

u/pblokhout Oct 05 '26

I enjoy C# on Rider as a daily driver but what the actual fuck is microsoft doing with GUIs indeed?!

3

u/evanldixon Oct 05 '26

These days, first-party .Net is cross platform. The UI frameworks aren't really, unfortunately.

-1

u/Bartodziejj Oct 05 '26

It's still microsoft slop

1

u/aberroco Oct 05 '26

Such a slop that Kotlin and Java practically copied it.

1

u/rhutyl Oct 04 '26

To me, C and C++ are just a lot more iconic (idk if "popular" is the right word bc I don't have the stats)

0

u/bigmattyc Oct 05 '26

C# is Satan's music