Filter
Exclude
Time range
-
Near
๐Ÿงฉ Result Pattern vs Excepciones en .NET En tus proyectos .NET, no todo error debe lanzarse con throw. โš ๏ธ A veces, el Result Pattern es una opciรณn mรกs limpia y predecible. ๐Ÿ’ฅ Excepciones ๐Ÿ’ฅ โš™๏ธ Perfectas para errores inesperados o crรญticos (bugs, fallos de infraestructura). ๐Ÿงพ Incluyen stack trace y buena integraciรณn con logs. ๐Ÿข Pero... son costosas si se usan para flujo normal. โœ… Result Pattern โœ… ๐Ÿงฉ Ideal para errores esperados de negocio (validaciones, reglas, no encontrado). ๐Ÿ” Hace el cรณdigo explรญcito y composable (IsSuccess, Error, etc.). โšก Mรกs performante cuando los fallos son frecuentes. โš–๏ธ En resumen: ๐Ÿ‘‰ Usa excepciones para lo excepcional. ๐Ÿ‘‰ Usa Result<T> para lo esperado. ๐Ÿ‘‰ Combina ambos segรบn la capa (Domain, Application, Infra). ๐Ÿš€ Escribe APIs mรกs claras, predecibles y con mejor manejo de errores. #dotnet #CleanArchitecture #DDD #ResultPattern #CSharp #SoftwareEngineering #MediatR #ErrorHandling
2
6
137
๐Ÿ”ต ๐“๐ก๐ž ๐‘๐ž๐ฌ๐ฎ๐ฅ๐ญ ๐๐š๐ญ๐ญ๐ž๐ซ๐ง: ๐€ ๐’๐ฆ๐š๐ซ๐ญ๐ž๐ซ ๐–๐š๐ฒ ๐ญ๐จ ๐‡๐š๐ง๐๐ฅ๐ž ๐…๐š๐ข๐ฅ๐ฎ๐ซ๐ž๐ฌ Nested try-catch blocks, unreadable logs, no status code return and unclear return paths make debugging a painful experience. But what if there was a simpler, cleaner, and more predictable way to deal with failures? The Result Pattern offers just that. Instead of relying on exceptions for flow control, it embraces explicit success and failure outcomes, making your code easier to read, test, and maintain. ๐Ÿ’ฌ ๐Œ๐ฒ ๐ญ๐š๐ค๐ž? Since I adopted the Result Pattern in APIs and services, Iโ€™ve seen better maintainability, clearer contracts, and more confidence in error handling. Itโ€™s not just functional programming hype: it works. What about you? Have you implemented the Result Pattern in your codebase? โค๏ธ Like if this was helpful ๐Ÿ’ฌ Drop your thoughts below ๐Ÿ”„ Share with someone tired of chaos #dotnet #csharp #webapi #cleancode #resultpattern #errorhandling #programming #developerlife #softwarearchitecture #backend #restapi #minimalapi #aspnetcore #cleanarchitecture
1
3
48
๐Ÿ”ต ๐’๐ญ๐จ๐ฉ ๐“๐ก๐ซ๐จ๐ฐ๐ข๐ง๐  ๐„๐ฑ๐œ๐ž๐ฉ๐ญ๐ข๐จ๐ง๐ฌ ๐ข๐ง .๐๐„๐“ ๐Ÿ๐จ๐ซ ๐š ๐ž๐ฑ๐ฉ๐ž๐œ๐ญ๐ž๐ ๐ฌ๐œ๐ž๐ง๐š๐ซ๐ข๐จ Throwing exceptions everywhere? That might be killing your performance... and your maintainability. Exceptions in .NET are expensive, hard to test, and often misused for flow control. The Result Pattern turns error handling into a first-class citizen. In my blog, I show how I implement it in real projects using a reusable Result<T> structure with success/failure states. Link is in the comments! ๐Ÿ’ฌ Are you still relying on exceptions to control your flow? โค๏ธ Like if you learned something new ๐Ÿ” Repost and help others write cleaner APIs #DotNet #CSharp #CleanCode #ResultPattern #ErrorHandling #BackendDevelopment #BestPractices #CodeQuality #AspNetCore
1
1
4
102
Replying to @NetMentorTW
Depende del contexto creo... Si un input va a cambiar de valor lo mรกs prolijo creo que es un out parameter, como los tryParse. Si no va a ser algo reiterativo y tรบ versiรณn de c# lo permite, una tupla con nombres. Otro caso, una clase, sea temporal o no, como en un ResultPattern.
2
118