There are certain best practices every C# application should follow, right? Probably DRY, SOLID, Logging, Dependency Injection, Localization, Separation of Concerns, and Unit Testing at the very least. These seem like obvious things that every application should have. In this video, we are going to do something a bit unique. I am going to show you how to do all of those things, and I am going to show you why you shouldn’t always do those things. We are going to build the ultimate Hello World application. You won’t want to miss it.
Full Training Courses: https://www.IAmTimCorey.com
Source Code: https://leadmagnets.app/?Resource=PerfectConsoleApp
Patreon: https://www.patreon.com/IAmTimCorey
Mailing List: https://signup.iamtimcorey.com/
Thanks for the video. Is there a way to log messages to a separate console? I found a few examples where the instruction .AddConsole() is used, but it does not seem to create a saperate console..
A very good video. I don’t like the exception-driven development—if you can’t find the language or the key, log the error and then throw the exception to exit the program.
Excellent question 🙂
"We're gonna build. . . the ultimate hello world application."
Me: puts popcorn in the microwave and turns off phone.
If your like me, just skip to 50 minute mark
Instead of looping args:
string result = "en";
int i = Array.FindIndex(args, m => m.StartsWith("-lang="));
if (i > -1) result = args[i].Split('=')[1];
Hey Tim a complete tutorial on NSIS and Innosetup would be a great idea to include in your library.
Great video!
It just needs an OnExit event that says Goodbye World!
I'm not real clear on what events fire on exit.
I have been working as desktop application developer since 2018, so far I learned C#, Entity Framework, WPF with MVVM pattern , LINQ & Microsoft SQL server
now I want to learn and explore web development in .NET however I don't understand where to begin, especially in backend. I need your guidance Tim Corey
this might be odd, but i want to see you abstract this further towards an "enterprise" hello world app
If you would like to demonstrate source generators some day, the texts json would be a great example. 🙂
I really appreciated your comments in the last 10 minutes of the video about being pragmatic. In some cases, the added complexity is justified (or even necessary). In other cases, the simple approach is best. It depends. Thanks for having the guts to say it.
Awesome video, I do agree with you, a developer must knows the best practices but must not have it in every project. However, the developer must be careful with being pragmatic like this, depending on the company or the position of this dev, this may sounds lazy and lack of dev skills.
Am I the only one who finds it ironic that it takes an hour video to explain yet another best practice- YAGNI (You Aren't Gonna Need It)? I do love the video, but the irony amuses me.
46:43 the best part
I love this. This is an incredibly valuable lesson that usually can only be learned from making mistakes and learning the hard costly way. Been there many times. Lured by delusions of grandeur. Thanks Tim awesome video.
Great demo about some important stuff, but summary – priceless 🙂
So Tim here just built a bionic arm that can find and scratch the back of his head even tough he has a perfectly healthy hand. I love it.
A CommandLine parser (such as commandlineparser package) to simplify the syntax of manipulating passed arguments would add to perfection!!
In fact, this was the only part of your app, where you saw some minor inconvenience!
I noticed that you didn't create an interface for App and just instantiated the concrete type directly. Is this a case where an interface is overkill or is it a shortcut and a real app should have the IApp interface?
Hi Tim.
I totally agree with you that adhering to all practices and principles should come with requirement and not suggestions. I like that phrase so much I put it on my social media status 😂.
I inherited a project recently that implemented mediator pattern and a few other techniques that could have been avoided, don't get me wrong I think mediator pattern is fantastic but just like you I also like to write simple code to the point that a new developer should be able to understand my code without stress hence my preference to avoid unnecessary complexity and techniques. I think a lot of developers start to adopt complexity into projects from inception of the project because they always want to create room for the extensibility when the project grows to a massive scale, but not all projects grow to that point. How then can a developer identify a project that may or may not require complex principles and patterns? because introducing such principles after the early stage of a project could require more work.
35 minutes in: “We have successfully created a ‘Hello World’ application!”
I chuckled.
Dependeny injection is so f——ing overrated
BOLD!
Great video but would have appreciated chapters to jump to
Any discount codes available for your courses?
This helped me understand blazor even alot better, because all the pieces aren't wrapped up already.
48:30 Salut tout le monde means "Hello everyone". Remove tout and get "Hello world".
I am new to your channel and with your extended absence I started thinking I came too late as you clearly took your early retirement ! This didn't surprise me given my usual bad lack, always late to the party 😡
Now, with this good stuffs, not only you showed me wrong, but also it was worth the wait… Thank you Tim, keep it up <3
17:32 I recently discovered that one can simply use First with a conditional, like so:
CustomText? messages = messageSets?.First(x => x.Language == language);
I haven't done any performance comparisons, but I feel like it's cleaner. One could argue that it's not as clear as Where –> First.
Hi Tim, the request isn't related to video.
I have a class library with repository, but this repository needs settings that are in Ui project, because are stored in settings.settings file and I can't pass this static class to repository, so I have created a dictionary with informations and passed to the repository, is a good way to proceed or you suggest another strategy?
Thanks in advance.