52 ms·
Ask HN: Why is building Windows apps so complicated?
So I decide to build a windows 11 app. I already know some .NET and C/family from school and look through the source of C# and it doesn't seem too complicated.
However, building Windows apps is very complicated even when you know C++ or C#.
1. I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think. I don't really know the difference between the 3 and no one really explains that (unless Win32 which is obvious).
2. Apparently, WUP is no longer recommended. A few years they were pushing it to the max. Bummer.
3. I installed Visual Studio overnight (it comes with all the tools that building apps need). It downloaded 6GB of data and used 20GB of storage. All i want to build is a hello world app.
4. I create a project following a guide from Microsoft.
5. The app is extremely resource heavy and way too over-featured. I build the boilerplate app and Run it and it takes minutes to build (most of the time is downloading dependencies so not such a big deal).
6. I open the newly created app in Sublime Text (my editor) and I can't find a way to build the app anymore.
7. Because Visual Studio is so bloated, I download Visual Studio Code, which is far more simple but I can still not figure out how to build my app even with the various extensions VS code boasts.
8. After hours of googling, I formulate a script that can build the app from the command-line.
9. But I stil don't know how to build the app as the .exe file created does not execute.
10. I'm very disappointed.
The worst of all is that there is not even one good guide on the whole clearnet on how to do develop a Hello World windows app from scratch.
- fortran77 5y agoComplicated? It's the easiest thing in the world -- when compared to building an iOS, MacOS, or Linux GUI app. You should use "Visual Studio" https://www.codeguru.com/csharp/hello-world-c-sharp-windows-11/ https://www.codeguru.com/csharp/hello-world-c-sharp-windows-...
- wedesoft 5y agoI can recommend Qt https://www.qt.io/ https://www.qt.io/ . Not only is it a well designed C++ library, but it is also cross-platform. For creating Windows installers, I use NSIS.
- amelius 5y agoAndroid development also sucks.
- deleted 5y ago[deleted]
- mmargerum 5y agoUse Delphi or Lazarus. Superlative windows development tool.
- aristofun 5y agoDeepest reason — there is no incentive to make it simple, nobody is going to pay for that. Even the opposite is true — the more complicated technology is — the more services around it you can sell. K8s is another example of this pattern (i usually get a lot of dislikes for this statement, which ironically proves the point, because people usually react more to uncomfortable truth).
- smishra12345 5y agoUse PureBasic and build small, fast native GUI programs with no dependencies quickly. There is no dependency - it uses Win32 UI. As an added bonus, you can compile your programs to run on Mac, x64 Linux, x86 Linux as well as Raspberry Pi. The program is stable, and has a good community.
- JaggerJo 5y agoUse WinUI. The end.
- vixalien 5y agoThat's what I tried.
- eganist 5y agohttps://docs.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-wpf https://docs.microsoft.com/en-us/visualstudio/get-started/cs... I take it you're leaning largely on this?
- wheybags 5y agoThis is part of the reason why electron is so popular these days.
- dandigangi 5y agoIs it still that popular? Felt like it peaked but not the type of software I do so I might be out of the loop.
- adhoc_slime 5y agoI would say it did peak but it hasn't quite let up yet in my experience. So many companies, especially startups, fall into electron as a defacto desktop application framework because of it's cross platform promises. having worked at a company that's gone down that road, I think the jury is out whether that was a great move.
- shaan7 5y agoPretty much all "desktop" apps that I see people using these days are built on Electron so yeah it is quite popular. Slack, Discord, Teams, Spotify, VSCode, the list is too long, unfortunately.
- sys_64738 5y agoI saw this with the draw.io desktop app which turned out to just be a big bloated Electron package by looks of it. I have a browser for that already.
- dandigangi 5y agoNot saying this is on the same level but I find it interesting that apps at that scale can run on Electron but Facebook's old non-native mobile apps performance was awful.
- pseudalopex 5y agoTheir performance is awful too.
- Dayshine 5y ago1. Install the .NET 6 SDK: https://dotnet.microsoft.com/en-us/download/dotnet/6.0 https://dotnet.microsoft.com/en-us/download/dotnet/6.0 2. Terminal ,pick a folder, `dotnet new wpf` 3. `dotnet run` and you have an (admittedly empty) hello world app It's telling me it took 1.5s to build the app. Want to publish the app? `dotnet publish -o ./publish -r win-x64` which takes a bit longer as it has to download some runtimes (60 seconds max, then cached). Zip up the resulting folder and ta-da you have an application. Just unzip and run the .exe. If you want a single-file exe (as in completely statically compiled without self-extraction) that's a bit more advanced and requires a few properties in the csproj to configure how to handle native assemblies that expect to exist on disk. If you want it to have no runtime dependencies, add `--self-contained`
- vixalien 5y agodotnet does not work with winui3 apps. I can't link the relevant stackoverflow answer from a microsoft dev. You can only use msbuild.
- oblio 5y agoThat's pants on head stupid.
- sixothree 5y agoHow so exactly?
- oblio 5y agoThe fact that 2 major Microsoft products don't integrate fully.
- pjc50 5y agoThey're two almost-identical pieces of software that parse almost-identical file formats. They may or may not share a codebase (five minutes on github hasn't clarified this), and in most cases you can substitute one for the other. Except this one. And the developers (of whom there are not many for WinUI!) forgot this use case because they're focused on building inside VS.
- chucktingle 5y ago>so complicated Compared to what? GUI programming has always been hard on all platforms I tried.
- interactivecode 5y agoMacOS is simple, open xcode, new project, choose the app and press run.
- tester756 5y agoWell, so just like on Windows :P Open VS -> New Project -> Winform/WPF -> Run
- vixalien 5y agoto elabolate: 1. Open VS, wait a minute. 2. New Project 3. Run, wait 10 minutes for dependencies to download. 4. Want to use Sublime Text or VS Code, haha lol.
- tester756 5y ago>3. Run, wait 10 minutes for dependencies to download. Why would you need 10 minutes? >dotnet new winforms >dotnet run >app appears takes a few secs even on old .NET there was no such a thing like 10 min wait for dependencies to load
- washadjeffmad 5y agoYou didn't ask about their internet quality, computer specs, etc. If you're used to developing on Linux where you can self-host entire repos, it's incredible how fragile and ephemeral the MS stack must feel.
- tester756 5y agoWhat do you mean? >If you're used to developing on Linux where you can self-host entire repos, it's incredible how fragile and ephemeral the MS stack must feel. I guess he's talking about restoring nuget packages, so of course you don't want to have all existing nugets in all versions on your disk.
- madsbuch 5y agoI recently had to develop a small application for the MS ecosystem (An Office add-in) and as I use Pop OS as my daily driver, I had to switch to my Windows partition. While this was considerably simpler than what you describe, it was a very bad experience developing on Windows for the MS ecosystem. Bad and bloated documentation and boiler plate code of very low quality. It seems like MS responds to the competition with quantity instead of actually building some quality packages and frameworks.
- ripley12 5y agoYeah, developing Office add-ins is a nightmare and the Office team has totally screwed up Office extensibility. FWIW they march to their own drum, they are largely independent of Windows and Developer Division. I would not tar all of Microsoft’s efforts with the same brush.
- dustinmoris 5y ago> It seems like MS responds to the competition with quantity instead of actually building some quality packages and frameworks. This! 100%! For many many years now. It's painful for all people involved (including the .NET community). Microsoft doesn't mind though, they love developing a shitload of competing frameworks, because once a framework hits version 3 or 4 where it starts to feel slightly mature then the internal incentives require the teams to dump the project and "invent" something new to stay relevant internally.
- quaintdev 5y agoI would not recommend this for serious use but Flutter on desktop is taking a good shape. If you have tried Flutter for Android then developing for desktop is pretty easy. Although they are still ironing out some core functionalities it's something you can try and use for application development for both Linux/Windows.
- deleted 5y ago[deleted]
- vixalien 5y agoI want to build using the native stacks as it's verrrrrrry fast.
- josalhor 5y agoI find it very amusing that the current answers suggest: - WPF with NET 6 - Electron - WinUI - Flutter - That GUI programming is complicated
- giancarlostoro 5y agoI mean tell me how to make a UI on Linux? Mac has it somewhat more streamlined oddly enough.
- gladinovax 5y agoI use tk if i need a gui on linux
- datavirtue 5y agoFire up netbeans, create a new swing project, and hit run. One setting and you can make a fat jar. Double-click to run--everywhere. One line of code and you can apply a modern UI theme that just works.
- Andrex 5y agoHello World in GTK[0] and Qt[1] is simpler than the OP's experience. Gnome includes Gnome Builder[2] in most distributions, which makes it incredibly easy to start making Gnome/GTK apps. Developers can also leverage Flatpak and Flathub for near-universal distribution. 0. https://www.gtk.org/docs/getting-started/hello-world https://www.gtk.org/docs/getting-started/hello-world 1. https://doc.qt.io/archives/3.3/tutorial1-01.html https://doc.qt.io/archives/3.3/tutorial1-01.html 2. https://wiki.gnome.org/Apps/Builder https://wiki.gnome.org/Apps/Builder
- symlinkk 5y agoDepends on the distro, but typically it’s GTK if you need something native, Electron otherwise.
- temac 5y ago> I mean tell me how to make a UI on Linux? You copy paste a ten lines gtk or qt hello world, install a few packages (certainly not 20 GB), in a terminal go in the right dir, and type something like 'make'.
- usrbinbash 5y agoHave you tried Fyne? https://github.com/fyne-io/fyne https://github.com/fyne-io/fyne
- jonathanstrange 5y agoI'm currently using it for a project, but I wouldn't say it's ready for most applications yet. First, there is still no rich text editor. Second, the layout handling is overcomplicated and has the worst defaults I've ever experienced in any desktop application framework. I'm not sure the developers really have worked with convenient frameworks before. For example, there is no maximum size for controls, only a minimum size, and virtually all standard layouts create every embedded control with the smallest size possible. Not only that, the minimum sizes are unreasonable. For example: Make a window with a vertical splitter, put some arbitrary textboxes in one half of it, and they will all have some arbitrary small minimum size. The rest of the split window remains empty. I know of no GUI framework with such an insane default positioning. Try to fix this problem with a "maximum layout" - It doesn't work! Either the controls are now overlapping (one of the rarest use cases ever), or the layout does not have any effect at all. Another problem: On my Linux system, every third or fourth application start totally messes up the layout. Quit and start it again, and the layout is fine again. WTF? In a nutshell, Fyne needs a bit more time to mature before it's a viable option for Go, but unfortunately it already suffers from few bad design choices regarding layout. It's also not a good idea to separate controls and layout. This may sound good on paper but in reality it just leads to tons of boilerplate code.
- tester756 5y ago>Because Visual Studio is so bloated It's definitely huge tool, but it allows you to do a lot of kind of developments. I think it's very decent tool if you want to do C# development, especially when you want to have reliable intellisense and strong debugging tooling (expression evaluation at fly, changing code at fly, moving to different lines during debugging, conditional breakpoints)
- vixalien 5y agoIt's bloated for Hello World
- jmnicolas 5y agoYeah but nobody develops hello worlds for a living.
- DaiPlusPlus 5y agoI'll throw some shade on the instructors at Coding Camps
- 323 5y agoBuilding Windows apps is easy, but you need to use the right tools instead of the legacy Microsoft ones: https://www.electronjs.org/docs/latest/tutorial/quick-start https://www.electronjs.org/docs/latest/tutorial/quick-start
- distantsounds 5y agoVisual Basic. https://docs.microsoft.com/en-us/visualstudio/ide/create-a-visual-basic-winform-in-visual-studio?view=vs-2022 https://docs.microsoft.com/en-us/visualstudio/ide/create-a-v...
- nerdywordy 5y agoWe have a Windows POS app for mines, quarries, sand and gravel, etc. When we broke ground on this version Microsoft was hardcore pushing UWP. We were building for the future so we built our app within the constraints of UWP with the expectation that it would grow with Microsoft’s vision… Fool me once, as they say. UWP is dead. We are currently redeveloping the entire thing with a series of Win32 base classes and intend to layer on a WPF front end for now. WinUI is early and promising. But so was UWP. Long term we’re exploring outside the box UI options like running a local server and popping a browser. C# and .NET are very powerful. But the fractured landscape for desktop development gives little hope for the future. If your goal is to build a rich UI, then you may have to suffer through learning whichever flavor of XAML you decide to go for. But if your goal is to interact with local hardware functionality I’d probably steer clear and use WinForms, a browser interface, or a console interface.
- nyuszika7h 5y ago> Long term we’re exploring outside the box UI options like running a local server and popping a browser. So... basically Electron?
- nerdywordy 5y agoSort of. But not an embedded browser. And .NET instead of JS. There are some promising developments with Blazor and .NET MAUI. But it all seems too speculative to build on at this point.
- nyuszika7h 5y ago> .NET instead of JS If you don't use JS, wouldn't that mean reloading the whole page for every action? Or do you still use some minimal JS to improve the experience?
- jmnicolas 5y agoI'm mainly on WPF, so I might say something wrong, but I think adjusting your UWP app for WinUI would be a breeze compared to redeveloping everything with Win32.
- revskill 5y agoThese days, for enterprise application, ElectronJS is enough for most of use cases. You don't need a PHD in Computer Science to do that. Just learn basics of JS, HTML, CSS is enough.
- vixalien 5y agoI think the web is not the answer to all. All I wanted to build was a native windows app. Not to mention that Electron apps (or zombie apps as some call them) are very resource intensive and bloated. It's basically running the entirety of Chrome to show a few HTML files. Get out of the comfort zone and use an older computer and try run an Electron app.
- 323 5y ago> All I wanted to build was a native windows app. You can't have it both ways. As you found out, building native apps is very complicated and slow. Young devs don't have the pain tolerance of old school devs which had no alternative but to suck it up, endure the pain and march on. But today you have a choice - be immoral and productive with Electron, or moral, slow and out-of-the-comfort-zone with the native toolkit. The answers to all of the problems you listed are in the Microsoft online docs, but it does requires hours of reading to learn how all the pieces fit together. Native app development in C++/C# is not like "build a to-do web app in 10 minutes". Which is why very few build native apps anymore, because devs want instant gratification and native development is anything but.
- yjftsjthsd-h 5y ago> You can't have it both ways. As you found out, building native apps is very complicated and slow. You certainly can; Visual Basic and Delphi send their regards. If "modern" tools have regressed then they're deficient.
- easrng 5y agoModern non-web tooling has regressed. For example, in 2018 you could download and install Qt and pyqt, make a UI in Qt Designer, run it through pyuic and have a working UI. I'm not sure when it changed but now once you find the installer, get through the Qt account requirement, and actually install, Qt Designer is nowhere to be seen. It may be hidden away in their IDE somewhere now, but I couldn't find it.
- einpoklum 5y agoAbout the humungous Visual Studio download - that's annoyed me as well. I recently asked: "How do I obtain Microsoft's C++ compiler and standard library (and just that)?" https://stackoverflow.com/q/69274364/1593077 https://stackoverflow.com/q/69274364/1593077 and the answer was either "You can't" or "It's complicated". I gave up and used the MSVS installer. And you _still_ need to invoke a complex script to get your environment in order.
- e12e 5y agoI'm not sure what you mean with "just that", but eg the scoop package manager has visualc package: scoop bucket add extras scoop info visualc > (...) > The command-line compiler > functions of VS 2010 C++ scoop install visualc https://scoop.sh https://scoop.sh https://github.com/ScoopInstaller/Extras/blob/master/bucket/visualc.json https://github.com/ScoopInstaller/Extras/blob/master/bucket/... Might be something via chocolaty/winget too?
- einpoklum 5y agoI had not found a simple chocolatey-based option. But - can you explain whether scoop is a chocolatey alternative or something else?
- e12e 5y agoScoop is a bit like a user focused apt/homebrew. It's mostly for installing programs, not development dependencies. https://github.com/ScoopInstaller/Scoop/wiki/Chocolatey-Comparison https://github.com/ScoopInstaller/Scoop/wiki/Chocolatey-Comp...
- RapperWhoMadeIt 5y agoThere's a really simple solution. Don't develop for Windows. Literally, most UNIX systems were created with the intention of having the developer experience in the foreground! Just pick one and be happy :)
- deleted 5y ago[deleted]
- keewee7 5y agoListen to the .Net community and pick WPF. Don't listen to whatever the Microsoft marketing department is hyping.
- atraac 5y agoEveryone here sugesting electron or wpf but really… Just look up Avalonia and be done with it. Not everything has to be browser based or made by Microsoft. https://avaloniaui.net/ https://avaloniaui.net/
- Dayshine 5y agoOr even better, commit to MVVM and then you can swap between WPF, Avalonia or w/e Microsoft next comes up without having to rewrite everything.
- azalemeth 5y agoDoes qmake/Qt work sensibly in Windows? I've never tried it, but on *nix it's very, very easy to make a simple gui app with Qt, no real ide required. (0) 0: https://www.wikihow.com/Create-Your-First-Qt-Program-on-Ubuntu-Linux https://www.wikihow.com/Create-Your-First-Qt-Program-on-Ubun...
- vixalien 5y agoI know. This is what windows need to learn from *nix.
- ihaveajob 5y agoYes, that's what we use. We initially planned it as a multiplatform approach, but on Mac we went native. We routinely get complaints about the app being old school and "ugly", but on the flip side, we didn't have to learn C#.
- hermitcrab 5y agoqmake and QtCreator work great on Windows and Mac. QtCreator calls the command line version of Visual Studio on Windows. The QtCreator debugger works seemlessly. (NB/ I'm still on Qt 5)
- dgfitz 5y agoYes, as long as you have visual studio installed it is quite seamless. I have taken huge GUI apps targeting Linux and had them “just work” on windows. On that note, I’ve taken GUI apps targeting Linux and cross compiled them to android and it “just works.” Edit: wasm as well. I just started messing around with emscripten and it blows my mind that I can run a qt GUI app in my browser.
- mswisdom 5y agoThe problem is that all of these components are named by people on the marketing team. And beyond asinine naming, marketing also seems set on obfuscating the technological relationship between different components.
- theon144 5y agoRight, like Visual Studio and VS Code, which are completely separate products with vastly different use cases; named as if they were different versions of one thing, and in probably the most confusing way possible (Code? Isn't that what all IDEs are about?). Not to mention the whole "Windows Forms, WinUI3, Win32 and WPF" mess.
- dustinmoris 5y agoAzure and Azure DevOps falls into the same category. Straight from the Idiot department at Microsoft.
- willjp 5y agoAlmost certain I’m doing it wrong (hobbyist), but most versions of vs studio have some kind of cli interface for installing workloads. I’ll fight with that until I figure out which includes the cli compiler tools. Write a script to automate install. Afterwards I’ll use a build system that calls vcvarsall.bat and perform the build from the cli. I agree, it feels clunky and bloated compared to what I’m used to (especially if multiple vs studio versions required) but it gets the job done. I’m very curious what workflows look like for people that know what they’re doing when building c/cpp on windows.
- vixalien 5y agoI'm also curious for workflows. I saw none that works with Sublime Text. Moreover I couldn't even find a simple build script.
- ectopod 5y agoAfter you create an app in Visual Studio you can build it by running msbuild. You don't need an additional build script.
- willjp 5y agoThank you!
- vixalien 5y agoBut how do I run the built app?? msrun? msbuild run?? dotnet can "dotnet run" but msbuild??
- jmnicolas 5y agoThis is Windows dev: while command line is available, everything has been thought for the GUI. Use Visual Studio, it will provide a much better experience. There's a button for what you want to do on VS (green arrow, at the top, the hint text is "run" I think).
- 5y ago
- blablabla123 5y agoThis matches my experience. Ages ago I was successful with the Borland tools to produce anything non-trivial. Eventually I worked a few months on a project with C# which included an installer. Somehow this seems very standardized but I was surprised to see that you had to register every single file in an xml file. On the upside, this would result in a really clean uninstall. So maybe part of this is also to prevent brittle software like in the past.
- yesimahuman 5y agoIt is quite complicated but at least it feels like it’s finally heading in the right direction. I recently did a deep dive into WinUI3 and the Windows App SDK and finally they are separating these tools from the OS and making them available to packaged and unpackaged apps. I wouldn’t bother with any of the older approaches unless you have a reason to, as this is clearly the future. Speaking of which, the reason your exe doesn’t open is because you’re likely building a packaged app. You can think of that like building and iOS/Android app where it comes with a bunch of extra metadata and hooks into the OS, but that means you can’t just launch the exe and it has to be installed using the new .msix installer format. Thankfully the Windows App SDK just added the ability to build unpackaged (I.e. classic win32 exe apps): https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/deploy-unpackaged-apps https://docs.microsoft.com/en-us/windows/apps/windows-app-sd... I have built and tested both approaches and they work well, though unpackaged apps aren’t able to use certain APIs that expect “package identity” (I.e that special metadata I mentioned above)
- vixalien 5y agoI built a packaged app. The build outputs a .exe file in the build dir but when I click it, nothing happens. When I build using VS, VS automatically install the app for me and I can run it from the start menu.
- yesimahuman 5y agoYes you can’t run a packaged app just by double clicking the exe, as I mentioned above. But you can build unpackaged apps with the windows app sdk now.
- nickpp 5y agoWinUI3 unpackaged apps? In C++? I would be interested in learning more.
- yesimahuman 5y agoIn C++ or .NET (C#)/etc. I shared a link above
- lixtra 5y agoIf you just want „hello world“, try tcl/tk. It’s the same as 20 years ago and a very simple language. I build some simple GUIs for myself (ok, for Linux) and it was a perfect choice for that. Very stable language, relatively small, easy. Python tkinter still went through the python2 to python3 storm and the unicode plague. So i hesitate to recommend that. https://www.tcl.tk/software/tcltk/ https://www.tcl.tk/software/tcltk/
- RF_Savage 5y agoTk+tcl worked quite well for my very limited use and could be compiled into a single static exe. But I mainly used it for creating simple register value calculator tools for helping with embedded dev.
- superasn 5y agoDoes Borland Delphi 6/7 exe files run on Windows 11? I seldom use Windows nowadays but I did try running the Delphi Ide a while back and it created a 100kb exe file and it was running just fine on Windows 10 with almost everything working including the embedded internet explorer and firefox. Not sure if this helps your case but it can certainly be done if Delphi can still create exe files that run just fine.
- 6581 5y agoLazarus would be a better choice for current systems. https://www.lazarus-ide.org/ https://www.lazarus-ide.org/
- mrweasel 5y agoEmbercado still maintain Delphi, so it still an option, but I believe their IDE is pretty expensive.
- e12e 5y ago> Embercado still maintain Delphi, so it still an option They appear to have a hobby edition: https://www.embarcadero.com/products/delphi/product-editions https://www.embarcadero.com/products/delphi/product-editions > Delphi® - Community Edition > Our free Delphi Community Edition is designed for freelance developers, startups and nonprofits with revenues under $5000 USD and it allows them to easily design, code, debug, and deploy applications for iOS, Android, Windows and macOS from a single codebase with professional and integrated tools. That said, I would probably recommend Lazarus: https://www.lazarus-ide.org/ https://www.lazarus-ide.org/
- omgwtf1000 5y agoI run several of my D5 programs in windows 11 and they work great. Single .exe, just copy it and run it.
- mrlonglong 5y agoBugger all that codswallop. Just build a Windows form app using .NET C# or Visual Basic in Visual Studio. I have done it many times.
- Someone1234 5y agoThere's a lot to untangle here. Point 1 is largely true, Microsoft builds too many competing UI toolkits. Point 3: You can slim down Visual Studio's install a lot if you're more selective during installation. For example if I only wanted to do .Net desktop application development it is closer to 4 GB and under 10 GB on disk. Point 4: Is actually the end of the original synopsis on the topic and after it veers off. You successfully built the application. Now it goes a little off the rails: Point 5: "The app is extremely resource heavy and way too over-featured." Ok? You didn't say which toolkit, guide, or similar you used nor what you define as resource heavy or in what way it was "over-featured." This is too vague to discuss meaningfully (e.g. Win32 applications built in C++ definitely aren't resource heavy or over-featured for example, and since you didn't clarify even what tech stack was used let alone guide/template this isn't constructive at all). Point 6: I've read this sentence several times but seemingly you opened an executable in a text editor and that somehow broke your build process? Or something? Was it write-locked by the editor? Point 7-10: You had a working build pipeline, you broke the pipeline, then decided to start again from scratch in an editor that doesn't have native desktop development support on Windows (because the old editor was "bloated"). You found this process problematic. So in answer to: > Why is building Windows apps so complicated You made it complicated by using unsupported workflows and introducing arbitrary limitations on what was a successful outcome. There's a lot you can legitimately criticize Windows and even its desktop application development workflow for, but this isn't that.
- rodrigo_b 5y agoI don't understand why the text editor is coupled to the build process. Visual Studio has, in my opinion, a text editor that leaves a lot to be desired. Multiple cursor support is especially bad, even more so when compared to VS Code multi cursors. Sadly I'm stuck with VS since I'm working on a Xamarin app and I couldn't figure out how to build and run with MS build :(
- vixalien 5y agobtw I used this guide: https://docs.microsoft.com/en-us/windows/apps/winui/winui3/create-your-first-winui3-app?pivots=winui3-packaged-csharp https://docs.microsoft.com/en-us/windows/apps/winui/winui3/c.... 5. I wanted to build a Hello World App remember, to develop windows apps, they told me to download Visual Studio with the following features selected: workflows: Universal Windows Platform development, .NET Desktop Development, Desktop development with C++. Individual components: Windows 10 SDK (10.0.19041.0) and C++ (v142) Universal Windows Platform tools. I found all that unnecessary for Hello World but I was following a guide: https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/set-up-your-development-environment?tabs=vs-2022 https://docs.microsoft.com/en-us/windows/apps/windows-app-sd... 6-. Visual Studio was too heavy for my 7th gen Intel laptop so I switched to Sublime Text to work over there because I thought all build tools was installed. I tried to run "dotnet build" but it didn't work. "msbuild" worked but i don't know to run the built app.
- spaetzleesser 5y agoI am a long time Windows desktop developer. Since around Windows 8 MS has lost any sense of direction and just keeps cranking out new frameworks only to drop them soon after. All frameworks available are either outdated or incomplete. It’s very frustrating. When you look at Teams or Outlook it seems even MS themselves doesn’t know anymore how to develop solid and reliable desktop apps. My advise is to go either qt, electron or web. Preferrably web IMO because there is a clear path to the future.
- datavirtue 5y agoI just went back to Java Swing and stopped being frustrated.
- tobltobs 5y agoIt says a lot if Swing is the least frustrating framework.
- spaetzleesser 5y agoAt least it’s stable and doesn’t change all the time.
- BarryMilo 5y agoExactly, do what Microsoft does and avoid Microsoft frameworks.
- toyg 5y agoThat's because MS effectively abandoned Windows as a revenue generator, in order to become a cloud vendor. Windows exists just to give you a way to consume or develop web-apps that run in Azure. Office exists to get you to use Office365, again generating cloud-based revenue. Commercially, it works. Unfortunately, it's slowly killing the desktop computing experience. Unlike Apple, they don't even have a real interest in shifting hardware, so they can happily treat the desktop market like dirt. It's weird, seeing MS effectively strangling their own baby, but I guess Wall Street is happy.
- codeflo 5y agoEven though I personally much prefer Unix environments, I've done a lot of work in Microsoft's tech stacks and WPF in particular. WPF is nice, but it's not developed much anymore and lacks basic features that people have come to accept (great touch support, smooth scrolling). And the successor technologies are all a mess, driven by Microsoft's internal politics more than by any coherent strategy. I tuned into a few streams of Microsoft's developer conference last year, and no fewer than three different UI libraries, developed by three competing divisions, where announced as "the future of app development on Windows". I can guarantee that only 0-1 of those will survive, so good luck betting on the right one. The only real recommendation I can give is to do as Microsoft does, not as they say. So while they tell everyone to use UWP, WinUI, MAUI or whatever, all of their own new apps are written in Electron. Decide what that means for yourself.
- sys_64738 5y agoIs Win32 MFC still a thing? I remember wrestling with that 20+ years ago. It felt bloated back then but would probably be considered the equivalent of embedded programming nowadays. It was all C++ but not traditional C++ that you know. If felt like J++.
- criddell 5y agoI still use it and frankly it’s pretty good. If you stick to using everything as it was intended, it’s fast and easy. When you have to go off the trails a bit, you are still in good shape because all the source for MFC is included so you can see how they did things. It’s a nice way to figure out how win32 works.
- zeroc8 5y agoIt really depends on your needs. For an old style desktop application (think file browser, text editor), it's ok. But for anything modern (touch screen support, animations) it just doesn't cut it anymore. You are better off with something like Flutter.
- criddell 5y agoI disagree. You can access pretty much every API Microsoft has available when you are using C or C++. Touch screen support (large targets) isn’t an issue. Animations aren’t difficult either. XAML islands is an easy way of bringing in UWP and RT stuff into a traditional desktop application. I’m not a fan of Flutter. Desktop Flutter applications use a lot more memory and CPU and don’t feel native on Windows.
- mihaitodor 5y agoThere's so much proprietary code out there that's strongly coupled to MFG and BCG (https://bcgsoft.com/ https://bcgsoft.com/) that I doubt we'll live to see it disappear, just like Cobol...
- kitsunesoba 5y agoI’ve been building a C# WinUI 3 app as a hobby project, since the app in question only makes sense as a Windows app (making cross platform capabilities pointless) and because I don’t care a shred for the convolutions of front end web dev that come along with an Electron project of any significant complexity. Getting started was annoying — certainly more so than developing a native Mac app with Xcode, which presents something closer to a “happy path” that gets you writing code with little to no boilerplate — but I finally got the ball rolling and have been fairly productive. There are some oddities though, like the collection type relied upon by list views not supporting sorting, requiring one to either wastefully allocate a new list, sort that, and assign that to the collection or implement sorting in a class extension. Very very strange stuff when you’re used to the base collection types in the language you’re working with supporting both observation and sorting. I’ve read that picking up the latest Windows UI framework is foolhardy, but I really didn’t care to theme WPF so it’s a closer match to current windows design and isn’t glaringly bright when using dark mode. And as noted, this is a hobby project, so whatever. If a rewrite becomes necessary it’s not the end of the world.
- datavirtue 5y ago"I don’t care a shred for the convolutions of front end web dev that come along with an Electron project of any significant complexity" Already caught some of that action. Dumpster fire.
- mdp2021 5y agoAs many have noted, there exist development systems that seem to want to involve wartime industrial efforts to craft even toothpicks (presumably also because they were born to develop the Unimaginable in a distributed international team of uncountables), and there are "measured" tools that do their job directly and effectively. Many have suggested a number of effective lean tools. I suggest you also try PureBasic. You can build GUI applications in seconds (reasonably, depending on the functions to implement), even when just programmatically if you so wish. The executable will be compiled, small and fast. The language remains relatively very powerful (it does quite a lot on its own, and can hook to third party libraries when needed. As a personal compact and effective swiss army knife, it's unvaluable. You seem to be oriented towards "manageable" development systems. There could be systems that are more instrumental to your curriculum vitae, but. Some of today's development systems are very high level, and I still believe that having a good grasp of the low-level, of the actual internal workings, is duly - the intermediate output of PureBasic is Assembly, and this should give the idea of the "faithfulness to low-level".
- qalmakka 5y agoI think the main culprit for the whole situation - that is, the fact that building anything on Windows is a byzantine and convoluted process - is the fact the whole OS was designed with CLI as an afterthought. On UNIX the CLI is always forefront and center - you don't really have "GUI" apps, all apps are console apps and they may connect to some sort of Window server and draw windows. Meanwhile on Windows there was close to zero effort on making the system usable from a CLI before half a decade ago. There are still lots of tasks that require you to log in on a GUI, for instance. Applications started in GUI mode have no console attached, so you have zero diagnostic messages when started in a CMD. The entire command line tool situation is a complete mess, and it's clearly meant that msbuild and friends are actually meant to be invoked by Visual Studio instead of being used from a CLI. Until a few released ago there still was no non-hacky way to get a development PowerShell, because all the various `vcvars` scripts were only batch files. The complexity of using XML files in project descriptions just complicates things, and ironically I've seen several occasions in which msbuild just tells you to change a settings using Visual Studio (instead of telling which CLI toggle you are supposed to use). My two cents is that IDEs and GUI told may be convenient but they should never be the default way to do anything, especially with development tools.
- ratww 5y agoI completely disagree with this take. The process of making GUI programs used to be very straightforward. If anything, in the last 10 years, Microsoft has improved the CLI experience by leaps and bounds, while at the same time it made making GUI software significantly worse. Making CLI programs on Windows was never a big problem. There was always a way depending on which language you chose, and even if you wanted to POSIX you could with Cygwin. Sure, it wasn't Linux but that was the nature of the system. Now you don't even need hacks. Making GUI software, however, is currently very... weird. Making GUI software, especially on Windows, was historically very simple and never required any CLI, let alone a good one. I also disagree that making GUI apps in Windows is a "byzantine and convoluted process". It is not, and it never was. You can create a simple GUI app with a single .cpp file and compiler command. If you want to use Winforms you could draw the windows. VB6 before as well. WPF on Visual Studio was also very simple. The only part that I agree is still unfinished is the .NET CLI-only experience, which the OP complained about. But that part also kinda sucks on Linux and Mac. If you use Visual Studio it works well. The whole issue with native GUI apps in Windows currently is that nobody, not even Microsoft, knows the way forward for apps. Apple knows: it's Swift and Cocoa for Mac. The Linux world seems to be moving towards Wayland (I know I'll get some smart-ass responses on that). iOS and Android also have a happy path. On Windows? There are 6 or 7 different APIs and 20 different ways to start an App, and none of them super maintained, well documented or even officially favoured by MS. Sure, Win32 might not be going away, but some things are better in WPF. Wait oh no WPF was replaced by WinUI. But what's that WinForms thing? And this MFC thing that got recent updates?
- pjmlp 5y agoYou are basically holding it wrong. Visual Studio + Forms/WPF, done. If you are more in the C++ camp, go with either Forms/WPF + C++/CLI, or MFC (yes really MFC). Everything else on MS stack are just distractions, and VSCode is not for Windows development.
- jmnicolas 5y agoAssuming you're on Windows, as a beginner you should do everything with Visual Studio (not Code), it's the easiest way. Create a new WinUI project (choose an UWP one), once you're on the hello world page, just look at the green arrow at the top of Visual Studio, press it and voilà it will run your app. But to develop a visual app for Windows you will need to learn a few things before you can be at ease. There's one WinUI book for sure, and there should be courses too. Keep it on!
- tyingq 5y ago>Why is building Windows apps so complicated I suspect mostly because of their strong respect for backwards compatibility and interop between new stuff and old stuff. Means there's always 10 ways to do the same thing.
- michihuber 5y agoAlso, distribution: Windows Defender requires code signing with an extended validation certificate, or going through the Windows Store. Otherwise users see a scary warning after installation how your app is probably a virus. But using an EV cert means you cannot build on a CD service (it comes on a dongl). And users hate the Windows Store. What am I missing as a mac person? I hear that most apps aren’t on the Windows Store. Is it normal to just have a virus warning and people ignore it anyway? Or can you just not distribute through a CD service?
- ugjka 5y agoIf your executable isn't signed not only users will get a warning but browsers such as Chrome won't let you download it. Oddly enough malware distributors have no problem bypassing all this
- my123 5y ago> Or can you just not distribute through a CD service? You build on the CI, but then do the signing yourself on the machine which has the HSM... and then upload that as the release build...
- crispyambulance 5y agoUI is complicated and always has been. You have to be patient with it and give yourself time to absorb it. Based on how you described things, you're just starting out with Windows UI and Visual Studio. That's OK, there's nothing wrong with that. Welcome. The landscape is confusing for multiple reasons. Partly because now multiple platforms are now targetable. Partly because Microsoft bends over backward to support legacy codebases (yes, there are people still maintaining winforms apps). Partly because UI is just hard. What you'll want to do is to find a stable but relatively modern UI library. You'll want something XAML-based, so that means WPF or WinUI. WPF is "done", terminally stable and there's a lot of resources (tools, tutorials, books) available for it and it works on Win 11. If you learn it, transitioning to the more modern WinUI is not a big deal. Recommend you limit yourself to WPF or WinUI and Visual Studio. It should not take "a minute" to build an example application on a normal machine. The initial confusion with xaml-based UI wears-off quickly. You will be able to make simple one-off UI's with ease. The hard part is building non-trivial applications with it because you will quickly find that you need to use libraries for MVVM and Dependency-Injection. I use the Prism library, it's a hot mess, but it's my preferred way of making UI apps. The next major hurdle, for me at least, was customizing the UI controls. You can compose your own from the "built-in" controls and style them so they look pretty good (that's called a "User Control"). Anything more elaborate means buying UI controls from a vendor like Infragistics. You theoretically can create your own controls and package them in libraries, that's called "Custom Controls" and it's nightmarish in complexity if your end-goal is just creating applications.
- deleted 5y ago[deleted]
- account-5 5y agoWhen I'm writing simple things for Windows I just use Autohotkey. No hassles, portable, compiles to exe. Not for everyone but for me it makes windows usable.
- theodpHN 5y agoA big part of the problem, I think, is that tools that make it easy have been deemed uncool and as a result are half-heartedly supported by Microsoft, such as Visual Basic and MS-Access. Lack of vendor support has killed or hampered other easy-to-use development software that might otherwise find widespread use, including BASIC (classic and VBA; Microsoft, Apple), HyperCard (Apple), and AppInventor (Google). My two cents. :-) Microsoft Plots the End of Visual Basic https://www.thurrott.com/dev/232268/microsoft-plots-the-end-of-visual-basic https://www.thurrott.com/dev/232268/microsoft-plots-the-end-... Microsoft Access: The Database Software That Won’t Die https://medium.com/young-coder/microsoft-access-the-zombie-database-software-that-wont-die-5b09e389c166 https://medium.com/young-coder/microsoft-access-the-zombie-d...
- logbiscuitswave 5y agoJoel Spolsky did a pretty good job describing these problems back in 2004: https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost-the-api-war/ https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost...
- steeleduncan 5y ago1. If you wish to work with C++, then WinUI 3 is the latest and greatest, and the way to go. 2. WinUI 3 is the controls in UWP repackaged under a new name, but without the restrictions of UWP. The only substantial difference is a change of the root namespace from Windows to Microsoft 3 & 5. This is a sad reality of modern IDEs, it is a one off cost though, once downloaded and built for the first time it is smoother. Also, you can opt in on a component by component basis, so if you don't want them, don't download them. 6-10. If it works with Visual Studio, stick with that, don't waste your time and effort unnecessarily trying to run a complex build process in an esoteric way. If you want to use Sublime Text, then edit in that, and alt-tab back to Visual Studio to run it. I don't think you have made life easy for yourself, but there is an overwhelming choice of frameworks when starting. Rather than evolve a single framework, they seem to create a new one every 3/4 years and deprecate the predecessor. That limits the work you need to do keeping up with backwards incompatible changes in the longterm, but it makes for an miserable start to Windows app development.
- pjc50 5y ago> WinUI 3 is the latest and greatest, and the way to go. It's also brand new, hit 1.0 a couple of weeks ago, and therefore probably buggy (I hit a bug in -preview3). And it's about 100MB per app + 100MB of dependencies. > but there is an overwhelming choice of frameworks when starting. Rather than evolve a single framework, they seem to create a new one every 3/4 years and deprecate the predecessor They _don't_ deprecate the predecessor! That's the Apple approach, forcing everyone along. The predecessors are all kinda still supported with no "this will stop working" date, and you can still see WinForms controls in Win10 system tools.
- steeleduncan 5y ago> They _don't_ deprecate the predecessor! Sorry, I mistyped, yes, they move to maintenance mode and you can keep using it. > And it's about 100MB per app + 100MB of dependencies. As I understand it, this is because it links the entire GUI toolkit in there, so you get a consistent experience regardless of what version of Windows it runs on. 200MB is quite a lot, but its not extreme, and if it reduces the longterm maintenance cost, it could well be worth it.
- pembrook 5y agoHence why all apps will be electron in <5 years. While more resource heavy, with the transition to better ARM-based processors already underway this will become a mute point.
- thefz 5y ago1. I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think. I don't really know the difference between the 3 and no one really explains that (unless Win32 which is obvious). WinForms is "legacy", WPF is the way to go. 3. I installed Visual Studio overnight (it comes with all the tools that building apps need). It downloaded 6GB of data and used 20GB of storage. All i want to build is a hello world app. Bad choice not cherrypicking what you need and installing a whole lot of packages you don't. 5. The app is extremely resource heavy and way too over-featured. I build the boilerplate app and Run it and it takes minutes to build (most of the time is downloading dependencies so not such a big deal). Nah, a basic "hello world" WinForms program is minuscule. A WPF one might have a bit more dependencies, say a MVVM framework, but for a one-window program that's it. 6. I open the newly created app in Sublime Text (my editor) and I can't find a way to build the app anymore. Not clear what you were trying to do here. 7. Because Visual Studio is so bloated, I download Visual Studio Code, which is far more simple but I can still not figure out how to build my app even with the various extensions VS code boasts. It's bloated because of your choices. VS Code still compiles and runs .exe with attached .pdbs. 8. After hours of googling, I formulate a script that can build the app from the command-line. You don't need to google for hours and formulate any script. I can run a basic program from VS Coe just fine. 9. But I stil don't know how to build the app as the .exe file created does not execute. It's 100% on you. 10. I'm very disappointed. It's 100% on you.
- vixalien 5y agoThe reason I installed all those packages is because that's what the guide sid. Visual Studio literally cripples my laptop and so I switched to subl to write my code there. Btw how do I run the build results after "msbuild" builds.
- simonw 5y ago"It's 100% on you." No it's not. Microsoft's job here is to create tools, documentation and guides such that someone who wants to invest their time in learning their platform can get to "Hello world" quickly and in the right way. Clearly they haven't done that here. OP was motivated to build something, and put their best effort into figuring out how to do so. This is a usability thing: if someone makes a bunch of mistakes when using my software, it means I have failed to make my software usable enough for their purposes.
- derjames 5y agoThis is bit extreme and if you are ok with the c language: 1. download tcc for windows(tiny c compiler from Fabrice Bellard). 2. compile the examples in the examples folder. Here you will find the 'hello world' program for both command line and win32 gui. The download size of tcc is a few megabytes and the compilation times are for practical purposes instantaneous. You will have to bring your own IDE or text editor.
- vixalien 5y agoyeah but I wanna build WinUI3 apps not Win32. And that requires Windows App SDK and C++ tools which in turn require Dot net and the Windows 10/11 SDK which in turn require Visual Studio which makes it 20GB storage and 10GB ram.
- indymike 5y agoUnpopular opinion: native GUI app development on most platforms is a shitshow. Huge toolkits, copious amounts of boilerplate, and a huge amount of dev effort thrown at the platform just to get it working. Meanwhile, say what you will about the web ecosystem, I've given interns/jr devs tickets like: see if you can get this webapp running in electron, and maybe figure out how to do push notifications and save data locally. Two days later the project is done. A week later, the app is ready to install. I think the real reason I quit doing meaningful amount of native GUI development a decade ago was velocity. The developer experience with iOS is probably about the best of the major GUI platforms, but even that is rife with tarpits of tribal knowledge and gets really complicated to release an app due to the whole App Store experience.
- StevePerkins 5y agoI don't think I have ever witnessed a comment on Reddit, prefixed with "Unpopular opinion:", that did not actually contain a VERY popular opinion, and therefore rocket to the top of the thread thanks to reverse psychology upvotes. It's depressing to watch this trope start to bleed over into HN.
- chrisco255 5y agoWell, it's at least a controversial opinion even if it also maintains popularity. People seem to rag on Electron apps all the time on HN due to their inefficient usage of computing resources. However, they are an optimal use of developer resources, which are far more constrained for the average project.
- w-j-w 5y agoYou regularly see opposition to this opinion on HN though. Complaining about electron being inefficient is super common around here.
- zamadatix 5y agoProblems with the prefix aside (I'm not a fan either) Reddit does it's best to show you popular comments. If you go looking in the -10 through 10 range on relevant threads you'll have a decent chance of spotting them. Not "controversial", not "top" (or bottom of "top"), not "hot", just the 95% of comments that aren't driving engagement numbers. After all it's neither going to be popular because it's a popular sentiment nor is it particularly likely to be something interesting/relevant to get upvotes on merit. It's just going to be an unpopular opinion that gets ignored.
- clavicat 5y agoI’ve noticed that no one has attempted to answer OP’s question: “why is it so hard?” If you were creating an OS and you wanted to ensure its success, one obvious thing to do would be to make it as frictionless as possible to develop native software. Ideally, it would be as easy as importing the system library and typing one or two lines to create a new windowed instance. It could be made so easy that amateurs with no understanding of programming could write their own little programs like many do with Excel. Instead, Microsoft seems to go out of its way to make GUI development as nightmarishly complicated and intimidating as possible. It has expressed zero interest in streamlining the existing clusterfuck and instead piles on more layers and paradigms and libraries that are then poorly maintained and abandoned for other fads. Microsoft itself does not seem to have a canonical way of developing programs. Visual Studio is a monstrous behemoth that becomes more obese with every release—the last time I tried to install it, it temporarily bricked my laptop because of some memory corruption bug. Everything Microsoft touches suffers the same pathologies—nothing they do is ever excellent. Their products just manage to chug along in spite of all their defects. No sane person would ever think to design things this way, but this is how they turn out. Even the tiniest and most obvious improvements, like the recent updates to Notepad, literally takes decades to implement. The bar is set lower and lower in terms of performance because improvements in hardware almost make up for the shittiness in software. Microsoft suffers from a complete absence of vision and responsibility. Ultimately, no one there owns any project—there is no one to blame when it turns out shitty, and there is no visionary leadership to coordinate their efforts and pick a direction. It is just aimless bureaucratic chaos.
- fuzzfactor 5y ago> Why is building Windows apps so complicated? This is by design. At the beginning PC's were not much different than Ataris or Commodore 64's, they still had built-in BASIC in the motherboard ROM so the OOBE was a ready-to-program personal computer for everyone. Not that everyone actually wants to program their own computer, but there wasn't much software anyway and if you wanted to do something imaginative you were going to have to program it yourself. And there was nothing standing in your way. Once MSDOS prevailed and Microsoft got more powerful, BASIC was removed which "differentiated" these serious business machines from the lesser "gaming" computers. PC's were so sophisticated they had so much more to offer than BASIC, and the few users who might want to code a bit would just have to jump through some of the same hoops as software companies, to select and prepare a special PC to be a Microsoft development environment. Absolute total push in the opposite direction from free BASIC everywhere by default. So from that point it was entirely intended to be the opposite of badda-bing-badda-boom.
- dimgl 5y agoYou're not wrong. This is one of the reasons I've stayed far away from building Windows apps. Right now I'm really into Golang, and I'm wondering if it's possible to build a Windows UI app using Go. I've always wanted to try QT, so maybe QT is an option?
- cjfd 5y agoIt has always been this way on this platform. Also not helping is that the documentation is of, let us say, varying levels of quality. I don't build GUIs that often, but have build them in the past, and, honestly, I am not entirely sure what I would use if I were to build one....
- daviddever23box 5y agoI see your .NET drama and up the ante by mentioning UWP / WinRT app development. You’re welcome! My younger self would have asserted that Windows is a poison which gets re-absorbed into one’s skin by contact; my older self wonders how long the circus tent will stand aloft. There’s no P in PTSD until you’re outside the ecosystem.
- markus_zhang 5y agoI had some exp building personal projects using QT. It's definitely a complicated GUI framework but it's not difficult to meddle amd create simple gui apps.
- hermitcrab 5y agoQt is a big framework. But you can ignore 90%+ of it to start with. Just create a "hello word" app in QtCreator and then start adding some QWidget derived classes (QCheckBox, QComboBox etc). Make sure to read up on Signals and Slots.
- markus_zhang 5y agoYeah, for small programs it's actually quite easy to put up something. It took me about a few days to learn some concepts but after that it's just plain coding to implement the features. Sadly I don't use QT for bread and butter so next time I will have to relearn the concepts...
- malka 5y agoAaaand that's why people use electron.
- deleted 5y ago[deleted]
- b20000 5y agoall of what you describe happens when you try to build a modern web app using any of the hip languages or frameworks too. what kind of app do you want to build? that is the first question to ask. then, you choose the right framework for it and the right project type in VS. with windows software, just like with mac osx, you need to read the docs first and think about what frameworks to use and what application type. preparation will help a lot down the line.
- intrasight 5y agohttps://github.com/migueldeicaza/gui.cs https://github.com/migueldeicaza/gui.cs "A toolkit for building console GUI apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix." I'm going to try using this for a new console app
- ipiz0618 5y agoI feel you on the documentation point. WPF is great, but the documentations are scary. Microsoft's documentations are rich, but don't help in most cases. I'd been a professional WPF developer for a few years, but still couldn't get a lot of things. Nowadays if I want to build a simple Windows compatible app for side projects, I use cross platform frameworks like Flutter.
- la_fayette 5y agoWindows 11 has great support for PWAs. This could be an option for certain types of apps, with the advantage, that it runs also on other platforms. MS Teams and VS Code are also web apps, so I guess the technology is ready?!
- pigbearpig 5y agoWhat is the point, just to complain? Is this harder than Linux/Unix/Mac OS? I don’t know what toolkit to use Qt, GTK2 GTK3? Ugh, I’m going to give up and complain on HN.
- timeon 5y agoJust use Cocoa.
- simonh 5y agoIt's not any better on the Mac. I started trying out Playgrounds on an iPad and wondered why none of the suggestions and blogs on the web worked, only to find out there's a MAcOS version of Playgrounds and thy don't work quite the same. Then I find out there's a Playgrounds feature in Xcode and actually a lot of the guides and Stack Overflow answers are actually for that, although most such resources don't say which one they're for. I finally settle on using the XCode one as most resources seems to be fort that, but after a whole afternoon failing to get a Playground to load a single package from Github I just flat out gave up. Pretty much nothing I could find about any of this ever actually worked. My heart goes out to anyone trying out coding with playgrounds for the first time on an iPad and trying to find out anything useful, not realising almost all of the info they find is for the wrong Playgrounds. Compared to the built-in guides and helpful info for Pythonista and Codea it's an embarrassment.
- kitsunesoba 5y agoTo be fair, Playgrounds for iPad is brand new while Xcode has had playgrounds since Swift was released. Additionally, the Xcode feature has seen quite a lot of change in the last release or two of Xcode in effort to make it more capable. The biggest issue here is really just lack of up to date tutorials from Apple.
- bluedino 5y agoIf you can figure out how to wire up objects in the current version of Xcode and know whichever method of garbage collection they last settled on, you can still write a Mac app like it's 2003
- stjohnswarts 5y agoI'll tell you one thing, building software that isn't trivial isn't easy. You are expecting it to be a turnkey solution on your first try. Honestly there are some turnkey solutions out there but you have to do your research and quit being so negative. You might as well accept that 95% of most modern software is "heavy" unless you are writing a C based command line app. About the lightest software (but hard to write) on Windows will be Win32 if you're looking to write Windows apps that are light on memory. Personally I think C# is probably the best all around place to get started on Windows for GUI coding. Python is probably the easiest for command line stuff.
- scruple 5y agoI don't have much to add. I went through a similar process about a year ago. It was painful and annoying and despite the fact that it was not what I wanted to do I ended up with an Electron app. I'd also add that they're (Microsoft) also pushing .NET MAUI and Blazor for GUIs. They're very confused over there, IMO.
- dundarious 5y agoHandmade Hero is pretty much the perfect project for this. The first few videos go over basic C/C++, but I think in one video you build a Hello World GUI app without using Visual Studio to set up anything, you just call the compiler in a script (initially, Casey used VS as a debugger, which you can do by just asking it to "open" the .exe, but nowadays he uses RemedyBG which is pretty much as useful, and is lightning fast -- costs like 20 bucks). Look at https://handmadehero.org/ https://handmadehero.org/ and Previous Episodes, Day 001 and 002. He's creating a game, not a GUI with textboxes and buttons, but much of it is applicable, and there is very purposely no impenetrable "magic" operating behind the scenes. As for "why is it so complicated?", well... none of the popular 3 OSes or ecosystems are really covering themselves in honor there. I think MS is unique in just how fond of "magic" they are, and there is a lot of boom and bust in their tech stacks, which seems to be mostly driven by their internal structure rather than any kind of rationale. Linux is fond of competition between mutually incomplete alternatives, and constant change even within alternatives. macOS is arguably the most sensible and stable, but it has been about 10 years since I wrote an OS X or iPhone app (weren't called macOS or even iOS back then).
- jhallenworld 5y agoI found this to be useful, make a Win32 GUI in the old-school 90s way using MingW so you don't even have to use any Microsoft tools. It has the advantage that nothing has to be installed on the target PC except your application. https://www.transmissionzero.co.uk/computing/win32-apps-with-mingw/ https://www.transmissionzero.co.uk/computing/win32-apps-with... I used it to make an application that downloads files over a serial port from an OptiCon bar-code scanner: https://github.com/jhallen/cartscan https://github.com/jhallen/cartscan Coming from UNIX, the biggest annoyance was Microsoft's use of wide character strings.
- nobodyandproud 5y agoThere’s no guide because nobody wants to learn Windows Desktop programming anymore. The Web has taken over everything, even use cases where it shouldn’t, because it’s a career dead-end. The IDE is complicated because it’s an evolution of 30 years. As for the UI: - Win32: This is the C library for creating and manipulating Windows. This library is foundational. - WinForms: .NET abstraction around Win32. Event-driven design. Every UI component is effectively a Window. Very rich and complete; hard to write unit tests for; easy to peel away the abstraction. Never going away. - WPF: Reimagined UI library. Addresses the many limitations of WinForms. Inspired by HTML; steeper learning curve; designed to separate display from display logic, making unit testing a very possible. Every year, someone asks if WPF is dead.
- tzs 5y agoThe way I used to deal with Windows programming was to buy the Charles Petzold “Programming <X>“ book where <X> was the version of Windows I wanted to program for. Petzold stopped writing these and so I stopped writing Windows programs.
- flohofwoe 5y agoYes, it sucks, but it's not much different from any other platform. This is essentially why Electron has won, despite its obvious downsides.
- snambi 5y agoWhy would anyone want to build an windows app when there are so many better alternatives?
- secondcoming 5y agoFirefox is rejecting all the docs.microsoft.com links in this thread: > An error occurred during a connection to docs.microsoft.com. The OCSP response does not include a status for the certificate being verified. > Error code: MOZILLA_PKIX_ERROR_OCSP_RESPONSE_FOR_CERT_MISSING
- plq 5y agoA common mistake I see is to let the tools/frameworks make the decisions. The engineer should make the decisions. If the tools don't let the engineer do what he wants, he must change the tools. Not sure how much experience you have with native development but, as a person who has production code running on windows, macos and linux, frankly I don't see much difference. Getting together almost all of the moving parts that make a modern OS tick behind simple API calls is no simple feat. Native development is complex because ... well it's a complex problem. Microsoft platforms have always been clunky so if you add that as well, it might seem unsurmountable if you don't know what you're looking for. Linux is the most developer-friendly OS out there. What's nice, its GUI toolkits have the advantage of being cross-platform so if you learn how to use them, you can easily port your code to other platforms. For windows development I'd go with Qt or Gtk instead of full-on native nowadays. Qt takes you %95 of the way (Gtk a bit less) and for what's left you can drop to native code which wouldn't be too difficult. However, for the sake of argument, let's try using the native apis. Here's the checklist: Get a compiler, get an editor, write some code, generate build files, build, run, iterate. 1. Get a compiler. For windows, MSVC is the obvious choice. My MSVC provisioning script is 40 lines of powershell plus some json file I exported after doing the first manual install. 2. Get an editor. Notepad++ will let your feet get wet but for advanced stuff like completion and refactoring, get a real IDE like Qt Creator, Visual Studio or CLion. But for now, notepad++ it is. 3. Ok, time to write some code. I DuckDuck "windows gui hello world" and clicking around the first result lands me here: https://docs.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-program https://docs.microsoft.com/en-us/windows/win32/learnwin32/yo... so we have our hello world sample. Get the code from there and save it as main.cpp 4. Now let's compile the code. Running cl.exe by hand is doable but won't take you very far. We need a build configuration system. It looks like CMake and ninja is now bundled with Visual Studio so let's use them. I DuckDuck "cmake windows hello world" but don't get much and you turn to Google and you get these three lines: cmake_minimum_required(VERSION 2.4) project(hello_world) add_executable(app WIN32 main.cpp) Good! now, launch a developer shell and do this: cd \path\to\my\code mkdir build cd build cmake .. And when I type make ... wait what is this? What is a .sln file?? Visual Studio Solution?? Sorry cmake, that's not what I want, give me a proper Makefile. Or build.ninja. Let's try again: cd .. rm -r build mkdir build cd build cmake .. -G Ninja ninja .\app.exe Ah! That's more like it. And you take it from there. Never let your tools dictate your actions. You're the engineer. The tools should do your bidding. As for the framework, just use Qt. If not, I think the latest fad is WinUI but Win32/MFC is here forever. I actually put all this here along with my MSVC Provisioning script: https://github.com/plq/hello-win32 https://github.com/plq/hello-win32 Hope it helps!
- fmxexpress 5y agoIt isn't difficult. Just use Delphi. 26+ years of unbroken excellence building using Win32. And now Microsoft is saying that going forward they are back to promoting Win32 as the best way.
- rkagerer 5y agoNever thought I'd say this but the Windows developer experience from Microsoft peaked with VB6. Later tools got more powerful but never quite reached the same sweet spot of productivity and intuitiveness. Working on a small C# WinForms app right now, and saddened that Edit-and-Continue still doesn't really work, build times are 10x what they should be, and even hit bugs in the native control wrappers. Microsoft used to have very smart people who understood their tech stack from the ground up. I'm sure they still do, but their business decisions make it seem like instead of stripping the paint and re-priming they simply keep painting over the old mess with yet-another-layer. (Not saying they need to break backward compatibility, but do wish they'd update old paradigms rather than abandoning them to rot).
- Jap2-0 5y agoI've never programmed as a job; it's a hobby at most. But I could make simple VB6 programs when I was in upper elementary school. In high school I mostly used HTML/JS (partly because of portability, partly because I lost easy access to VB6). I've looked at other things a bit (admittedly not a ton), but I've never found anything I could easily make a native UI with since VB6. About the closest I've been able to get is hardcoding whatever I want into a python file and tweaking as needed for personal use.
- lostmsu 5y agoThe author is nuts, and so are many commenters here echoing their viewpoint. The steps are 1. Download and install Visual Studio (author says C# - that's one checkbox to set in the installer) 2. Launch it and click make new -> desktop application 3. Hit F5 The rest is a self inflicted wound. 20GB for arguably the best IDE of the last decade may be a problem for a high schooler in a very poor country, but everyone else here, all supporters of this post included, should have no issue with it (unless also self-inflicted). 1 min build is basically a lie for launching a hello world app with F5. I doubt it will take more than 5 seconds on any machine.
- Const-me 5y agoWPF hello world app gonna build in couple seconds on any machine. WinUI3 is a mess. I have a fast desktop PC, first time it took longer than 1 minute. BTW, the installation package size for “Hello world” app made from the default template is 92.6 MB without dependencies, and 139MB with a few dependent libraries.
- wvenable 5y agoSo I would guess the problem is WinUI3? I develop Windows GUI apps for fun in my spare time -- I've built some pretty big and complicated ones using WPF/C# and the issues described by the OP don't seem real. My machine is old as hell and my build times are mostly unnoticeable, for example.
- Const-me 5y ago> So I would guess the problem is WinUI3? I think the worst offender is the new packaging system used by WinUI3. The default project template creates a solution with 2 projects, the windows app itself, and the package. They including .NET runtime into packages, but for some reason VC++ runtime, and WinUI3 libraries, are shipped separately as OS-wide redistributables. Despite .NET compile sources into CPU-agnostic MSIL bytecode, the final result, the *.msixbundle file, contains an independent package for each CPU architecture. Unless touching checkboxes in VS during publish, gonna be two of them, Win32 and Win64. > I've built some pretty big and complicated ones using WPF/C# I do that too for living, WPF is awesome in comparison.
- lelanthran 5y agoMaybe you should switch to Lazarus. I've had quite a good experience building fast and small GUI applications in Lazarus. Best of all, your program will be multiplatform (just recompile on supported platforms).
- sandreas 5y agoHere is a very good tutorial series for WPF: https://www.youtube.com/watch?v=fZxZswmC_BY&list=PLA8ZIAm2I03hS41Fy4vFpRw8AdYNBXmNm https://www.youtube.com/watch?v=fZxZswmC_BY&list=PLA8ZIAm2I0... Source is: https://github.com/SingletonSean/reservoom https://github.com/SingletonSean/reservoom It walks you through the whole process of creating an MVVM app including publishing. I saw and read many tutorials but this one was just AWESOME.
- spapas82 5y agoI've had a lot of success using Lazarus https://www.lazarus-ide.org/ https://www.lazarus-ide.org/ for some internal apps. Try it. It's like VB6 but in Pascal!
- rsp1984 5y agoDo yourself a favour and install Qt (it's free if you choose the LGPL version) and start building apps with QML / Qt Quick, which is Qt's language for UIs. As a Bonus: your app can also work on Android and iOS. If you're more of the web developer type, just use Electron (your Hello world app will probably need several 100s of MBs of memory just to show a window but hey, that's what you get).
- cool-RR 5y ago"Why is building Windows apps so complicated?" Compared to what? Web development?
- axby 5y agoPython lets you throw together a GUI pretty easily. I used it to build some simple wxWidgets applications when I was learning how to program. Then trying to build a wxWidgets application in C++ isn't that much of a leap from that. Building it on linux is super easy. OP is right in that it is not obvious how to even start building on windows, at least if you want to know every command being run and do it all from the command line, instead of using the microsoft IDE. After downloading a ton of tools and looking through the IDE, it starts to feel like something is wrong if you just want to build "hello world" and were able to do it easily on linux.
- Tempest1981 5y ago> choose between Windows Forms, WinUI3, Win32 and WPF The focus now is on Electron web apps... it's harder and harder to find/write native apps. I guess you just confirmed this.
- FpUser 5y agoWith Delphi (it has free hobby edition) and / or Lazarus one can build simple hello world literally in seconds. Same with QT (I do not use it as I am not fond of their licensing shenanigans). The rest of the discussion looks like people are trying to find the best way to hurt themselves. One can easily build windows GUI "hello world" using notepad and mingw but anything more serious would throw one in a world of hurt. Win32 was designed to be wrapped into something more manageable, not used directly for large GUI apps.
- miki123211 5y agoWhatever you say about Microsoft and the amount of overlapping technologies they have, their documentation is best in class. There's a barely supported, legacy API from Windows 2000 that is still used by some legacy screen readers to actually access whatever is on the screen. It's meticulously documented and the documentation seems maintained and up to date. Apple is the exact opposite, the API that screen readers use to communicate with web browsers isn't even mentioned anywhere. If you ever need to learn about it, the usual answer is "go Read the Safari source code and figure things out from there." It's gotten so bad that the documentation for Dotnet bindings of some Swift methods has apparently gotten better than the documentation of those methods themselves.
- mwcampbell 5y ago> There's a barely supported, legacy API from Windows 2000 that is still used by some legacy screen readers to actually access whatever is on the screen. Which API is that? I've been working on screen readers since Windows XP and am not sure I know which API you're talking about.
- miki123211 5y agoThis one https://docs.microsoft.com/en-us/windows-hardware/drivers/display/mirror-drivers https://docs.microsoft.com/en-us/windows-hardware/drivers/di...
- midjji 5y agoJust use QT instead,
- axby 5y agoI found that using CMake with C++ was a pretty okay process on windows, despite not having much experience with windows. I have to run cmake and then msbuild and I don't really know the details, but I got a simple GUI application running with wxWidgets on windows, and I don't need to use the Microsoft IDE. I'm happy to share more details if anyone is interested. It was a nightmare to figure out how to do it, though.
- lucastech 5y agoI agree that MS has done a terrible job at making their tools simple. I started programming using VB6 in 2002 and it was the easiest thing around. This simplicity still exists if you're trying to do winforms, but is gone if you try to do anything else. If you're just starting out I'd recommend Win Forms + C#. WPF and all of the other gui options are insanely difficult for reasons I still haven't understood. I made a quick video to show you how to create the app and get a simple hello world together. The drag and drop interface is great. Unfortunately virtualbox didn't record the mouse cursor (I am on OSX) so it's not as clear to follow as I had hoped. https://wxp.io/visual_studio_winforms.webm https://wxp.io/visual_studio_winforms.webm
- vixalien 5y agoexactly. we learnt VB6 in school and developing apps was a breeze, even on school computers. But now, what a shitshow. thanks for the video BTW.
- choiway 5y ago#1 is the #1 complaint. In 2021, I still don't know what Windows framework I should invest my time in if I want to develop a native Windows app.
- mikewarot 5y ago>Why so complicated? It's because Borland isn't around any more to keep them honest, and focused. Note: This is about building a program for Windows, not something to be sold in their "App Store", which is a whole different nightmare. The difference is important! If you use Lazarus, building an app (I just did one) took less than 2 minutes from reading your question, to having an EXE (under 3 megabytes) that shows a form with a button, and when you click the button, says "Hello, World" Command line programs in free pascal turn out even smaller. The exe files for this years advent of code for me are about 300-700k. Lazarus also runs on my Raspberry Pi Zero W (the old one), which only has 512mb of RAM and a 16GB sd Card.
- ab_testing 5y agoI think that this might not be the comment that you are looking for but have you tried Visual Basic.net. C# has grown into a multi platform , multi runtime language that can be used to build apps on all version of Windows from 7 to 11, Linux and Mac OS. But if you still want to make apps that only run on Windows machines and uses still supported Windows Forms- then VB.Net might be just what you are looking for. It still ships with Visual Studio and let’s you build multi windows, database centric applications.
- throwawayboise 5y agoIt's been years since I fooled around with .NET but the book I used (Microsoft .Net for Programmers by Grimes) started out with writing C# code in Notepad (or other editor of choice) and compiling with csc.exe on the command line. It would be sad if that sort of very simple use case is no longer supported, as it's always been the best way for me to learn and understand what is happening.
- trinovantes 5y agoOh boy, wait till you discover how hard is it to sign/distribute an app on Windows without triggering thousands of anti-virus programs
- avsteele 5y agoReally disagree with the OP. Google "Windows desktop development" -> https://docs.microsoft.com/en-us/windows/apps/desktop/ https://docs.microsoft.com/en-us/windows/apps/desktop/ Click the first chapter -> "Overview of app development options". It explains the options and their differences at a high level. Admittedly if you choose WinUI3 I haven't much experience, but if you chose WPF... Google "Microsoft WPF" and click the 1st result: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/?view=netdesktop-6.0 https://docs.microsoft.com/en-us/dotnet/desktop/wpf/?view=ne... Click the link "Create a WPF application". You get a lovely guide that was updated within the last month or so. https://docs.microsoft.com/en-us/dotnet/desktop/wpf/get-started/create-app-visual-studio?view=netdesktop-6.0 https://docs.microsoft.com/en-us/dotnet/desktop/wpf/get-star... You can't really complain if you are a newbie, don't follow the tutorial, and find things confusing. Dayshine's post (https://news.ycombinator.com/item?id=29529535)shows https://news.ycombinator.com/item?id=29529535)shows the easiest way to do things from the command line.
- vixalien 5y agoMicrosoft is ousing WinUI3 so why would I go for WPF instead? Remember I'm new to windows development.
- ThinkBeat 5y agoMost of this is either inaccurate or downright false. The most valid point is that Microsoft keeps churning out new UI frameworks that all seem to die quickly, with some still staying alive. Running compilers in the command line on Windows has always been possible and it is trivial these days. That goes for both (MS) C++ or .Net. Hitting F5 "build" is easier than using the command line. That does not mean the command line in not well supported. Visual Studio will generate a script you can use to build the projects from the command line for your projects Here is an example of a minimal Win32 app written in C https://docs.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-program https://docs.microsoft.com/en-us/windows/win32/learnwin32/yo... It is tiny and uses nearly no resources. The code is about the same as it was 10 years ago. Using Winforms with C# it is trivial to create a minimal Windows application that is small and uses nearly no resources. (just but a button on the canvas, hit F5). Any decent code editor can be easily adapted to work with the C# or C++ Microsoft compilers for builds. Visual Code offers deep support for C# https://code.visualstudio.com/docs/languages/csharp https://code.visualstudio.com/docs/languages/csharp This article seems to outline how to get C# support in Sublime (I am not a Sublime user so I dont know how well this works) https://www.quora.com/How-do-use-sublime-text-editor-for-coding-C-sharp https://www.quora.com/How-do-use-sublime-text-editor-for-cod...
- vixalien 5y agoYou don't really understand this. You're using a shiny new computer so running Visual Studio is not a big deal to you. You wouldn't say so if you were say living in Africa and having a really shitty connection. Sublime already allows me to build and run Android apps on an emulator by clicking Ctrl+B and takes 30s for a cold start (the app is very complex). VS took minutes (for Hello World). I want to build a WinUI3 app, and that seems to require 56mb and a hundred of mbs of dependencies just to show a button with "Click Me" on it.
- sixothree 5y agoSo your complaint is that developing for the latest and shiniest tech requires a relatively recent computer? Looking at this thread my only opinion is that you’re not understanding the things you’re complaining about.
- Shadonototra 5y agoand i'm here working on a SwiftUI app and i am so happy everything is smooth and efficient, code compiles to native machine code, there is no JIT or other weird shit that slow me down windows is being run by incompetent junior students leave that sinking ship
- physicsguy 5y agoLol, I actually think for building and distribution, it’s much easier to do so on Windows than it is on Linux, because of redistributables. On Linux you have to build on <insert ancient distro> and then build and bundle all other dependencies in order to guarantee it’ll actually work somewhere else.
- madsbuch 5y agoOp never mentioned Linux as an alternative. The original post was not about a comparison.
- dmitrygr 5y agoBeen doing this for ~ 1.5 decades with no issues: 1. build DLL in visual C that does whatever your business logic is. 2. build ui in visual basic by dragging around some controls and hooking them up to a few lines of code 3. tell VB to import your DLL 4. hook it up with a few more lines
- badsectoracula 5y agoAs some others mentioned, use Lazarus[0], it'd be the easiest way and you get a single exe file with no external dependencies. It has been a long time since i made this video, but here is one[1] where i make a 2D tilemap editor in Lazarus from scratch - it starts with installing Lazarus (note that the video is old and some things have changed but 99% of it would be the same anyway). Lazarus is crossplatform so here is another one where i make a small puzzle game under Linux/XFCE. Also starts with installing (which is a tiny bit more complicated because i need to build it from source - still a minute or so and strictly speaking you can get it running from your repository but chances are it will be broken and you avoid several potential issues if you build it from source on Linux). I might make a new video at some point though as i'm back on Linux as my main OS nowadays and Window Maker as my window manager, it'd be the farthest from how things would look on Windows :-P. Though i might capture it in a VM if possible (the two videos i linked at were from a VM). [0] https://www.lazarus-ide.org/ https://www.lazarus-ide.org/ [1] https://www.youtube.com/watch?v=_3JgeIUo1X0 https://www.youtube.com/watch?v=_3JgeIUo1X0 [2] https://www.youtube.com/watch?v=s_01Xhd2EJM https://www.youtube.com/watch?v=s_01Xhd2EJM
- chakkepolja 5y ago> 1. I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think. Aside, is there a term for this type of product bloat? "industrial ADHD"?
- shadowAuror 5y agoTo be fair, I can create the exact rant on programming in Linux...
- dt3ft 5y ago> The worst of all is that there is not even one good guide on the whole clearnet on how to do develop a Hello World windows app from scratch. If you bothered to use a search engine (google, bing), you’d find thousands of such guides.
- Gravyness 5y agoI also hate complexity and I'm not a C/C++ professional creating apps for billions of people so when I need a tool or a program I just use microsoft build tools from visual studio 2019 in a batch script to compile/run from a single source file: @echo off call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" :loop cl /nologo /Ob0 /O2 ./main.c /Fe"main.exe" && "./main.exe" echo. pause goto loop This calls the environment-setting script and uses cl.exe from that env, then compiles and if successfull executes the program on the terminal. Visual Studio current state is disgusting. vscode is an attempt to fix that but it is very slowly going the same route. Edit: I try to depend heavily on win32, because they invested a ton of time creating the documentation, and stopped changing things every month (which is literally the ONLY thing software seems to be UNABLE to do, ffs), and win32 functions work most of the time with simple setup, and usually return a code if it succeeded or not, instead of sending some obscure event to god-knows-where that has to be handled with signals, or messaging or dark rituals! And there's an example for pretty much every function call, what more does a mortal need? Everything that came after win32 is a hit-or-miss, undocumented, no examples, or just chaotic interfaces.
- explaingarlic 5y agoI understand the disappointment, but this is a case of a bad template as opposed to building Windows apps being natively complicated. UWP is amazing - I haven't had the chance or bother to use it for anything particular, but if I was going to do anything for Windows that required a UI I'd definitely use UWP. If anyone remembers the VS2012+ (I might have the time period wrong there) WIN32 default UI application, it's gigantic and the first few things you see are horrible practise. Global variable that has the root window's title, weird `InitInstance` function, use of the ATOM type (not actually used but present in the first few lines - why??? You didn't need to return anything from RegisterClassExW...). Microsoft, or at least whoever they choose to make the example work for any SDK/API that they put out, is completely incompetent when it comes to understanding where someone who doesn't know what's going on is coming from.
- psyklic 5y agoIf I recall correctly, the steps would be: 1. Open Visual Studio. 2. Create a new Windows Forms app. 3. Drag a label onto the form. 4. Change its Text property to "Hello, World!". 5. Press Run. From my experience, professional-looking Windows apps are easier for a solo dev to make than websites (HTML+CSS+JS+backend).
- wildrhythms 5y agoecho "Hello world" > index.html Can be deployed anywhere, runs on every device. No need for a 20GB+ IDE + dependencies.
- psyklic 5y agoSure, and this solution requires an entire browser instance merely to display "Hello world". The 20GB of IDE dependencies are optional. However, the IDE certainly makes development uncomplicated (the subject of the OP).
- markus_zhang 5y agoBTW has anyone tried wxwidgets? I know older UnrealED (e.g. the one for Unreal Tournament 1) was written with it.
- semireg 5y agoAnother option is to use an Electron boilerplate and then start learning a web framework of your choice. Electron development is incredibly rich. The UI is web tech, but that’s just the tip of the iceberg. There’s RPC back to a node process. You can call into native code on any platform. There are tons of NPM modules for both the browser and Node. There are bindings for whatever languages you want to use, and if you find yourself SOL (outta luck) you can even package “one file” python projects into a command line callable (via electron’s child exec) to work magic. It’s almost a limitless environment to build - I’m absolutely addicted because the puzzle solving is immensely gratifying. For example, my electron app is used to design and print labels, and it integrates with excel and CSV. Mac users of Apple’s Numbers app have been SOL because the only way to export CSV data is using the UI (either manually or pseudo manually with AppleScript). When I wrote the app 3 years ago nothing existed to read .numbers files, let alone convert to CSV. Every holiday I get a flurry of emails from sad Numbers users because manually exporting is high friction. This morning I woke at 4am and thought I’d look again and huzzah! Someone published a Python project this year to read .numbers files. Awesome. It took me about an hour to write a python script that accepted two arguments: the .numbers file and a destination .csv file. Then I spent 4 hours trying to package it up because damn if apple’s code signing isn’t a nightmare. But I digress. I built a beta and now my poor users (wife included) can finally hit save in Numbers and boom, their labels immediately update with data. Very happy! I know electron isn’t for everybody. I was (and still am) a mobile app dev writing native swift/kotlin. But I’m absolutely in love with JS/TS, warts and all! My app is https://label.live https://label.live and I’m always looking for interesting cross-platform app ideas, partners, etc.
- Meph504 5y ago> I wanted to build Windows 11 apps and I had to choose between Windows Forms, WinUI3, Win32 and WPF I think. I don't really know the difference between the 3 and no one really explains that (unless Win32 which is obvious). This is microsoft still makes it pretty simple to create apps that use 30 year libs and frameworks, WinUI3 Honestly, this is a trash fire that microsoft tried to make developers work in a walled garden, restrict their ability to distribute to other platforms, and make it very difficult to distribute to anything but their app store. They have been handed their hat for several years now, and they have chipped away at their restrictions, such as allowing sideloading by default, and allowing win32 games to be deployed on the app store. These apps only support win10 an later, and require directx11. To me, this is a failed experiement, and that has damaged the windows development ecosystem a lot. WPF is a vector based more modern UI that works well with modern MVVM techniques. But microsoft never gave it the attention it should, and it never reached the level of design and drag and drop UI development winForm did. Winform, is the most mature, but honestly dead for realistic production applications, it doesn't support UI scaling. But it's much faster to develop in, has much more components available, and doesn't fight you nearly as much if you want to do Pinvoke stuff an the like. At this point, you'd do best to just write your services in C# and do you UI in a web framework, or make use of https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blaz...
- SZJX 5y agoInteresting how nobody seems to have mentioned React Native here. Its Windows support is still rough round the edges in some situations (e.g. third-party library comparability) but the experience I’ve had so far using it to build a cross-platform app has been great. I’d imagine if you need to do more system-specific things e.g. the Windows task tray icon, you may still need to reach into the skeleton project and write some OS-specific code in C++, but the majority of the app I’m just writing in React, and there’s even a tailwind port for RN that worked out of the box. I also heard that Flutter upped their support for desktop a lot as well.
- SZJX 5y agoAnd by the way, I just realized that Windows 11 is going to support running Android apps https://blogs.windows.com/windows-insider/2021/10/20/introducing-android-apps-on-windows-11-to-windows-insiders/ https://blogs.windows.com/windows-insider/2021/10/20/introdu.... Of course it's not gonna suit every app (seems that OP requires a lot of performance in the app), but I'd imagine it would help ease development efforts a lot for a lot of apps that are not so demanding. Even if the phone layout will not be suitable, the tablet layout should be good enough in most use cases.