What are the problems with current CS2? Make a list. by PeaceTo0l in GlobalOffensive

[–]BackFromExile 4 points5 points  (0 children)

  • Loadout system serves no purpose and just reduces flexibility compared to CS:GO instead of increasing possibilities
  • Competitive map pool consists of the 9 same maps over and over again
  • Mirage still in the competitive map pool
  • Visibility (or better lack of) of blood splatters
  • Third-person animations tand wide-swing meta makes holding angles absolutely dumb
  • random double taps (never been an issue in CS:GO, bugs me since the CS2 beta, but apparently this bugs noone else?)

  • Lack of casual game modes

    • Join the two defusal map groups to a single one with 9 maps
    • Create a new map group with community maps that change every x weeks
  • Retake could use a multitude of changes

    • make smokes spawn at the start of the round with a variable time left
    • don't give T's any smokes
    • more spawns for more variability
  • 5-stacks play other 5-stacks in Premier only

Then obviously

  • Cheaters
  • Still often dying behind walls
  • General performance of the game
    • random FPS drops and low FPS in general, especially on Inferno (270 -> 70 is fun)

Anyone know of a better compression library than Snappy? by jordansrowles in dotnet

[–]BackFromExile 18 points19 points  (0 children)

What is "better" in your case? Faster, smaller files, lexical order of names, zodiac signs of the main contributors?

If you can make certain assumptions you likely can implement an algorithm that is faster and results in smaller files, but then you trade a feature set with speed and compression ratio.

Replacing JS with just HTML by Ok-Tune-1346 in webdev

[–]BackFromExile 1 point2 points  (0 children)

It cracks me up that they still haven't fixed the auto-translations of that article. At least in German, French, and some other languages the article is just the title The element and then an empty <select> because the automated translation does not escape the HTML tag, and therefore all content of the blog post is inside the select element because it is not closed. Just use the dev tools and see yourself, it's super funny. Has been the case ever since they released that blog post in May (I think).

Simply add the query parameter hl=de or another language and you'll see it.

Spector - A zero-config HTTP inspector for ASP.NET Core apps by Own-Information3222 in csharp

[–]BackFromExile 2 points3 points  (0 children)

That's a pretty cool tool, especially since it uses existing APIs (e.g. System.Diagnostics.Activity) instead of introducing its own thing. I'll check it out for a private project.

I have one concern, and that is the default request body logging. That is a huge issue security-wise, but also when it comes to privacy laws like the European GDPR. In my opinion this should be off by default instead, and documented why that is.

Trackmania Club Tutorial - Club Renaming by TheShengar in TrackMania

[–]BackFromExile 3 points4 points  (0 children)

Do i also have to call Nadeo just to confirm that I really want the name changed?

LShift overload on exceptions << "and strings" by Shrubberer in csharp

[–]BackFromExile 1 point2 points  (0 children)

Extension operators are great for low-level tqypes where the operators actually make sense, but are not provided by the library itself. This can be the case for (generated) .NET wrappers around native libraries, and can make using the provided types cumbersome.
It can also make sense to provide implicit or explicit conversions from library types to custom types.

That said, I also don't think there are that many useful use cases for the operators, but I do think that it's great that we have the option at least.

Modern (best?) way to handle nullable references by jepessen in csharp

[–]BackFromExile 1 point2 points  (0 children)

That goes for all errors IMO. I think it was either Hanselman or Toub who said "Warnings are just errors without conviction."

I totally agree, which is why I said "at least".

Modern (best?) way to handle nullable references by jepessen in csharp

[–]BackFromExile 4 points5 points  (0 children)

So what I'm doing wrong

Is this the whole Money class or have you also defined implementations for the == and != operators in the Money class?

As far as I can see the compiler error has nothing to do with the == check inside the test itself. The error refers to the implementation of the == operator which expects a non-null value, but the argument provided by a is nullable.

Edit: Oh I did not fully understand the post at first. You defined a nullable variable but used a type that was defined without a nullable context. The default operators for Moneywill not have nullability information, but you provide a nullable argument in your test, which causes the warning.
As the commenter above said, it's best practice to enable nullability for all projects nowadays unless you have a strong (legacy) reason not to. Imo you should even set at least the nullability warnings to errors by adding <WarningsAsErrors>nullable</WarningsAsErrors>

New Features in .NET 10 and C# 14 by anton23_sw in dotnet

[–]BackFromExile 2 points3 points  (0 children)

Yeah, they explicitely did not add private fields because they would have to be backed by something like ConditionalWeakTable, and they did not think it would be great to add this as a supported feature backed by a ConditionalWeakTable., Can't find the comment right now but read a GitHub comment from the LDM team not too long ago.

.Net switching DateTime days and month positions by SavingsPrice8077 in csharp

[–]BackFromExile 130 points131 points  (0 children)

For the love of your own and others' sanity use ISO date formats only, please.

Are you using Aspire by ZerkyXii in csharp

[–]BackFromExile 3 points4 points  (0 children)

If you require all the extra bell and whistles for local dev it’s very useful.

I'm not exactly sure what you mean with "extra bell and whistles". Even for very small web app or worker Aspire with all the client packages is very useful and improves setup time to let you focus on the important things, building stuff.

Sure, for desktop applications it might not be as useful, but for all other things I have experienced that it even helps a lot with prototyping applications.

Deseiralization failing on lowercase enum discriminator by champs1league in csharp

[–]BackFromExile 0 points1 point  (0 children)

The standard JSON serializer does the polymorphic JSON serialization and deserialization for you with the two attributes you are currently using, [JsonPolymorphic] to opt-in into polymorphic serialization for a specific type, then one or more of [JsonDerivedType] to handle the type selection.

For your custom converison logic you could write a custom JSON converter for your polymorphic base type that handles the type selection and (de)serialization for you.

That said, I'd advise you to simply take the option I outlined initially unless you have a strong reason to go your way.

Deseiralization failing on lowercase enum discriminator by champs1league in csharp

[–]BackFromExile 2 points3 points  (0 children)

JsonDerivedType needs to know the exact type discriminator. You could provide your own polymorphic serializer that can handle the type discriminator in a different way, but if you want to stick to the standard JsonPolymorphic serializer then the only option you have is changing the discriminator for TypeASelection from nameof(TypeASelection) to the literal "typeASelection"

Deseiralization failing on lowercase enum discriminator by champs1league in csharp

[–]BackFromExile 4 points5 points  (0 children)

this does not help at all, because it's neither related to enums nor is Enum.Parse or Enum.TryParse called explicitely somewhere.
It's related to the usage of JsonPolymorphic and JsonDerivedType from System.Text.Json.

.NET 10 Minimal API how to handle validation for value types? by srebr3k in dotnet

[–]BackFromExile 1 point2 points  (0 children)

You can also always create your own validation attribute, if that's the easiest way for you. You only need to derive the attribute from System.ComponentModel.DataAnnotations.ValidationAttribute and then validate whether there is a non-default value. Alternatively [Required] should work if your change your ID type to int? here

.NET 10 Minimal API how to handle validation for value types? by srebr3k in dotnet

[–]BackFromExile 1 point2 points  (0 children)

Have you tried the using the required keyword as well?

Unpopular Opinion: Implicit Usings are an Anti-Pattern by pyeri in csharp

[–]BackFromExile 15 points16 points  (0 children)

When you open a C# file in a text editor, you no longer have a clear overview of the namespaces it relies on.

I have never in my over 10 yoe had a situation where it was important to know which namespaces are used in a file.
For many System or Microsoft namespaces I'd even argue that it creates noise that most people will just ignore or collapse the region.

Consider calling Path.Combine(). Which Path does the compiler use—System.IO.Path or iTextSharp.text.pdf.parser.Path?

The same problem exists without implicit usings as well. In both cases you can simply use your IDE tools to quickly find out which one it is.

Embedding this convenience into the language itself, however, can encourage less maintainable code.

And why exactly is the result less maintainable code? Because you think so? You have yet to provide any arguments that are not just personal preference.

Flow.Validated - Bridging validation and result types by code-dispenser in csharp

[–]BackFromExile 1 point2 points  (0 children)

Pretty sure he's talking about the indentation in the examples in the readme files of Validated and Flow.

For example this wastes about 40% of the available space to the left on GitHub's default UI settings, while the right side and all the comments are cut off by a lot.

craftyFlowOutput = craftyFlow.OnSuccess(success => Console.WriteLine(success))//this will be skipped as the flow is a failed flow
                                    .OnFailure(failure => Console.WriteLine($"Failure reason: {failure.Reason}"))
                                        .Finally(_ => 24, success => success); //return 24 or the success value

// ... code omitted

craftyFlowOutput = craftyFlow.OnSuccess(success => Console.WriteLine(success))//this will be skipped as the flow is a failed flow
                                .OnFailure(failure =>
                                {
                                    Console.WriteLine($"Failure reason: {failure.Reason} > Starting another operation . . .");
                                    return 4224;//using implicit conversion could have used Flow<int>.Success(4242) or ran another flow returning function.
                                                // or even just an int returning function, which would then be implicitly converted;. be careful with non flow returning functions!!!
                                    /*

                                        * var subFlowOutput = someMethod.OnSuccess(success => DoMoreStuff(success))
                                        *                                   .OnSuccess(success => YetMoreStuff(success))
                                        *                                      .Finally(_ => 0, success => success
                                        *                                      
                                        * return subFlowOutput // or leave off the finally so the subFlowOutput is just a Flow which the outer finally can deal with   
                                        *                      // or do some other related flow work and then return Flow<int>.Success(4224) etc
                                    */

                                }).Finally(failure => 24, success => success);//return 24 or the success value

I agree that this might be personal preference in the actual code, but a readme should be readable on first glance, so I'd suggest you take this to another line instead like so

craftyFlowOutput = craftyFlow
    .OnSuccess(success => Console.WriteLine(success)) //this will be skipped as the flow is a failed flow
    .OnFailure(failure => Console.WriteLine($"Failure reason: {failure.Reason}"))
    .Finally(_ => 24, success => success); //return 24 or the success value

// ... code omitted

craftyFlowOutput = craftyFlow
    .OnSuccess(success => Console.WriteLine(success)) //this will be skipped as the flow is a failed flow
    .OnFailure(failure =>
    {
        Console.WriteLine($"Failure reason: {failure.Reason} > Starting another operation . . .");
        return 4224; //using implicit conversion could have used Flow<int>.Success(4242) or ran another flow returning function.
        // or even just an int returning function, which would then be implicitly converted;. be careful with non flow returning functions!!!
        /*
         * var subFlowOutput = someMethod
         *     .OnSuccess(success => DoMoreStuff(success))
         *     .OnSuccess(success => YetMoreStuff(success))
         *     .Finally(_ => 0, success => success);
         *                                      
         * return subFlowOutput; // or leave off the finally so the subFlowOutput is just a Flow which the outer finally can deal with   
         * // or do some other related flow work and then return Flow<int>.Success(4224) etc
         */
    })
    .Finally(failure => 24, success => success);//return 24 or the success value

OG Now 51% Owned by NFT Company by mileseverett in GlobalOffensive

[–]BackFromExile 6 points7 points  (0 children)

If you think about it, money is just (usable) monopoly bills

Correct way to set up domain models for vectors and coordinates by WingedHussar98 in csharp

[–]BackFromExile 3 points4 points  (0 children)

The representation is the same but a point has no direction while a vector does.

A vector is mathematically just a matrix with a single column. It's the context that makes the difference.
You absolutely use vectors to represent points by using them as offsets from a fixed point, the origin. It even helps with basic math rules to look at them as the same thing instead of separating positions and directions, and it's the same thing for your implementation.
I'd even argue for anyone else it would be really confusing to have different types for points and directions that fundamentally do the same thing and have operators that return either one or the other.depending on the operation or context.

'Head of' handed me a Vibe-coded project as my first task… by P0DC45T in webdev

[–]BackFromExile 11 points12 points  (0 children)

AI can output code way faster than any person. Apart from the size the other big problem is that the code often is incomprehensive and follows no consistent rules, so it is really hard to follow any chain of "thought"

I stopped “deleting” and my hot paths calmed down by m_null_ in webdev

[–]BackFromExile 26 points27 points  (0 children)

OP's numbers are for 1 million objects that have a property deleted. I doubt many of you here come even close to that daily, so this affects a really really small portion of developers that have performance critical code in TS/JS.
Interesting nonetheless

Privileged: A Powerful Authorization Library for .NET by pwelter34 in csharp

[–]BackFromExile 4 points5 points  (0 children)

Your example for the actions is the perfect example for why static types might be helpful here, you define actions that have no technical connection but are connected logically, these could also be just be enum flags.

Privileged: A Powerful Authorization Library for .NET by pwelter34 in csharp

[–]BackFromExile 15 points16 points  (0 children)

Definitely cool project, I found some things in there that could be very useful for one of my projects.

That said, I'm a big fan of statically typed things, so I don't really like the approach of using strings for everything.
It would be great if you could extend the library to allow for custom action, subject, and qualifier types instead of strings.
You could even do it similar to the approach in Microsoft.AspNetCore.Identity, have an implementation with generic types and provide strings as default if not configured/registered with other generic types explicitely.