C++ has scope_exit for running code at scope exit. C# says "We have scope_exit at home." - The Old New Thing

9 months ago by πŸ’‘πš‚π—†π–Ίπ—‹π—π—†π–Ίπ—‡ π™°π—‰π—‰π—ŒπŸ“± to c/csharp

You can wrap it in an IDisposable.
Mihies 1 point 9 months ago

IDisposable is not that at all. At least not implicitly. It's a convention, one has to call Dispose to do anything. Edit: I might have misunderstood scope_exit πŸ₯Ή

path: 0 21789173, hotness: undefined, score: 1, children: 0
xxce2AAb 1 point 9 months ago

Zig has entered the chat.

path: 0 21787116, hotness: undefined, score: 1, children: 0
vivalapivo 0 points 9 months ago

There are ugly languages. There are unusable languages. There are languages with nuances beyond comprehension.

And there's csharp which for some reason tries to be all of these things.

path: 0 21787489, hotness: undefined, score: 0, children: 4
marlowe221 3 points 9 months ago

No language is perfect and they all have their quirks…

But, even though Microsoft made it, C# is one of my favorite languages to write in. And to be 100% honest about it, I’m not sure I entirely know why I enjoy it so much. I’ll have to give that some thought!

path: 0 21787489 21787688, hotness: undefined, score: 3, children: 3
BehindTheBarrier 3 points 9 months ago

I wonder if it's similar to the reason why i find it ok to work in, it's feels similar to a python just with brackets and static types. A lot of the bothersome work is hidden from you, at least with .NET.

One does get annoying things, and a lot of "you should just know to do this" for things you don't really understand or encounter naturally, but that's also something in other languages.

path: 0 21787489 21787688 21788942, hotness: undefined, score: 3, children: 0
vivalapivo -1 points 9 months ago

Don't allow your compulsions to decide for you. Csharp is shit and deep down you know it

path: 0 21787489 21787688 21788665, hotness: undefined, score: -1, children: 1
Mihies 2 points 9 months ago

No, C# is a good language. Usually it's shit for people not understanding it. So, what exactly makes you say it's shit?

path: 0 21787489 21787688 21788665 21789239, hotness: undefined, score: 2, children: 0
csharp
csharp

@programming.dev

login for more options
1816
274
16

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

  • Rule 1: Follow Lemmy rules
  • Rule 2: Be excellent to each other, no hostility towards users for any reason
  • Rule 3: No spam of tools/companies/advertisements

Related communities

go to feed...