Hacker News new | ask | show | jobs
by coldtea 3697 days ago
Windows is written in C++ mostly.

As for X11 and Gtk, well, I argue with THEM.

3 comments

Windows itself perhaps, but not the Windows API. If you've ever done any low-level Windows development, it's pure C.

See here for a tutorial using it for basic GUI stuff:

http://zetcode.com/gui/winapi/firststeps/

I've even seen several games that use it directly for keyboard handling and such to this day. And all the new, fancy GUI frameworks which exist on Windows are basically just wrappers on top of WinAPI.

Yes, but WinAPI (which is all that is required to do GUI programming in Windows) is C-centric.
Yeah, but nobody (ie. very few if anybody) does GUI programming in WinAPI, so I don't see how it's relevant in determining whether C is good for GUIs.
Unless something has changed drastically since when I was at MS, the Windows kernel and the major OS DLLs is pretty much pure C. The GUI/window manager are more C++.

Even Word and Excel were still C (although Office shared much C++ code in a common DLL)

Gotta love legacy code from the 1980s/1990s.

When were you there?

Since the new "Going native" wave, C++ has taken the role of main systems programming language, even the DDK now supports it.

Regarding office check their CppCon presentation how the code was ported to C++, refactored and made portable across OS. About 2h session.

"Going native" meant salvaging Vista's low performance by rewriting everything in C++ that was written in .NET -- .NET was the "wave" here, but it's also the culprit for Vista eating memory like cheap sushi.
Yet, the replacement of Win32 API model is with everything being written in the original design of .NET, with AOT native compilation and classes being COM objects.

What killed Vista was politics between OSDev and DevTools units.