Live data from Hacker News

Windows native app development is a mess

domenic.me

281–290 of 481 posts

Re: Windows native app development is a mess

#281
post #11

I'm an embedded programmer who occassionally needs to write various windows programs to interface with embedded devices (usually via serial port or usb), and I find it a breeze to write native gui programs in pure win32 and c++. Recently had to add a new feature to and old program that was last updated in the XP era and two things to note: 1. The program did not need to be updated to run on Vista, 7, 10 and 11, shit…

I've not done MFC Win32 programming since 1999 but if I recall those programs don't execute the main() function. They instantiate the Win32 class for your app or something like that. I can't remember any details anymore.

You still have a main function in Win32, it's just called WinMain and has a slightly different signature.

MFC has CWinApp, which you'd normally subclass, and a stock WinMain implementation that instantiates that, but it's not strictly necessary to subclass it, just convenient.

Re: Windows native app development is a mess

#282
post #69
post #38

Seems to me that really the simplest solution to authors problem is to write C++ safely. I mean...this is a trivial utility app. If you can't get that right in modern C++ you should probably just not even pretend to be a C++ programmer.

Just write C++ safely! Why didn't we think of that?

C++ is hard to get safe in complex systems with hard performance requirements.

If the system is simple and you don't give a shit about performance, it's very very easy to make C++ safe. Just use shared_ptr everywhere. Or, throw everything in a vector and don't destroy it until the end of the program. Whatever, who cares.

Re: Windows native app development is a mess

#283

I agree with all the comments here saying "stick with Win32" --- this is "a mess" that you can easily avoid. Speaking as a long-time Win32 programmer, the requirements for your app are doable in a few KB (yes, kilobytes --- my vague estimate is less than 8KB) standalone executable. This is how I arrived at that: Enumerating the machine’s displays and their bounds A few API calls. Probably a few hundred bytes. Placing…

How do you make your win32 app look good to the average person?

Disable borders and design your app nicely with images to replace standard user input elements.

Re: Windows native app development is a mess

#284

Earlier quoted context omitted.

My company is moving our main LOB app to .NET 10 in the near future. It's taken a while but has gotten to the point where .NET 10 has pretty much caught up to .NET Framework for feature support, and our take is that the cross-platform support, performance gains and newer C# versions are worth more than the stability of .NET Framework. And the gap's going to keep growing - doing the upgrade now means future upgrades c…

If .NET had a desktop UI for Linux it might be worth it for me, but we haven't gotten there yet somehow.

But there are libraries that do that, e.g. https://avaloniaui.net

Re: Windows native app development is a mess

#285

Earlier quoted context omitted.

Just use Qt. Native, cross-platform, works like a champ.

Cross-platform and native never works well.

Qt works very well because it's well thought out software. There's a lot of really shit solutions out there, but basically nothing touches Qt.

Re: Windows native app development is a mess

#286
post #58
post #11

I'm an embedded programmer who occassionally needs to write various windows programs to interface with embedded devices (usually via serial port or usb), and I find it a breeze to write native gui programs in pure win32 and c++. Recently had to add a new feature to and old program that was last updated in the XP era and two things to note: 1. The program did not need to be updated to run on Vista, 7, 10 and 11, shit…

Honestly, your GUIs are too simple to be part of this conversation. Try writing something like Spotify in WinAPI and that's not even a complicated GUI either.

> Try writing something like Spotify in WinAPI and that's not even a complicated GUI either.

Fruityloops, now FL Studio, was written in Delphi and to my knowledge still is[1]. When ot launched there were no options but Win32 for Delphi.

That's just one example. Win32 makes it reasonably easy to skin things, and back in the 2000s a lit of programs did.

[1]: https://blogs.embarcadero.com/fl-studio-is-a-massively-popul...

Re: Windows native app development is a mess

#287
I wrote a Win32 app 20 year ago, but the limits to how it handles memory made things confusing when you loaded large amounts of data into the GUI.

I would say Java Swing is still the peak of GUI development. Works flawlessly at close to native speeds (GPU acceleration and all) on all platforms including Risc-V that did not exist when it was developed!

The JVM is the emulator!

Re: Windows native app development is a mess

#288

Earlier quoted context omitted.

If your application saves me time (is intuitive) or enables me to do tasks that I couldn't do before (is powerful) then I don't care one whit what it looks like. As long as it doesn't actively hurt my eyes to stare at you can do whatever you want.

Sure, if I'm building something for myself or fellow hobbyists this approach works (though in that case I'd prefer a good TUI/CLI). But if you're building an app for the average person, how it looks has a big effect on whether they choose it over an alternative.

It's funny, the "modern" look has become a countersignal for me. If the app looks like a webpage, I instinctively don't want it. Not because of aesthetics, but simply because I've come to associate that style of appearance with a lack of (or awkward) keyboard shortcuts, featuresets dumbed down to a level appropriate for chimps, various nags injecting friction against getting work done (ads, feature tours, logins, update reminders, etc) and laggy, resource-squandering performance thanks to some kind of bloated rendering framework like Electron with multiple V8 hosting processes sprawled across chrome.exe instances or whatever.

Case in point, the Dropbox Simplified Desktop App was a huge improvement for me. It nails just about everything I ever needed their app to do, and removes all the user-hostile fluff I never asked for. Similarly, I found Windows 11 Enterprise IoT LTSC to offer an improved desktop experience compared to traditional Windows, thanks to its exclusion of a lot of the cruft Microsoft otherwise shoves down the throats of users who, as far as I can tell from frank discussions with many of them, likewise actively don't want.

I'm not saying your desire to make your app look polished means it's crap, but beauty is in the eye of the beholder. Just like fashion, I wouldn't be surprised if we see a shift in the aesthetics trend as more people discover a retro feel sometimes signals a better user experience.

Re: Windows native app development is a mess

#289
post #11

I'm an embedded programmer who occassionally needs to write various windows programs to interface with embedded devices (usually via serial port or usb), and I find it a breeze to write native gui programs in pure win32 and c++. Recently had to add a new feature to and old program that was last updated in the XP era and two things to note: 1. The program did not need to be updated to run on Vista, 7, 10 and 11, shit…

I feel like I'm the only person in the world who would rather write ugly win32 jank for the rest of my days than ever having to touch an "elegant" or "well structured" Cocoa codebase. In win32 if you want a button you call a function and pass a hande, in the Apple world you first subclass 7 interfaces in some unreadable Smalltalk-wannabe syntax and pray you don't need to access the documentation. And of course they c…

What are you talking about? In Cocoa if you want a button you drag one in via Interface Builder. You don't even need to write any code. If you want it to do something, you type the name of the function it should call.

Re: Windows native app development is a mess

#290
post #283

Earlier quoted context omitted.

How do you make your win32 app look good to the average person?

Disable borders and design your app nicely with images to replace standard user input elements.

That sounds like a great way to make a mess. Look at Microsoft's own apps shunning proper File dialogs and instead presenting a giant, bizarre pane of mostly text and a few crudely-drawn boxes in order to save a file. You have no idea what you're looking at or where you are in the file system.

Then there's the removal of title bars from Windows. You often have no idea what app you're looking at. Pull up a PDF in Acrobat and also in Edge. Now, at a glance, which is which?

Regressive garbage.

Post reply on HN