OpenDental on .Net Core

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
dcrider
Posts: 67
Joined: Sun Sep 29, 2019 11:03 am
Contact:

OpenDental on .Net Core

Post by dcrider » Tue Apr 13, 2021 9:35 am

Are there any plans to move away from WinForms and .NET Framework?

I personally would love to take advantage of the speed improvements provided in .NET Core (preferably .NET 5, but I know that's a big jump) and some newer language features in C# 8.0 such as Tuple patterns and nullable reference types.

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: OpenDental on .Net Core

Post by jordansparks » Tue Apr 13, 2021 10:14 am

We already use C# 8.0, which comes with .NET 4.7.2. We already use tuples and nullables. WinForms is a wrapper around C++ Win32, which came out in about 1995. Since then, there have been many new frameworks, but never a replacement for Win32. None of the newer frameworks have enough power. Yes, Win32 comes with a little bit of annoying baggage, but it's not that bad. C++ is still a first class language, and all of the newest Windows features build on it, including Direct3D. All of the massive PC video games are running Win32 at their core, not to mention Photoshop, Autodesk, etc. We use C# because it's a lot more fun, but we switch to C++ when we need more power. .Net Core is billed as a replacement for Win32. Good luck with that. I guarantee you that the engineers at Adobe will not rewrite their code in .Net Core. So no, I don't see any replacement for WinForms for at least 20 years, if ever. Eventually, there will be a better wrapper around Win32, but so far, no wrapper is superior to WinForms. WPF is an example of a newer wrapper, but it never really caught on. I didn't like it. I can imagine some nice improvements to WinForms, but MS doesn't seem interested at the moment.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
dcrider
Posts: 67
Joined: Sun Sep 29, 2019 11:03 am
Contact:

Re: OpenDental on .Net Core

Post by dcrider » Tue Apr 13, 2021 10:28 am

Thank you for that detailed response.

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: OpenDental on .Net Core

Post by jordansparks » Tue Apr 13, 2021 1:23 pm

One bad thing about WinForms is that each control -- each textbox, label, button, etc -- is a Win32 "Window". Think about that. One form in Open Dental can contain hundreds of Win32 child windows. That's nice sometimes, like if I want to use a completely different technology inside one control. But usually, I would rather not deal with all of that overhead. It seems cleaner to me to have the form draw everything in a composite. That's how WPF always does it, so that could be considered superior. But WPF doesn't give you a choice, so that's actually inferior. One thing I would love to do some day would be to build a compositing engine for the forms, all running Direct2D. It seems like a big job, but the benefit might outweigh the cost at some point. I think it would give instantaneous drawing instead of the current jittery look when resizing. Before that can be done, each control has to be rebuilt in C#. We've already done that with grids, listboxes, comboboxes, monthCalendar, buttons, etc. But we would need to do them all, including radio buttons, labels, tabs, and the dreaded textbox. The textbox is really hard to build. The richTextBox is too much. Anyway, after that, compositing would result in some nice eye candy.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply