Live data from Hacker News

WCF is Open Source

dotnetfoundation.org

51–60 of 149 posts

Re: WCF is Open Source

#51

Earlier quoted context omitted.

> Because WS-* . While WCF supports WS-* and is in large part organized around it, some of the complexity isn't "because WS- ", its "because WCF is a higher-level abstraction that supports, among other things, WS-* ". I mean, you can apply all that overengineered configuration to build REST services with WCF, too. You probably don't want to (unless you are already heavily invested in WCF), but you can .

>...its "because WCF is a higher-level abstraction that supports, among other things, WS-* " And it fails spectacularly. I mean, _it works_, but it's a disaster to work with and write software against. The entire abstraction is leaking profusely, all precisely "because WS-*". Who in their right mind will attempt to establish a family of standards for "transport-agnostic" communication, routing, serialization and what…

> And it fails spectacularly. I mean, _it works_, but it's a disaster to work with and write software against.

Can you give an example of how it's a disaster? I'm genuinely curious because I've had to use it for at least 5 years (I still support 1 WCF solution) and this was never my experience.

Re: WCF is Open Source

#52
post #29

Earlier quoted context omitted.

Correct me if I'm wrong but Microsoft is not planning to make WPF and Windows Forms Open Source.

Both are probably too entangled with Windows internals. Windows Forms is essentially a wrapper around native GDI controls. WPF's rendering system is quite intertwined with the DWM It's much easier to open-source the things with fewer dependencies, such as .NET Core, ASP.NET and other networking stuff. It's also invariably what customers are likely to want to run on Azure (or elsewhere), just maybe not with Windows un…

Entirely true. Still, seems like if they were to open-source WPF, the Mono community would have an interest in trying to abstract out the DirectX dependencies and making it run on OpenGL. Shame we'll probably never see it happen - it would be great to see a true cross-platform GUI toolkit for .NET that's not GTK.

Re: WCF is Open Source

#53

WCF is great if you want to make a single data service available as JSON via REST, XML via SOAP, a custom binary protocol via raw TCP, and who-knows-what else. In practice you're almost always better off just picking a single format for your endpoint, in which case there's no reason to use WCF.

WCF is passable iff both your sides are .NET - in which case it is an overkill, slow and unneededly complex. If your other endpoint is not .NET, it's all of that and also horribly broken.

Have enumerations somewhere? WCF will encode them as integers. Have or need a date/time value in a format that isn't what WCF generates or expects - e.g. JSON Date() expressions? Doable, but error prone, slow and unintuitive (and ... In that case - why use WCF at all?)

WTF would have been a better name for this library.

Re: WCF is Open Source

#55
I love C# and .NET, but WCF is a true source of frustration. It isn't horribly bad, but there is nothing good about it either. It's too complex, too messy, and too "Microsofty" for lack of a better word. Many layers of abstraction, hidden magic in XML files (which you can of course turn off, but then you need to know how to), and so on. Nevertheless, shares of coders blindly use WCF, "because Microsoft tells us to". Bullshit, and what a waste.

There are very few modern use cases where WCF is the best option out there. If you want to make a RESTful API with .NET, please consider:

     * ASP.NET MVC Web API
     * ServiceStack
     * Nancy
Nancy is basically Ruby's Sinatra but then on .NET.

ServiceStack recently became commercial, but it still is the best designed API library I've ever seen, in any language. It makes you focus more on the actual data inside each request and response, and less on the form of that data (is it a query parameter, JSON POST field, or part of a fancy URL? who cares, design your messages first and then figure out what the URLs should look like). The result of this is that somehow you tend to automatically design forward-compatible, extensible API endpoints. I guess you really have to feel it to believe it, but I kid you not, with ServiceStack, it feels like your API designs itself in front of your eyes.

If anyone knows anything like ServiceStack on any other language, please tell me and I'm going to give you hugs.

Finally, MVC Web API is basically Rails's API controllers ported to C#. It has a tad too much magic for my taste, but it's a familiar and decent pattern that just works.

Please, please, let's just bury WCF and embrace the true goodies in the .NET open source ecosystem. It's nice that WCF got open sourced, but it's still a mess. If you really must go the "because Microsoft!" route, please just use ASP.NET MVC (also open source, and in active development).

Re: WCF is Open Source

#57
post #53

WCF is great if you want to make a single data service available as JSON via REST, XML via SOAP, a custom binary protocol via raw TCP, and who-knows-what else. In practice you're almost always better off just picking a single format for your endpoint, in which case there's no reason to use WCF.

WCF is passable iff both your sides are .NET - in which case it is an overkill, slow and unneededly complex. If your other endpoint is not .NET, it's all of that and also horribly broken. Have enumerations somewhere? WCF will encode them as integers. Have or need a date/time value in a format that isn't what WCF generates or expects - e.g. JSON Date() expressions? Doable, but error prone, slow and unintuitive (and ..…

I remember so much pain trying to get a .NET WCF and Java SOAP service to work together when they should have been compatible. This is an amusing read: http://harmful.cat-v.org/software/xml/soap/simple :)

The UK National Rail API is a WCF SOAP endpoint so I wrote this open source proxy with Web API to make it easier for non-.NET developers more familiar with restful JSON: https://github.com/jpsingleton/Huxley

Re: WCF is Open Source

#58
post #53

WCF is great if you want to make a single data service available as JSON via REST, XML via SOAP, a custom binary protocol via raw TCP, and who-knows-what else. In practice you're almost always better off just picking a single format for your endpoint, in which case there's no reason to use WCF.

WCF is passable iff both your sides are .NET - in which case it is an overkill, slow and unneededly complex. If your other endpoint is not .NET, it's all of that and also horribly broken. Have enumerations somewhere? WCF will encode them as integers. Have or need a date/time value in a format that isn't what WCF generates or expects - e.g. JSON Date() expressions? Doable, but error prone, slow and unintuitive (and ..…

> Have enumerations somewhere? WCF will encode them as integers.

Can you give an example of this? I have never had this problem.

> Have or need a date/time value in a format that isn't what WCF generates or expects

In my experience this is a data-interchange problem that will always exist. It is not unique to WCF.

I do agree that if you are using REST/Json then you should avoid WCF.

Re: WCF is Open Source

#59

Dear fellow nerds, please write out all acronyms the first time you use them (TFTYUT), our nerd circles may not overlap. After TFTYUT you can use the nice short version however you wish. Many thanks.

Except if the acronym is DRY (Don't Repeat Yourself).

My personal favorite for very poor copy&past code is ARY (Always Repeat Yourself).

Re: WCF is Open Source

#60

I love C# and .NET, but WCF is a true source of frustration. It isn't horribly bad, but there is nothing good about it either. It's too complex, too messy, and too "Microsofty" for lack of a better word. Many layers of abstraction, hidden magic in XML files (which you can of course turn off, but then you need to know how to), and so on. Nevertheless, shares of coders blindly use WCF, "because Microsoft tells us to".…

It's worth remembering that the technologies you mentioned weren't around when WCF was created.

As far as I can tell, Microsoft doesn't really push WCF any more simply because the use-cases are fewer and/or irrelevant in the current Web Service landscape.

I also get the feeling that many people commenting here didn't need to work with WS-* and associated technologies at the time WCF didn't exist. After its release it really was a choice between the lesser of two evils. But at the time, WCF was the mischievous kid who didn't do his homework, and everything else was the direct spawn of Satan.

A reminder of what WCF is (Wikipedia):

> a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications

> WCF is a tool often used to implement and deploy a service-oriented architecture (SOA)

For people who were around during the SOA dark ages, I won't be surprised if reading that sent shivers down your spine. Thankfully SOA, as it was evangelized, is pretty much dead. For everything else, these days better data-interchange technologies exist.

Post reply on HN