Declarative VS imperative, which do you prefer and why? #dotnet#aspnetcore
What about now?
I don't think one of these is better than the other, but to show how removing indirection can make the understanding of what the code is doing simpler:
These techniques give you different ways to compose functionality. It's really easy to say something scales better but you're really leaning into the indirection the framework forces on you.
Here's litmus test. How would you go about applying an attribute to all controllers?
• • •
Missing some Tweet in this thread? You can try to
force a refresh
OK C# coding challenge from today's discussion. This came up today in the context of "async and concurrency is *HARD* even for very experienced developers". I will share some techniques after seeing some answers. #dotnet#csharp
First version is using a CancellationToken
Using new primitives in .NET 6 this was one of the cleanest I could come up with:
To help the team contextualize why it is hard outside of the domain itself being hard, it would be great to see some code samples. Samples from other frameworks that are runnable. Most of these threads conflate everything under the auth banner and require 20 questions understand
the problem. It’s fine to rant but we want to make real improvements. After the rant please show the code. We need to understand the scenario, the exact scenario. Sharing code leaves less room for ambiguity.
COVID will be “over” when people stop posting tests results on Twitter. It’s not “normal” or “endemic” yet socially. It feels pretty inevitable at this point, there’s still a guilt associated with having it (you could have spread it unknowingly).
It’ll be “like the flu” and “normalized” socially when people stop doing that. So, IMHO Covid isn’t “over” yet…
As an example of what this “new normal” feels like: Hanging out with people and then waiting for 3-5 days to pass to see if you have any symptoms. Knowing you have to travel in a week and trying to reduce the possibility of getting it by reducing too much human infraction before.
This thread was good because it helped clarify my thinking. There are 2 phases (for simplicity) where ClaimsPrincipal shows up:
- The authentication flow
- The authorization flow
Claims are typically used to store authentication data. #dotnet#aspnetcore 🧵👇🏾
That data is then used to look up more user information (profile data) usually store in a database/cache. This profile data usually also contains permissions and authorization rules are then run over this user for different types of application "resources".
These resources typically include (but are not restricted to):
- The HTTP endpoint
- Some business object
The authorization process usually needs access to all user profile information including permissions to do authorization checks.
The oral history of Dave Cutler is a real gem:
Part 1:
Part 2:
Windows NT is a marvel of an operating system and his work has been immensely impactful on the industry at large. I also love that he's an engineer through and through.
Some gems:
- Engineers should care *deeply* about the quality of the code they write (he hated when he had bugs assigned to him).
- Coding != Software engineering. They brought strong engineering culture to Microsoft from DEC.
- Go interview elsewhere to know your worth😉.
Watching these luminaries, I see a pattern of small teams of highly capable people building largely impactful software projects.
You can refactor long argument lists into structs as a "zero cost abstraction". The struct's members will be bound as if they were parameters declared on the method.
It's not all or nothing, you can also do this with a subset of the parameters: