4 ms·
Is there a list like this for C#?
by jpeter 6y ago
Is there a list like this for C#?
- dgellow 6y agoAnd for C++? :)
- worble 6y agoC# has a pretty huge standard library (or Microsoft official packages) that cover a lot of things here. Quickly running through the rust list, the things I suppose I would add: Dev Tools: - Analyzers are a great tool for getting compile time errors. I use Rosylnator (https://github.com/JosefPihrt/Roslynator https://github.com/JosefPihrt/Roslynator) and Xunit Analyzers (https://github.com/xunit/xunit.analyzers https://github.com/xunit/xunit.analyzers) on every project, but there a ton of others focussing on performace, security, etc. - Editor Config is also great for maintaining consistent styling in your project (https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options https://docs.microsoft.com/en-us/dotnet/fundamentals/code-an...). Again, you can enforce this at build time, and Visual Studio and Rider will show errors in the IDE. Encryption: - Like the author I don't know much about this topic, but for hashing BCrypt is pretty well known and appears well respected (https://github.com/BcryptNet/bcrypt.net https://github.com/BcryptNet/bcrypt.net) Logging: - Microsoft has their own basics for this, but there are also a lot of 3rd party solutions, you can see a maintained list here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1#third-party-logging-providers https://docs.microsoft.com/en-us/aspnet/core/fundamentals/lo... (I personally use Serilog). Serialization/Deserialization: - Microsoft have just added their own internal JSON serializer to .NET Core, so you should probably use that where you can, but it doesn't have anywhere near the same features that Newtonsoft's Json.NET does, so if you're in need of those then that's still the battle-tested standard (https://github.com/JamesNK/Newtonsoft.Json https://github.com/JamesNK/Newtonsoft.Json). Time: - Personally I've never had a reason to use it over the standard DateTime, but I've heard good things about NodaTime (https://github.com/nodatime/nodatime https://github.com/nodatime/nodatime) Images: - System.Drawing still exists in the standard library for Core, but it's Windows only I believe - ImageSharp is a great library for native image stuff in .NET Core, works across all platforms (https://docs.sixlabors.com/index.html https://docs.sixlabors.com/index.html). There was some hullaballoo a little while back about it's license, but that appears to be resolved now as it's Apache 2. - There's also an ImageMagick library if that's your jam (https://github.com/dlemstra/Magick.NET https://github.com/dlemstra/Magick.NET) Networking: - .NET obviously has it's own httpclient, but it's worth mentioning Polly here (https://github.com/App-vNext/Polly https://github.com/App-vNext/Polly). It allows you to extend the default Http Client with short circuits, automatic retries, exponential backoffs, etc. Databases: - Probably doesn't need saying, but Entity Framework for an all in one migration, entity mapping and database access library (https://github.com/dotnet/efcore https://github.com/dotnet/efcore). Since moving to Core, it's also a lot faster now, although I think it's still lacking a couple of features from the old framework version. - Dapper is focussed on being fast and simple (https://github.com/StackExchange/Dapper https://github.com/StackExchange/Dapper) - NHibernate is also still a really powerful database library, even if I think it's API kinda sucks (https://github.com/nhibernate/fluent-nhibernate https://github.com/nhibernate/fluent-nhibernate)
- SAI_Peregrinus 6y ago> - Like the author I don't know much about this topic, but for hashing BCrypt is pretty well known and appears well respected (https://github.com/BcryptNet/bcrypt.net https://github.com/BcryptNet/bcrypt.net) bcrypt is a "Password hashing function", not a cryptographic hash. bcrypt has tunable performance, it's not particularly fast to start but can be made extremely slow (to thwart brute-forcing of weak passwords). It also takes multiple inputs (passphrase, salt, parameters) vs 1 parameter for a cryptographic hash (data to hash). For a cryptographic hash you probably want SHA2, Blake2, or Blake3.