|
-
Questions Surrounding NotInheritable
I've been developing in VB.NET for a while now (check the VBF join date), but I've only recently started using AI to help me develop. Something I do very frequently is give an LLM a database schema definition and tell it to give me the corresponding .NET POCO definition. It spits out the accurate definition probably 95% of the time in less than 30 seconds and greatly simplifies a tedious part of my job.
When I was doing this in C#, I noticed that the generated code included the sealed modifier in the class, but when I'd do the same thing in VB.NET it omitted it. Doing some digging, I found that there is a corresponding MustInherit modifier, but I wanted to get some clarification rather than using it carte-blanche.
I can understand using it for performance reasons, e.g. I have a class and nothing's inheriting it, then mark it as MustInherit and JIT can presumably do its thing to make the code more performant. Then if I ever need to inherit it, then I can remove the modifier from the parent class and add it to the child class.
But I'm wondering about other use cases when the MustInherit modifier makes sense, and I was hoping for some input.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|