4 ms·
I still miss COM. It had its problems, sure, but it worked really well. I haven't seen anything since that allowed such decoupled development
by marcus_holmes 10y ago
I still miss COM. It had its problems, sure, but it worked really well.
I haven't seen anything since that allowed such decoupled development
- flukus 10y agoIt came back with a vengeance in windows 10.
- marcus_holmes 10y agoreally? I must have missed that... I stopped doing windows dev around Vista, because Vista. Any details?
- pjmlp 10y agoThe UWP programming model, which was introduced in Windows 8 as WinRT is COM. Basically it is the original idea of .NET, which as called COM+ Runtime, before they decided to create the CLR. WinRT is nothing more than COM+ Runtime, but with .NET metadata instead of COM type libraries. Also since Vista, the majority of new Windows native APIs are COM based, not plain C like ones.
- mike_hearn 10y agoI think you have rose tinted classes on. COM is/was a rats nest of confusing and frequently duplicated APIs with insanely complicated rules that by the end really only Don Box understood. CoMarshalInterThreadInterfaceInStream was one of the simpler ones, iirc. COM attempted to abstract object language, location, thread safety, types, and then the layers on top tried to add serialisation and documented embedding too, except that the separation wasn't really clean because document embedding had come first. Even just implementing IUnknown was riddled with sharp edges and the total lack of any kind of tooling meant people frequently screwed it up: https://blogs.msdn.microsoft.com/oldnewthing/20040326-00/?p=40033 https://blogs.msdn.microsoft.com/oldnewthing/20040326-00/?p=... The modern equivalent of COM is the JVM and it works wildly better, even if you look at the messy neglected bits (like serialisation and RPC).
- pjmlp 10y ago> The modern equivalent of COM is the JVM and it works wildly better, even if you look at the messy neglected bits (like serialisation and RPC). Actually it is the WinRT introduced in Windows 8.
- mike_hearn 10y agoWell yes, except adoption of WinRT in industry appears to be zero.
- asveikau 10y agoI think the good ideas from COM are: IUnknown, consistent error handling through HRESULT, the coding style that emerges from being clear about method inputs and outputs. Some things done not as well as these core ideas: registration done globally in the registry, anything to do with threading, serialization, IDispatch. I think in many situations you can take lessons from the good parts and try to avoid the bad. I don't see how pointing out common bugs helps your argument though. You can write bugs in any paradigm.
- mike_hearn 10y agoYes you can write bugs in any paradigm, but some designs are just empirically worse than others when it comes to helping people write correct code. IUnknown is a classic case of something that looks simple but in fact a correct implementation is not at all trivial, yet COM developers were expected to get it right by hand again and again. COM itself didn't help with it at all, so the ecosystem was very dependent on IDE generated code and (eventually) ATL and other standard libraries. None of the things you highlight were good ideas, in my view, although probably the best you can do in C.