Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I haven't done Windows development in over 10 years, but I really wasn't expecting to see what appears to be a stripped down implementation of AppKit wrapped around the old Win32 APIs, like it's 1999. (Nor Hungarian Notation).

I thought WPF or WinRT or UWP was supposed to have replaced Win32 by now.



I don't do any desktop development or use Windows much for that matter, but it looks like as of today, there are at least 4 ways [0] to build Windows desktop apps. No wonder the UX feels far less consistent and enjoyable than macOS.

[0] - https://docs.microsoft.com/en-us/windows/apps/desktop/


Microsoft wanted to take developers in a direction they didn't want to go. They seemed to have realized their mistake and trying to unify this mess. In the recent past, you wouldn't find WPF and Windows Forms mentioned in the same article as UWP.

Apple had their own problems with this (Carbon vs Cocoa) but that legacy has been shaken off.


That's interesting, did not know about the carbon to cocoa move, couldn't afford anything Apple back then :)

If both platforms had to handle such migrations, I guess it's only fair to say that Windows' solution would be much more difficult given how committed Microsoft is to maintaining backwards compatibility.


Carbon/Cocoa wasn't really a "transition" per se.

Cocoa was not only older (the API comes from NextStep), it was also always marketed as being the "Native" API from day one [1]. Carbon was a secondary API marketed by them as a way of having "applications that also run on previous versions of the Mac OS (8.1 or later)" [2]. Carbon apps were uglier, clunkier and harder to write/maintain than Cocoa.

Now that I remember it: Back in the early 2000s Cocoa was so much better that they had to write iTunes (or was it Finder?) in Carbon to convince developers that Carbon was able to handle real world apps.

The problem with Carbon is that companies like Adobe, Autodesk and Microsoft overstayed their welcome and dragged their feet for almost 10 years instead of porting to Cocoa like Apple recommended in conferences. To convince them to port, Apple deprecated Carbon it in 2007 and removed it 12 years later in 2019.

[1] http://web.archive.org/web/20010617021453/http://developer.a...

[2] http://web.archive.org/web/20010620032754/http://developer.a...


When comparing Carbon and Cocoa, only a fool would choose to write an app in Carbon. But initially there were a few problems:

- On old 90s hardware, Carbon could be faster (due to the C API)

- Apple didn't invent AppKit or Objective-C. That technology was inherited from NeXT and from what I understand there was push-back both within Apple and from the Mac developer community about adopting a language with an unusual syntax that nobody used.

Apple tried to transition Objective-C to a modern C++ style syntax, and failed.

Apple tried to get developers to use Java with AppKit (hence, the name Cocoa) and failed.

Apple tried to get developers to adopt garbage collection, and failed.

In the end, they didn't need to do any of that. Mac developers eventually became quite enthusiastic about Objective-C and AppKit and it quickly because the one true way to write Mac apps.

However, it took many years for Cocoa and AppKit to become fully formed. Up until 2009 and OS X 10.6, there were still many things that couldn't be done in Cocoa and required the Carbon APIs, mostly related to the Mac-specific features of the file system, like persistent file references, icons, metadata, etc.

For example, if you want to implement a UI for copying a file, you're going to want to display a progress bar and have the ability to cancel the operation. Up until OS X 10.6, that simply couldn't be done with Cocoa (NSFileManager, NSURL, etc.). You had to use gnarly Carbon APIs.

(Actually, it still can't be done with NSFileManager, but Apple added that ability to the Darwin file system APIs.)

That's why the Finder was initially implemented in Carbon.

And little bits if Carbon still live on in the modern 64-bit Mac world. If you want to implement global Hot Keys in your app you have to use the Carbon API and convert the Carbon key-codes to their AppKit equivalents.


Both iTunes and Finder were at least partly Carbon for a long time. I'm not so sure convincing developers was the reason for that, though. iTunes 1.0 was Mac OS 9 only, and didn't even run on Mac OS X. It was a continuation of SoundJam MP, a third-party Mac app that predated the release of Mac OS X. So, really, iTunes was ported forward to Mac OS X using the same process Apple expected developers of existing Classic Mac apps to use, but that probably wasn't a decision (solely) made for developer relations reasons.

I don't know much about the history of Finder in this regard, unfortunately. It of course existed from System 1.0 in 1984, but how much of Mac OS X 10.0's Finder was a complete rewrite and how much was ported from Classic Finder vs NeXTStep is something I have no idea about. It certainly had UX that came from NeXTStep (the column browser, for instance).


> I'm not so sure convincing developers was the reason for that, though.

It was for Finder. During one of the WWDCs or MacWorlds (I don't recall which), Jobs specifically mentioned that Finder was written in Carbon as a way to show that Apple eats its own dog food. It was the big demonstration that Carbon wasn't some second-rate API … although, of course, it was.

Dogfooding as a concept isn't Apple-specific but it's definitely a meme in Apple circles — especially when Apple is detected as specifically not eating its own dog food!


And then they had a big thing where they rewrote it in Cocoa, too, to show how easy it was to migrate over.


For a language compiling to native instructions, there's really only the C(++) API. UWP is barely used in my experience and WPF/Windows Forms are basically exclusive to the dotnet framework.

Windows Forms and the native API share most of their controls' look and feel while WPF is a free-form application framework that allows you to ignore all UI standards if you desire to. I can't remember the last time I've seen a WPF application though, I think it's either dead or dying already.

UWP is the new API Microsoft really wants everyone to use. It comes preloaded with the "native" Windows 10 feel with their new design and is intended to be distributed through the MS app store (though you can install packages manually with some effort as a developer).

It's what new applications aiming to be Windows native probably should be using in my opinion, but most developers seem to stick to the native API or its wrappers. That means there's barely any UWP applications in use by most people, which means they aren't used to the UWP style, which means they find UWP apps weird, which means there's barely any UWP apps, etc., etc., etc.


The push now for UWP is so misguided. I have no clue why they've decided to spend decades making apps jankier and weirder.


UWP is so last year! We're all about WinUI now! ;)


The comment looked like a joke, but somehow I new it wasn't. Microsoft always has a next-new-thing to spend your time on...

https://microsoft.github.io/microsoft-ui-xaml/about.html

> WinUI 3 is the next version of the WinUI framework, shipping later this year. It dramatically expands WinUI into a full UX framework, making WinUI available for all types of Windows apps – from Win32 to UWP – for use as the UI layer.


I suppose if Swift can only interoperate with C APIs, Win32 would be the only option.


Well, Swift uses LLVM, so it's possible to link it to C++ code with extern "C" declarations.


According to this document, direct C++ interop will soon be done without the need of extern "C" wrappers. [0]

[0] https://github.com/apple/swift/blob/master/docs/CppInteroper...


That's as they say, not even wrong. :-D

The C ABI is stable. Any (normal) C compiler and a bunch of compilers of other languages can produce blobs which can be linked with each other, and by extension with C++ code with extern "C" declarations.


On macOS there’s three: Cocoa, Catalyst and SwiftUI.


All map to more or less the same underlying libs and widgets, so there's no real difference...

In Windows there are totally different widget look and feels supported...


I hope WinForms never dies, it is the OG Windows "look" and much less amenable to all the web-app looking BS that permeates desktop apps today


A lot of Windows Forms is non-Win32 controls with custom drawing, by the way. Especially things like menus, toolbars, etc. So a lot of Windows Forms controls are basically as native as WPF controls (just a lot harder to work with imho).


Are you sure? The source is available for both Core and old .NET and to me they all seem to be Win32 controls with some customization... unless I'm missing something. AFAIK WPF uses DirectX for rendering, so it's a bit different (it's more like Flutter... or a game engine).

Button: https://github.com/dotnet/winforms/blob/master/src/System.Wi... / https://referencesource.microsoft.com/#System.Windows.Forms/...

Toolstrip (also base for menu): https://github.com/dotnet/winforms/blob/master/src/System.Wi... / https://referencesource.microsoft.com/#System.Windows.Forms/...


Okay, perhaps my wording was off. Yes, they're Win32 controls in that sense, but many (most?) of the newer controls are no longer mere wrappers around something that exists in Win32, but rather implement all functionality in managed code, both behavior and drawing.


True and what’s more, Microsoft recently deprecated a load of Wi 32 native controls like Menubar and Toolbar where they now want you to migrate to the managed code / styled MenuStrip and ToolStrip.


> no longer mere wrappers around something that exists in Win32, but rather implement all functionality in managed code, both behavior and drawing

But that's how we do custom controls in Win32. You can get very far with only common controls, but as soon as you need something more complicated you have to draw it yourself. Just because they're using C# doesn't mean it's not the same API or is not native controls.

WPF on the other hand is completely different, internally it only uses native calls to get the canvas where everything will be drawn and to handle input/accessibility (plus a few other things).


WinRT/UWP is not a replacement for win32 because it's missing lots of OS apis, it's not just about the UI related apis.


True but it's intended. Win32 is too useful so it makes some security problem.


Windows dev is a superfund site


I always heard it was a dumpster fire, but you've upped the ante by calling it a toxic waste site. Nice. I don't think I have heard a more appropriate description.


A delinquent toxic waste site even




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: