AVOID these 3 COMMON C# Performance MISTAKES

  Рет қаралды 8,970

Codewrinkles

Codewrinkles

Күн бұрын

Пікірлер: 11
@ThreeHubs
@ThreeHubs Жыл бұрын
Long video about marshalling will be awesome. Thanks
@Codewrinkles
@Codewrinkles Жыл бұрын
Noted!
@Pegie98
@Pegie98 Жыл бұрын
Nice video! My question is regarding Asynchronous programming in Windows applications. Specifically, the sample form_load event currently uses a void method. I am interested in implementing an Asynchronous method in this event, but I am not sure how to do so. Can you provide guidance on how to properly implement an Asynchronous method in the form_load event and other control events in a Windows application? Thanks
@lucasblomhall1184
@lucasblomhall1184 Жыл бұрын
Thank you so much for sharing this
@Codewrinkles
@Codewrinkles Жыл бұрын
Any time!
@owenpbarker
@owenpbarker Жыл бұрын
If you ever say "This code is complicated" start over and redo it. I know this is an example of what you are trying to explain. I see all these devs trying to do complex code but in reality, if you simplify it, you wouldnt have all these apis having massive development steps just to bring it out. Stop writing complicated code. If its easy to read your code, it is easy for other developers to expand from your current code for other parts of the api, app, etc.
@kamaldesai933
@kamaldesai933 Жыл бұрын
How about using nameof(Gender.Male) to get "Male" ?
@Codewrinkles
@Codewrinkles Жыл бұрын
A nameof expression produces the name of a variable, type, or member as the string constant. Therefore it would work the same as the constant string I mentioned in this video. The only problem with nameof for enums comes when you have something like Roles.ProductManager, Roles.SoftwareDeveloper and you would like to output "Product Manager" and "Software Developer". That's why I only talked about const strings in this video.
@dikod1304
@dikod1304 Жыл бұрын
@@Codewrinkles and what about scalability? so if we add one more enum type, we have to update application in order to add new const
@Codewrinkles
@Codewrinkles Жыл бұрын
@@dikod1304 Exactly. Everything is a trade off between what's most important in each given scenario. You can have different approaches. For instance having consts only for enums that we heavily use with ToString() and that have composite enumerations (like UserManager). For enums without composite enumerations you can use nameof. If the enums are not converted to string that often you can then just use enums regularly. As developers we need however to be aware of the pros and cons of each approach so that in a given and very specific context we can make the right choices.
@teckyify
@teckyify Жыл бұрын
nameof(Enum.P)
ASP.NET Core Controllers - Keep them Clean with these 3 Tips
34:27
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
m
5:22
ADRIANA FRANCO
Рет қаралды 4
Don't Use AutoMapper in C#! Do THIS Instead!
16:17
Codewrinkles
Рет қаралды 71 М.
You've Been Using Java Strings WRONG All This Time!
9:15
Amigoscode
Рет қаралды 91 М.
C# Async Await Mistakes | Part 1
10:19
Amichai Mantinband
Рет қаралды 37 М.
Don't throw exceptions in C#. Do this instead
18:13
Nick Chapsas
Рет қаралды 264 М.
The 3-line C# riddle that everyone is getting WRONG
11:19
Amichai Mantinband
Рет қаралды 37 М.