News for hackers. Stuff that matters.
Re:Windows Code Samples by userbinator on Sunday January 15, 2017 @12:59PM (#13405298)
The API is COM-like

I have been forced to use COM a few times, and that doesn't sound very encouraging... IMHO Win32 is simpler for a lot of things, compare for example the task of using the file selection dialog the Win32 way:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...

...with the COM "replacement":

https://msdn.microsoft.com/en-us/library/windows/desktop/bb7...

(There's a 10-level nested if in that code. I recall exclaiming WTF the first time I saw that.)

Re:Windows Code Samples by Const-me on Sunday January 15, 2017 @01:55PM (#13405641)
> forced to use COM a few times, and that doesn't sound very encouraging

I use COM a lot and I love it.

The problem with COM is it’s too many things at once.

It’s an excellent ABI.

At the same time it’s crappy RPC and overengineered serialization framework. In addition, registration could become a point of failure.

You can only use good parts and ignore the bad ones. See how MS did it with their Direct3D or MediaFoundation.

> 10-level nested if in that code

You can write shitty code like that with any framework and in any language. Doesn’t say anything about a framework or language.

Apparently, there’s some stupid policy that prevents them from using ATL in their code samples.

With CComPtr instead of raw interface pointers, you can just return the code when FAILED(), the destructor will release the objects as needed.