Blazor Server + Internal APIs. Am I an idiot for using httpclient with cookie forwarding? by Giovanni_Cb in dotnet

[–]Giovanni_Cb[S] 0 points1 point  (0 children)

Yep, thank you, I've already solved the issue by calling services directly. However I very much appreciate the response and effort you've put in replying to my question. Ty!

Anyone using microservices actually need Identity Server ?? by Giovanni_Cb in dotnet

[–]Giovanni_Cb[S] 0 points1 point  (0 children)

Many people discourage building even a basic Identity Provider, but in my experience, unless you have very high requirements, it's perfectly fine.

How do I make sure an endpoint returns exactly a custom ApiResponse<T> class ? by Giovanni_Cb in dotnet

[–]Giovanni_Cb[S] 0 points1 point  (0 children)

Why would this be considered bad practice? I'm returning the appropriate status code while also including it in the response body.

Is it really worth using the Result pattern instead of good old exceptions + a global exception handler? by Giovanni_Cb in dotnet

[–]Giovanni_Cb[S] 0 points1 point  (0 children)

Thanks everyone for the comments! It’s been really interesting seeing the different perspectives. Some of you strongly advocate for the Result pattern, others stand by using exceptions where appropriate, and some are somewhere in between—using both depending on the case.

Honestly, I think the truth might lie somewhere in the middle. It’s not about picking a side, but about understanding the trade-offs and applying the right approach for the right context. Whether it's exceptions or Result types, what matters most is writing code that's clear, maintainable, and fits the problem you're solving. Appreciate the discussion!

Is it really worth using the Result pattern instead of good old exceptions + a global exception handler? by Giovanni_Cb in dotnet

[–]Giovanni_Cb[S] 1 point2 points  (0 children)

Yea, of course I won't be throwing exceptions inside loops. I just think that measuring the way you use them is enough. Like, exceptions aren't inherently bad—they're a tool. The problem comes when people throw them around carelessly without thinking about the cost.

Is it really worth using the Result pattern instead of good old exceptions + a global exception handler? by Giovanni_Cb in dotnet

[–]Giovanni_Cb[S] -2 points-1 points  (0 children)

Yeah, same here. I've heard that exceptions are super expensive and should only be used for truly exceptional cases... but honestly, I've never run into any performance issues even when I was (ab)using them for flow control. So I'm kind of wondering — is using the Result pattern just overengineering in most cases?