Long video about marshalling will be awesome. Thanks
@Codewrinkles Жыл бұрын
Noted!
@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 Жыл бұрын
Thank you so much for sharing this
@Codewrinkles Жыл бұрын
Any time!
@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 Жыл бұрын
How about using nameof(Gender.Male) to get "Male" ?
@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 Жыл бұрын
@@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 Жыл бұрын
@@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.