Sad realization for today: using formatted strings hides issues that CA1305 would find.
Overly simple example:
$"{myValue}"
vs.
myValue.ToString()
These are equivalent. Both (usually) implicitly and silently use CultureInfo.CurrentUICulture, but only the latter can be flagged as needing an explicit culture to ensure you're getting the value the way you want.
This kind of makes me want to rip out all instances of formatted strings now.
I have ONE #blazor razor component with a razor.cs code-behind file that #jetbrainsRider absolutely refuses to analyze as valid, even though it is. The .cs file is fine, but the .razor file can't find the #csharp file. It's super annoying, happens on multiple pcs, but is only this one, customer-owned page, so no idea how to report or share.
Is there anyone using other languages than C# and F# on .NET ?
I remember back then there was the #boo language but looks like it's not much used now.
Other alternative languages like #ironpython and #ironruby are either lagging a lot on supported version or abandoned apparently.
I see a lot of responses to the current Moq 4.20 issue being "now I have to port all my projects to something else".
Is anybody considering just rolling back to 4.18.4 and staying there?
Is anybody considering forking the project and giving it a new name, after removing SponsorLink? It's BSD licensed, so there shouldn't be any legal issues with doing so.
Why is #Azure depolyment step still slow? It has been like this for at least 5 years. Sometimes it lasts nearly 20 minutes! It's the part that says: "Package deployment using ZIP Deploy initiated."
I know the gun-ho method, connecting via SFTP to AppService and syncing files then restarting. But that's just an ugly way of rapid deployment during development.
I just found the killer use case for #csharp primary constructors. I think it's excellent for reducing boilerplate in your @xunit test suites. Check it out! #dotnet
Did you know that you should use TextElementEnumerator to determine the length of a string if the input might have Unicode emojis? Check out the sample below. #dotnet#csharp
I'm curious if future versions of #dotnet should do this check implicitly. 🤔
Hey people! I need to learn #csharp and #dotnet for a new project. I already have a few years of experience with #java and spring boot framework.
Does anyone have any good recommendations of fast tutorials, articles, new concepts, etc. so that I can get to speed quickly with coding and testing in c# and .net? Any other tips are appreciated as well. Thanks!
Spent some time changing a #GodotEngine#GDScript to a #csharp class. They look identical, but it seems the same hardcoded values work differently in GDScript vs. C#.
Does anyone want to have a look? I can't see what I did differently.
I think I see the value of primary constructors now. That is so sleek and simple. The only thing I'm wondering is whether all the newcomers to C# will be confused by seeing this when all tutorials out there use the "old" method. #dotnet#csharp
My relationship to extension methods is a bit ambivalent. You can make some nice helper methods on classes you don't otherwise have access to, but it comes at a cost of, IMO more opaque code. Which can be fine if the benefit is there.
I have noticed people, however, making extension methods and placing them right next to the class or interface being extended, which in my view is just obfuscation. The argument being, that this particular set of helper functions do not belong in the class, so instead we extend the class.
By extending the class, you alter the class. Something might belong in the class in the current context, but not others (say, in test) but if the extension methods are implemented in the same project and namespace as the class itself, then it's functionally the same as adding the methods directly to the class. Only more difficult to navigate.
There's no need to keep re-calling .ConfigureAwait(false) on every single task. The first one is good enough. I've already been shifted off the SyncContext, if there was one.