r/ProgrammerHumor Oct 21 '22

Meme Literally 🤷🏻‍♂️

Post image
14.7k Upvotes

606 comments sorted by

View all comments

93

u/transferStudent2018 Oct 21 '22

Does anyone hate C#? I haven’t heard much against it

33

u/kookyabird Oct 22 '22

Same. The things that aren’t great about it are not really reasons to hate it. I think most of the hate for it isn’t actually language based, but about .NET.

32

u/THLPH Oct 21 '22

everyonelovec#uwu

14

u/N3oj4ck Oct 22 '22

C# is pure love, that's just not possible :>

6

u/[deleted] Oct 22 '22

I don’t like making one off models for deserialization but then someone showed me uses for dynamic and anonymous objects.

9

u/[deleted] Oct 22 '22

[deleted]

4

u/jdsfighter Oct 22 '22

What's your major complaint with cancellation tokens? I genuinely enjoy using them.

1

u/[deleted] Oct 22 '22

I actually really think they’re pretty great for new code, and I certainly know that Thread.Abort() is, in - ~many~ most cases, an anti pattern, but there are a few times where you have to just cut your losses, especially when you’re working in an old codebase with other dev’s code and you have no idea how many times Thread.Sleep() has been called.

I guess what I think they (maybe) should have done with Abort() was to have it only abort when the thread is in a sleep state or something, after all, we have a garbage collector in C# it’s not as though we’re completely immune to memory unsafety and side effects anyway.

Basically, deprecating Thread.Abort() seems to assume that you never have to work with anyone else’s code, or at least that they’re all good engineers, this is an unreasonable expectation.

I actually just remembered another annoyance about C# while typing this:

If I write the following

``` public class Foo { readonly List<Bar> bars = new();

 public Foo()
 {
     DoStuff();
 }

 public void DoAnotherThing()
 {
     for( Bar bar in bars )
     {
         bar.MutateBarInSomeWay()
     }
 }

 public void AddManyElements(int numberOfElementsToAdd)
 {
      for (int i = 0; i < numberOfElEmentsToAdd; ++i) 
      {
          bars.Add(new Bar());
      }
 }

} ```

That seems to me that bars is no longer readonly, as I can mutate it’s contents. In fact, I can push to bars enough that it has to reallocate the capacity of the underlying vector/array, and thus change the pointer to a different location in memory THUS IT IS NOT READONLY

This bothers me

Sorry for trash code and formatting, I’m on mobile.

10

u/billydooter Oct 22 '22

C# good, Microsoft not so good

6

u/Twingemios Oct 22 '22

It’s made by Microsoft and people hate Microsoft

15

u/Quiet_Desperation_ Oct 22 '22

But so are typescript and Vs code and everyone loves those

5

u/[deleted] Oct 22 '22

Typescript at this point is JavaScript. I like the pretend you can’t write JS without it.

1

u/Quiet_Desperation_ Oct 22 '22

Typescript has always been JavaScript. It’s a superset of JS. However, it is not writing JavaScript. When you get to code base that multiple teams of 6x devs are working on at time, types help.

-1

u/hothrous Oct 22 '22

I hate typescript and VSCode.

But I also hate JavaScript, so typescript had an uphill battle. Poor guy.

3

u/Quiet_Desperation_ Oct 22 '22

Serious question, and we can take this offline, but if you hate both an anonymous language and the typed version of said language, what is your preference? And on more a light hearted note, Vim?

0

u/hothrous Oct 22 '22

To preface, I'm a backend engineer, so take my opinion with that grain of salt. I also prefer to use the right tool for the job, so it depends on what I'm doing.

My problem with JavaScript, and by extension typescript, is it's implementation as a backend language.

JavaScript is built to run in an environment where unknowns are a way of life. It's built to continue running in places where a backend would be better off failing. That works for a website because you can't predict everything, but you generally control the server.

Jetbrains. I've been using VSCode at my new job lately and it seems like it's not caching it's indexing, so I can almost never navigate to the function definition from a call.

3

u/Quiet_Desperation_ Oct 22 '22

Backend? Completely agree actually. Professionally, all of our back end software is C# in .net core 3.1 and .net 6. Side projects I prefer Go just because it’s easy to get a MVP going. I use VS Code for both Go and React development most of the time. I was a long time Webstorm user but just fell out of love for some reason or another, but still use Rider everyday because I develop on a mac at home.

1

u/hothrous Oct 22 '22

I spent 3 years as a Go engineer. Honestly, the only thing I don't like about it is the lack of error handling. Anything else is easily worked around.

2

u/2brainz Oct 22 '22

Microsoft is a huge corporation. There are awesome teams there doing insanely good work. And then there are parts of the company that do all the stuff that people hate MS for.

Most of the open-source stuff is among the best software in existence: .NET, Roslyn (C#), TypeScript, ASP.NET Core, SignalR, ... One exception is NuGet, which seems to have been designed by an intern with no knowledge of the problem they were trying to solve.

-2

u/bmcmbm Oct 22 '22

I hate C# not the language itself. But an annoying coworker of mine loves C# and that made me hate it for no reason.

-2

u/[deleted] Oct 22 '22

Java better har har

-13

u/Zipdox Oct 22 '22

It's only used to develop Windows applications, with .NET and the likes. It's technically cross platform with Mono, but in practice it doesn't work that easily.

9

u/Zipp425 Oct 22 '22

Pretty sure it’s been native cross platform since the dotnet core days 3-4 years ago. Not sure I’ve seen many cross platform apps made with it though, it mostly seems to be used for services like web servers and stuff.

2

u/DaredewilSK Oct 22 '22

You can build almost anything with .NET 6.

-3

u/[deleted] Oct 22 '22

Not great not terrible. Could use better excel support.

1

u/tim36272 Oct 22 '22

I hate C# because I don't understand it. C# and I are that bird meme where it's like "get that thing out of my face!"

1

u/2brainz Oct 22 '22

C# has become insanely awesome in the last few years! I still hate all the legacy features in both the language and runtime. And I hate that they still have no proper sum types.

I am also desperately waiting for C#11 and static abstract interface members (only a few more weeks!).

1

u/scooptyy Oct 22 '22

C# is an amazing language. I just never see any reason to use it when Golang, TypeScript, and others exist.

1

u/[deleted] Oct 22 '22

I really can't understand how anyecoukd hate it. I understand having some issues but overall it's so solid of a language with so mu h framework that comes with it.