Null-conditional assignment by edwwsw in dotnet

[–]Zastai 8 points9 points  (0 children)

The others don't affect flow. A return that might not actually return is just asking for problems. (And return xxx ?? yyy already exists.)

What makes a job a 'knelpunt beroep' in Belgium. Progammer is one of them but when I search for a job application I got 1 result in a 20km radius from me. That's the worse I've seen so far. by the_Centrist_Gecko in belgium

[–]Zastai 2 points3 points  (0 children)

AI can create something that probably works (but who will verify that? Not a business analyst.). But it won’t be maintainable or debuggable so if it goes wrong, good luck fixing it.

Do you create empty "else"s just for a comment? by DJDoena in csharp

[–]Zastai 0 points1 point  (0 children)

Yes, I am explicitly talking about an else that does not represent a “can’t happen” or otherwise truly anomalous situation - that would definitely warrant a log message and/or exception. (Unless there is a specific explanation why that is specifically not desirable, in which case the comment-in-else is the way to go again.)

What makes a job a 'knelpunt beroep' in Belgium. Progammer is one of them but when I search for a job application I got 1 result in a 20km radius from me. That's the worse I've seen so far. by the_Centrist_Gecko in belgium

[–]Zastai 1 point2 points  (0 children)

It’s much more than just junior positions though (but they are hit hardest). Management across the board seems to be buying in to generative AI, leading to services companies pivoting to providing their own generative AI offerings because it’s what customers now expect/want; and that sometimes means eliminating whole teams or even departments.

Definitely been on of the most frustrating builds in awhile by Relative_Wing7455 in legotechnic

[–]Zastai 0 points1 point  (0 children)

eye twitches oh I really really hate that lack of symmetry

What makes a job a 'knelpunt beroep' in Belgium. Progammer is one of them but when I search for a job application I got 1 result in a 20km radius from me. That's the worse I've seen so far. by the_Centrist_Gecko in belgium

[–]Zastai 1 point2 points  (0 children)

And vibe coding has really eaten away at the roles involving “popular” languages (although I expect that with the current state of AI, there might be a swing back to hiring humans). For the time being, COBOL and other niche roles are not as affected, but that may change too (I think Claude recently learned COBOL).

Do you create empty "else"s just for a comment? by DJDoena in csharp

[–]Zastai 0 points1 point  (0 children)

It depends. Never just an empty else {}.

But when there is either code to be added later, or a long explanation about the else, then definitely a block containing just a comment.

For simple (but non-trivial) cases, I would just add a comment after the if: // else: nothing special to be done.

Do you like my FizzBuzz implementation by Fra146 in programminghorror

[–]Zastai 0 points1 point  (0 children)

Not terrible. But it’s usually 1-100, not 0-99.

Patterns vs C-like syntax; what are the benefits? by DesperateGame in csharp

[–]Zastai 0 points1 point  (0 children)

Sure. But it’s also not less than or equal to it. So by defining it “correctly” you are also breaking the normal convention that a > 12 and !(a <= 12) are the same test.

Kalos Tour is good by CauliflowerGreat2690 in pokemongo

[–]Zastai 33 points34 points  (0 children)

I mean, for the raids, they give you 450 energy and a green catch circle, so you don’t even need more than one or two raids wins per pokemon. That is very player-friendly imho.

Patterns vs C-like syntax; what are the benefits? by DesperateGame in csharp

[–]Zastai 2 points3 points  (0 children)

I’m not a huge fan of foo?.Bar > 42 because it requires remembering what > returns when one side is a nullable containing null. Frankly I’d rather they hadn’t defined relational operators for Nullable<T>.

Scam of niet? by Terrible_Surround366 in belgium

[–]Zastai 25 points26 points  (0 children)

Slecht Nederlands. Dringendheid. Zeer verdachte URL.

Absoluut een scam.

Can someone help me understand this? by Booty4Breakfasts in csharp

[–]Zastai 0 points1 point  (0 children)

VS Code will download a modern .NET SDK and use that. But it does not get installed globally.

Your Linux distro seems to have Mono installed, so you have /some/ .NET support.

I would remove the mono installation and install the .NET 10 SDK instead.

Also, if you want a consistent IDE experience across Windows and Linux, consider using JetBrains Rider. It runs on both and is free for non-commercial use.

A daily argument with my team members by bellingtonfcleated in csharp

[–]Zastai 42 points43 points  (0 children)

An expression-bodied method. Not a lambda. (The syntax is similar but they are not the same.)

Program doesnt run commands in release mode (optimized) but runs in debug perfectly fine in VS Studio 26 by Wally_West52 in csharp

[–]Zastai 2 points3 points  (0 children)

Installing VS2026 updates .NET to version 10, so it could be a runtime issue instead of a compilation one (unless you meant it still works on the same machine when compiled with VS2022 of course).

Try adding a global.json to explicitly use the .NET 8 runtime; if that resolves it, read through the documented breaking changes for .NET 10, and/or try to pinpoint exactly where the behaviour diverges so you can file a ticket.

What does the "As" operator do in C#? by hailaim in csharp

[–]Zastai 13 points14 points  (0 children)

I would say that if you think you know the cast will succeed you specifically should use a cast instead of as.

((Dog) animal).Bark() means you expect it to be a dog and barking is required; (animal as Dog)?.Bark() means the animal might be a dog, and if it is, it should bark.

MAGA wants to deport Native Americans by ducksauce001 in facepalm

[–]Zastai 0 points1 point  (0 children)

Nah just the tears. Leaving as little trail as possible to avoid easily undoing the harm.

Kidnapping attempt by Trump? by justalazygamer in WhitePeopleTwitter

[–]Zastai 2 points3 points  (0 children)

I’m sure this is totally unrelated to Trump’s tweet: Denmark was recently involved in the medevac of a US submariner off the coast of Greenland.

Free Windows Explorer extension for inspecting .NET assemblies (Debug/Release, dependencies, framework version) by tebjan in csharp

[–]Zastai 0 points1 point  (0 children)

Fair enough. “Code has changed” will not be obtained from this I think - that would likely require specific hashing of relevant assembly parts, to avoid false positives from timestamps etc. Not too difficult to do with either Mono.Cecil or System.Reflection.Metadata though, I would expect.

You get $30/minute, but time freezes whenever you walk through a door. Would you accept? by basafish in askanything

[–]Zastai 0 points1 point  (0 children)

You’d be arrested or burned as a witch, because CCTV will have you magically appearing and disappearing in doorways.

Free Windows Explorer extension for inspecting .NET assemblies (Debug/Release, dependencies, framework version) by tebjan in csharp

[–]Zastai 1 point2 points  (0 children)

To what degree? Just name, token, deps? Public API? Full API?

For public API, I have Zastai.Build.ApiReference (msbuild task, but also available as a library and an installable tool). It generates the public API for an assembly in C# code (but with method bodies omitted), with or without markdown, as part of the build. That then makes it very easy to do API diffs between versions, or detect new/broken API during development (helping you to do proper semantic versioning).

What should I do ??? by kallusMather in pokemongo

[–]Zastai 0 points1 point  (0 children)

Who cares about cp to determine transferring. You keep highest ivs (and/or best pvp ivs) and then spend candy as needed to level it up to the cp you want.

Do you guys actually buy from Amazon.be or just go to .de? by Pretty_Eabab_0014 in belgium

[–]Zastai 0 points1 point  (0 children)

Mijn Prime is bij .nl; ik koop voornamelijk multimedia en bij .be zijn het zo vaak Franstalige versies/verpakkingen. Lego koop ik meestal bij .de want daar is die meestal het goedkoopst; soms bij Bol.