8 ms·
I'm currently trying to write a windows app and coming from web development (Python/Django and React) it is bewildering. Part of the problem is with web develo
by imgabe 6y ago
I'm currently trying to write a windows app and coming from web development (Python/Django and React) it is bewildering.
Part of the problem is with web development, complicated as it is, the tutorials at least get you to a complete, working example. The windows tutorials seem to be very piecemeal where you start with a mostly complete app and fill in a couple things, but never get the whole picture.
And like in your first link, click on "Desktop". Ok, I want to make a desktop app. Now there are four options WPF, WinForms, UWP and Xamarin. Ok...Why are there four options? What are the differences? Are one or more of them about to be deprecated? What do I need to consider in order to choose one over the others?
I could go on. The windows developer website did point to some helpful C# tutorials and the language is actually pretty nice to work with, but figuring out how to do basic things like -- how do I store state in the application, has been very confusing.
- mikewarot 6y agoI have the opposite problem. On a PC, you can always store data, the graphics display exactly how you want, the feedback is instant, and you always know the state of things. You don't ever get disconnected from the user, nor have more than one at a time. My favorite platform is Lazarus/Free Pascal. The documentation is a bit sketchy, but the IDE and the applications it outputs seem solid. I'd prefer Delphi, but they priced themselves out of my world 20 years ago.
- lostcolony 6y agoWow. I knew Delphi was priced high, but I just went and looked...$1600 + $400 a year every year thereafter. And they have a community edition...but if you make $5k or more as a consultant, -even if it's not using Delphi-, you can't use it.
- munchbunny 6y ago> how do I store state in the application I can’t speak for all of the challenges you might be dealing with, but this one in particular seems like something specific to native development. You have a wealth of options, and at the same time because of that fact there is are fewer defaults compared to web dev and you have to do more work to make the decision. Personally I default to two options unless performance requires otherwise: SQLite or JSON stored in files.
- jiggawatts 6y ago> Are one or more of them about to be deprecated? All of them are. Not officially, of course, but practically speaking all of them are dead-ends. MAUI is the "new hotness", which means that it'll only become obvious that it is also a dead end in about a year and a half. I wish I was joking.
- andi999 6y agoAt least until last year, I think the community used mostly winforms if it is for Windows operating system. MS is not too happy about that.
- Traubenfuchs 6y agoBecause winforms is an incredibly easy and solid technology. It's a joy to work with.
- kaba0 6y agoCPU rendering should not be a thing in 2021
- t-writescode 6y agoCPU rendering is an implementation detail for the majority of WinForms. Unless you're running the paint component command yourself, that could be offloaded elsewhere.
- kaba0 6y agoIt is an implementation detail, but we are talking about a concrete framework with one implementation, not an open spec API. And as far as I know it visibly flickers on any window that has like more than 3 input forms.
- jiggawatts 6y agoWhen WPF was first released, toy applications would make both my CPU and GPU fan spin up to gas turbine levels. Now only WPF applications that try to show more than a dozen controls at a time make the GPU fan spin up, a huge improvement. I suppose this explains the new "flat" style with huge amounts of white space. It's not about elegance, or style -- it's the only way to keep fan speeds tolerable.
- manigandham 6y agoDesktop UI is very different from web, and most languages have multiple choices. WPF is the latest Windows-only, Windows Forms is legacy (from Windows XP era), Xamarin is cross-platform. These is in the descriptions on the page, or you can click on the documentation and follow the breadcrumbs to the main topic for the Desktop Guide: https://docs.microsoft.com/en-us/dotnet/desktop/?view=netdesktop-5.0 https://docs.microsoft.com/en-us/dotnet/desktop/?view=netdes... However you can just use Electron if you want to reuse web UI skills on desktop (although HN hates that). Likewise you can solve the state problem the same as a web backend. Use an external database, or a local database, write to a file, just keep it in memory, or use any of the OS-specific options. I recommend starting with EntityFramework (an ORM) and using the Sqlite provider: https://docs.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli https://docs.microsoft.com/en-us/ef/core/get-started/overvie...
- tonyedgecombe 6y ago>WPF is the latest Windows-only No it isn't. WinRT, UWP and WinUI are all later than WPF.
- nizmow 6y agoThis is probably more of a Windows problem than a .NET/C# problem, but it's a very real problem.
- mrweasel 6y ago> Now there are four options WPF, WinForms, UWP and Xamarin. Ok...Why are there four options? What are the differences? Are one or more of them about to be deprecated? You're most likely best of picking WinForms. It's old school, but it seems like it's going to be the one Microsoft will have the hardest time killing. WPF, UWP and Xamarin fine frameworks, but for the 0.9X developer who just want a window, with a few input and some buttons, you can't beat WinForms in ease of use. My reasoning is that most of the developers who saw WPF and jumped on that, are the same who will more easily jump to UWP, and from there to what ever comes next. The WinForms developer aren't moving.
- brtkdotse 6y ago> 0.9X developer That's pretty fantastic. Stealing this!
- mr_overalls 6y agoMeh, everybody is a 0.9X developer in many areas outside of their specialty. I'm a data engineer who specializes in security. I only need to generate a GUI or CRUD webapp once in a blue moon. So a stack that makes sane choices for me and holds my hand a bit is greatly appreciated.
- Gibbon1 6y agoVS + WinForms is like the Playschool Windows GUI development kit. That sounds like talking it down, but I'm not actually. Good for things like the sales guy wants something that pulls data out of a company database and sticks it in a excel file. And wants it tomorrow.
- andi999 6y agoGetting the job done is an important aspect of a toolchain.
- jiggawatts 6y agoAs a casual programmer, I've used WinForms successfully to write both trivial and somewhat complex GUI tools. I've never been able to use WPF to write anything useful, I just couldn't scrape together the patience required to adapt to it.
- andix 6y agoNative UI development is a mess. On any platform. It's super complicated. You will always be unhappy with any choice of UI framework, on any platform :)