Тёмный
Gui Ferreira
Gui Ferreira
Gui Ferreira
Подписаться
I help .NET Developers level up their skills. 🚀

Hey friends! 👋

My name is Guilherme, but you can call me Gui if Portuguese 🇵🇹 pronunciation is not your thing.

I see myself as a Minimalist Software Craftsman. That says a lot of what I talk about here.

So, why this RU-vid channel?
To share with you to simplify your life as a Developer through knowledge, technology and practices.

See you soon!
How do I Stay Organized as a Developer
15:21
14 дней назад
18 VS Code Tips to Code FASTER
17:39
Месяц назад
Getting Started with Test-Driven Development
30:01
2 месяца назад
The Best Practical Book to Learn Clean Code
10:42
2 месяца назад
Think About this Before Creating a New Mock
13:12
2 месяца назад
Coupling and Cohesion to Write BETTER C# CODE
17:19
3 месяца назад
This Book Changed how I Refactor Code
11:33
3 месяца назад
Coupling and Cohesion Explained
11:43
3 месяца назад
Stop returning null collections
2:33
3 месяца назад
How to Avoid Nulls
8:13
4 месяца назад
3 Tips to Clean Exception Handling
2:52
4 месяца назад
How to Survive a Layoff (as a developer)
5:03
4 месяца назад
The NETFLIX Way to Keep Your .NET APIs Reliable
13:57
5 месяцев назад
Hexagonal Architecture (All You Need to Know)
9:51
5 месяцев назад
Do NOT Use Int IDs In Your API
8:01
5 месяцев назад
Clean Architecture in 150 seconds
2:34
5 месяцев назад
Kiota - The NEW OpenAPI Client Generator
9:07
6 месяцев назад
How to use CancellationToken in ASP.NET C# API
5:33
6 месяцев назад
2024 .NET Software Testing Roadmap
7:51
6 месяцев назад
Do THIS and Avoid Package Upgrade Nightmares
6:58
6 месяцев назад
Комментарии
@bartholomewtott3812
@bartholomewtott3812 День назад
You fail to give a succinct definition.
@thanzeeljalaldeen
@thanzeeljalaldeen День назад
this looks great!, but how does it align with the DDD pattern. the validation and business logic should be in the domain model ryt
@jewersp
@jewersp 3 дня назад
I got another important rule: Always try to buy Super Bock. Only buy Sagres if there is no Super Bock.
@iliyan-kulishev
@iliyan-kulishev 3 дня назад
If we still rely on exceptions in the domain layer (at the point of constructing domain entities fx), then we have to manage the code duplication for every set of guards for the valid construction of each domain entity. If not, then for every use case/handler that directly or indirectly involves the creation of domain entity A, you would have to remember to guard against the things that might throw in the constructor of that entity. So, following this logic, it might be beneficial to rely on Result<> return types in the Domain layer, too. Domain entities with private constructors and public static Create methods that return Result<>, instead of public constructors that throw exceptions. But if we go Result pattern all the way, the codebase will become full of if statements and checks for the possible outcomes of every operation (is it Error or not). This in turn calls for implementing a small API for Result objects, which would make the whole use case logic look like a pipeline for Result returning operations. We would need a set of methods, that would allow us to seamlessly chain Result returning operations in a railway fashion. Methods like Map, Bind, Tap in the context of Result objects (inspired by functional programming). This is why Result pattern is often met with hostility by developers. I think it's great, but you need the whole team to buy into that pattern.
@tibba69
@tibba69 4 дня назад
Please do a result pattern video
@elirane85
@elirane85 4 дня назад
My rule of thumb: If you can expect that an error might happen but the code can recover and still run properly? Return Error. You have no idea what just happened and there is no way your code can run correctly in this state? Throw.
@zaidrj7374
@zaidrj7374 4 дня назад
Thank you Gui
@rafaspimenta
@rafaspimenta 5 дней назад
Should the cache be registered as a singleton rather than scoped? My concern is that using a scoped lifetime might result in the cache being recreated for each new logical operation within the application, which seems inefficient
@julienraillard3567
@julienraillard3567 5 дней назад
+1 for result pattern video too :)
@JoseFerreira-zb1ce
@JoseFerreira-zb1ce 5 дней назад
pareces feio na thumbnail, má representação da camisola bom vídeo
@thefarhadfarhadi
@thefarhadfarhadi 5 дней назад
I loved your explanation, there were so many RU-vid videos saying don't throw exception do this instead, but now I fully get it how to have the best of both worlds. Thanks a lot Gui!
@liam7073
@liam7073 5 дней назад
+1 for a result pattern video :)
@antonmartyniuk
@antonmartyniuk 5 дней назад
I am using a slightly different approach. I use exceptions in the domain layer as guard clauses, similar to what you showed. But I can also use Result Pattern in Domain Entities methods, for example: Shipment.Deliver(), Shipment.Cancel(), in those cases when my application code analyses the results, instead of handling exceptions to analyse the results. In other words, I use result pattern when I need to analyse the result of execution in the code. If I need to fail fast (guard clauses) I can throw an exception. For validation I use Result Pattern the same as you.
@stevehiggin
@stevehiggin 6 дней назад
Would you also consider putting the validation in an endpoint filter (in the minimal api case) so it would be validated even before entering the API method handler?
@cole5981
@cole5981 3 дня назад
Sure, even a built-in filter/pattern matcher returning a 404 is still "returning an error". Otherwise, write some middleware to handle it. Middleware is a hell of a drug; if you do it right, you can *significantly* reduce/simplify your code, just by removing the edge cases & validation from the core logic.
@MrBodyPower
@MrBodyPower 6 дней назад
Make video about results pattern
@99aabbccddeeff
@99aabbccddeeff 6 дней назад
Great explanation, thanks!
@br3nto
@br3nto 6 дней назад
Nicely presented! Some nice patterns to consider 😃
@LORDSAMZYGAMING
@LORDSAMZYGAMING 7 дней назад
I thought of the same thing too
@justsomejunk399
@justsomejunk399 9 дней назад
Looks like your paycheck depends on number of code lines?
@user-nh5fg4se5w
@user-nh5fg4se5w 10 дней назад
Hi gui, I recently started my career as a dotnet engineer. My questions is regarding courses, Are they relevant to the real softwares we built? Are they helpful in useful within the company as a developer or a tester? Please don't mind answering.
@danclarkeuk
@danclarkeuk 10 дней назад
I like the 'archive' folder idea. I'm mostly fairly happy with the layout of my notes (I use Notion for everything except client work, and Obsidian for client work (so those aren't on Notion's cloud)) - but as you say, quite often I have notes that I no longer need, but don't want to delete. Wil start introducing an archive folder. Thanks :)
@revillsimon
@revillsimon 11 дней назад
Thank you Gui. I watched your excellent presentation on Tech Excellence and was watching your video out of interest. I’m a frontend developer and after watching this it made me realise I could use this pattern to build dynamic DOM trees in my test suite without having to create any HTML files. After finding that working, I realised I could also use it to build a custom TypeScript module configuration per test. This has helped me so much, and is having a massive impact on my test code right now so thank you so much for this. 👍 I had been looking for a way to do this for a while and your video provided the answer with a really simple but powerful pattern.
@bharataghera1768
@bharataghera1768 11 дней назад
Thanks for this video. I didn't know any of them.
@vmachacek
@vmachacek 12 дней назад
I stopped taking notes 5 years ago and never looked back. Whatever I need is online..
@N1mdae
@N1mdae 10 дней назад
I'm mostly in the same path now
@vmachacek
@vmachacek 10 дней назад
@@N1mdae yeah, I see parallel between hoarding and taking notes in a sense. And I clarely ain't hoarder. When someone re-visits their notes good for them but I never did
@N1mdae
@N1mdae 9 дней назад
@@vmachacek Exactly, the most I do this days is to take some meeting notes or outlines to clarify some process in logseq or Tana, but ony for the ones I know I need to share or revisit beforehand.
@antonmartyniuk
@antonmartyniuk 12 дней назад
You don't need to remove and re-add dependencies in ConfigureTestServices method. set environment variables instead that will override the appsettings.json configuration. this way you will have a new connection string to RabbitMQ applied automatically.
@juanmanuelgutierrez159
@juanmanuelgutierrez159 12 дней назад
Great video, clear and useful content, as always 👍🏻
@phyokyaw7020
@phyokyaw7020 13 дней назад
good bro
@EMWMIKE
@EMWMIKE 14 дней назад
Would like to see Microsoft have a better solution by calculating UTC time based on local time and Country/State. Many times you only know local time of the event, and then maby country / country+state, example tracking events from carriers. And in DB you might need to store localtime and UTC ( which is unknown). Think NodaTime has some support, but it is still not great, it need to be combined with more packages to have a good solution for the problem. example: event happend "2024-07-14 15:30:45" in Poland. Would like to translate this to correct UTC time
@xelit3
@xelit3 14 дней назад
Great introduction video to TDD Gui! The example is really interesting to try it!! 👌
@pinguincoder
@pinguincoder 14 дней назад
Hey, im using a similar pattern in my current project but I'm having problems using that endpoint in unit tests because the HandleAsync method needs to have all the dependencies which would normally be in the constructor. Do you have any advice for this?
@JohanNordberg
@JohanNordberg 16 дней назад
Why is a mock of an interface and using Verify worse than creating a fake and checking that? They kinda of seem the same to me, and that the fake class is just more code to possible maintain. Btw, I like these short bitesized videos. I've learned a lot from them.
@brainiac4627
@brainiac4627 17 дней назад
What color scheme is this? Looks amazing
@migaldo
@migaldo 17 дней назад
After many years of accumulating notes and data, I came to the conclusion that I needed to reorganize everything depending on the current context, whether because I had a new responsibility or even changed department or company. Therefore, I thought that the root of the organization should always start with the chronology, for example the year and month (202407). So for each chronological workspace I would then place my P.A.R.P. - Projects, Activities, Resources, People. Then, within each of these folders I always have a Previous and Next link, which allows me to navigate the timeline when there is a match for the same organization in the previous/next period. Thanks for your session ideas.
@wely92
@wely92 19 дней назад
I started gradually organizing my work notes using para and enjoy it a lot, I'm planning to start organizing my personal digital assets similarly. One minor thing I do differently, I add numerical prefix to ensure archive is at the bottom (1 - Projects, 2 - Areas, 3 - Resources, 4 - Archive). I like seing projects as the top item that I should focus on short term :)
@gui.ferreira
@gui.ferreira 18 дней назад
Numbering is a good idea, especially because of the Archive. I like to have it at the bottom. Where do you keep your notes?
@wely92
@wely92 17 дней назад
@@gui.ferreiraI moved from OneNotes to Microsoft Loop
@wely92
@wely92 17 дней назад
I used to be in OneNote, but moved to Microsoft Loop
@FB-eb6tx
@FB-eb6tx 20 дней назад
Great content! Thanks! I'm interested in more videos like this!
@gui.ferreira
@gui.ferreira 18 дней назад
Thanks!
@juliansegura5507
@juliansegura5507 22 дня назад
I used this to create invoices on a system a while back. Didn't know it was a pattern at the time... I loved that "I came up with it" 😅.
@gui.ferreira
@gui.ferreira 21 день назад
That's a proof of greatness 😅
@tempusmagia486
@tempusmagia486 23 дня назад
can you make a comparison with the factory pattern? isnt this the same?
@junior.santana
@junior.santana 19 дней назад
You use a factory pattern to create/get an instance of an object encapsulating details on how it is created. Usually the caller only has to know about the abstraction, e.g., an interface and it calls the factory to create the instance. Multiple implementations might coexist and the factory is responsible for getting the right one. Builder is different. It's more of a sintaxe sugar, a way to build complex objects by composing steps. In this case, the caller has to know how the object is created
@guiportooo
@guiportooo 24 дня назад
Very nice approach receiving an action to build nested objects. I'll start using it :) For the required properties scenario, if you're using the builders for test cases, an alternative would be to have all required properties set to default values on your builder's constructor, so it's not possible to build an empty object for example. You won't have all the control you have with your steps approach but it's easier to maintain. I would also suggest checking the AutoBogus library to initialize your builders with generated data.
@atlesmelvr1997
@atlesmelvr1997 24 дня назад
why?... this is just bloat
@matthewrossee
@matthewrossee 25 дней назад
It's also worth pointing out that the builder pattern isn't always the best solution, especially when the object has multiple required fields, because then you're moving compile-time errors to run-time errors.
@MetronSM
@MetronSM 25 дней назад
Too much unnecessary code. Steps in predefined order etc.
@FilipCordas
@FilipCordas 25 дней назад
This is terrible code object initializes exist.
@gpzim981
@gpzim981 25 дней назад
The art or resolving non-existing problems
@junior.santana
@junior.santana 19 дней назад
Programmers: when we don't have enough problems to solve we make an effort to create them 😂
@FlippieCoetser
@FlippieCoetser 26 дней назад
Is it not less efficient to each time return the entire this?
@junior.santana
@junior.santana 19 дней назад
Nope. There's no entire "this", since it is just a pointer to the actual object
@skellious
@skellious 26 дней назад
thanks for the tutorial, very useful. One note on pronunciation, genre is more often pronounced zjohn-rah, rather than "jen-reh" which sounds a lot like you are saying "gender".
@stefan-d.grigorescu
@stefan-d.grigorescu 26 дней назад
Yeah, totally agreed
@jimiscott
@jimiscott 26 дней назад
Good demo, but why oh why did you use the builder pattern for a dto type object? I feel if you had a proper scenario the demonstration may have carried a bit more heft - what you have is an overengineered construction of an object that can/should be initialised with properties.
@stefan-d.grigorescu
@stefan-d.grigorescu 26 дней назад
Yeah, in such a scenario I would just use a parameterless constructor with required properties
@Timelog88
@Timelog88 18 дней назад
We currently have a DTO that is created in your suggested way, all IDE's and Linting tools go on a fit because the creation of that DTO goes over the cyclomatic complexity threshold we use (which is the default threshold IF you enable it). Why? Because the DTO is for a detail page that also contains nested collection that may or may not be empty, and the source we need to map it from can be null, so there is a lot of (list?. Where(x => x != null || x.blabla).Select(...) ?? Enumerable.Empty<Thing>()). The builder pattern is great for splitting up that logic in a way that's more readable and maintainable, especially when your DTO's are immutable value objects.