Hacker News new | ask | show | jobs
by leoedin 3981 days ago
If you can live with the Windows only target, developing desktop apps in .NET/WPF using Visual Studio is incredibly pain free in a way that I've never found developing HTML websites. Maybe those frameworks take some of the pain away, but I can't imagine that ease of development is anywhere near that of WPF. It helps that C# is a very nice language with a really great standard library.
3 comments

Webapps still haven't catched up with the 90's Delphi experience of doing desktop apps.
Yeah. The sad thing is so many web devs have never written a desktop app of any kind, so have no idea how painful the web really is. I loved Delphi in the 90's. That said, modern tools have far surpassed it.

If you want a C#+WPF type experience that's also open source and cross platform, check out Kotlin and JavaFX. JFX is the new third gen (post-Swing) GUI toolkit in Java and it's quite impressive. It's scene graph structured like WPF, has data binding, but also pays close attention to visuals: you can style it with a dialect of CSS, everything is 3D accelerated via D3D or OpenGL, you can do shader based effects on any part of the UI, etc. It has all the usual layout management and business components but also can do things like embedded h264 videos, 3D objects, and there's a tightly integrated embedded WebKit too if you need it.

Finally there's a tool that takes your app and spits out bundled/native packages for each platform, so the user doesn't ever have to know that the app was written in Java. No JRE or awful toolbars to install.

I've written a few apps this way and it's much more fun than writing a web app.

"The sad thing is so many web devs have never written a desktop app of any kind, so have no idea how painful the web really is."

Agree fully. there are concepts that are fully mature in desktop applications, that the web has yet to come close.

Alternatively writing web apps using Knockout seems so much nicer than WinForms and INotifyPropertyChanged hell. Maybe WPF solves this, but I wouldn't want to go back.
I was interviewing student devs recently and was flabbergasted how many of the kids doing greenfield personal projects were still using WinForms. It's frustrating how Visual Studio pushes them to work with this bone-headed warty out-of-date technology. These weren't old hands using somethign familiar just to get an MVP for a personal project, these were kids who didn't know any existing GUI frameworks and started using WinForms because it's the default in VS.
I agree. I'm asking around to see if we can get the default changed in Visual Studio.
Meanwhile I am doing a greenfield project in WinForms, because it needs to be integrated into an existing eco-system of applications and components built around WinForms.
Knockout is a data binding framework for DOM/HTML based apps.

WPF and JavaFX both have a mature reactive data binding framework so altering your model causes updates to the UI and vice-versa. JavaFX has an entire functional reactive framework in it so you can build lazy functional transforms over observable collections and the like. The fact that it's an API rather than a DSL makes it kind of ugly, I believe LINQ is a little similar but much more nicely integrated for the .NET world. But it's all there.

I must agree on that, knockout make things much nicer. KO components are a great thing also.
I tried JavaFX circa 2009 and it was scary; pure black magic in terms of what the same code would on a given day. I guess Oracle put some effort into it over the years, but never, ever again will I touch that language.
It's not a custom language anymore. It's just a regular widget toolkit API like Swing. There is a thing called FXML which is a run of the mill XML based layout language, with a GUI designer called Scene Builder.
Modern JavaFX (Java 8) barely has any resemblance with the original JavaFX.
This is the second recommendation I've heard recently for JavaFX. I will check it out to see what it is about.
What's the name of this tool that spits out the thing per platform?
javapackager. It comes with JDK8+. It can make signed DMGs on MacOS, EXE/MSI packages on Windows, DEBs/RPMs/tarballs on Linux etc. They don't have any Java branding. Here's an example of how to use it:

https://github.com/vinumeris/lighthouse/blob/lighthouse/mac-...

The catch is you need the platform to make packages for the platform. It can't make Mac DMGs from Windows, for instance. I have a Mac laptop with Parallels so I can make packages for all three major platforms.

To stay on the .NET topic, this is the closest the JVM world currently has to something like .NET Native, I guess, although of course, there is no native code involved .... it just looks that way to the end user. I guess when .NET matures as a cross platform solution they will need a similar tool, as other platforms don't have the runtime installed by default.

Most commercial JVMs do have native compilation, .NET Native style though.
I do understand that .net is far more powerfull, far more everything, but the best tool not always is the one that conquers the world. I would truthfully love to see Microsoft bring WPF to other platforms.
I love C# enough to do side projects in it, and I never thought I would say that about a msft product, especially with so many powerful scripting languages out there now. But it really is a good language, and the development environment beats any web framework toolset I have used.