4 ms·
> Ohh I see you want to write a tcp server with asynchronous processing? Here's some generics you can just c&p. So we've come to the point where copy-pasteabil
by eyko 12y ago
> Ohh I see you want to write a tcp server with asynchronous processing? Here's some generics you can just c&p.
So we've come to the point where copy-pasteability is a language feature? Tell me I can use a library or module. Tell me that the language comes with built in features to help me do this or that. But never tell me I can copy-paste generic code. Please.
- mattmanser 12y agoThat's actually one of the features of C#, if something is needed or is hot in another language, it will appear in the core libraries. They've realised recently this is having a negative effect on open source C# code as so much of the community waits for the "offical" version, but it has its positives too, almost anything you want to do is in the core libraries.
- EdwardDiego 12y agoThis is my main grudge with .NET development, a culture of preferring The One True Way. It (among other things) leads to a lack of .NET FOSS diversity.
- Pxtl 12y agoThe biggest problem with this culture is that it means that when the One True Way is wrong, we suck it up and use it anyways. I mean, Entity Framework is great, WebAPI is slick, and MVC has its moments, but there are some real trainswrecks. I've used all three XML serializers in the .NET framework and they're all cringeworthy. ASP.Net WebForms could have been something spectacular with open development instead of the hideous monstrosity it was. And MSBuild would have been laughed out of the room and regarded as some kind of bizarre eccentricity like TempleOS or UrBit instead of a serious build system.
- Paradigma11 12y agoDont mock msbuild. i never slept as much or as well than when i tried to work through the documentation.
- koyote 12y ago>I've used all three XML serializers in the .NET framework and they're all cringeworthy. XmlSerializer, DataContractSerializer, and what is the third? I agree and was about to point out the same thing though; XML serializers in .NET are a joke but because they exist in the core libraries there is not really a compelling open source alternative. That being said, it seems like the Asp.Net Web API is actually using Json.Net instead of the built-in serializer.
- Pxtl 12y agoXamlServices serializer. Technically it serializes Xaml, but afaik it can be prodded to produce vanilla XML.
- glifchits 12y agoGeneric code is made to be copy-pasted. Also, what's wrong with copy-pasting when it lets you write features faster?
- StavrosK 12y agoIt's a code smell that usually means there's something there to be abstracted, or that your API isn't as clean as it could be.
- codeulike 12y agoI'd take a bit of copy-paste over premature generalisation any day.
- StavrosK 12y agoI'd take a premature generalisation over a false dichotomy.
- codeulike 12y agoSo if its not a dichotomy, what are the other options? If you want to avoid copy/paste, you have to use generalisation techniques.
- StavrosK 12y agoYes, and generalisation doesn't mean premature generalisation. It's very possible to just have a well-designed generalisation.
- codeulike 12y agoWell OK. But in a lot of cases I see badly designed over complex generalisations ("premature generalisation") because of a phobia of copy/paste. A bit of copy/paste is OK guys, seriously. Wait and see how it goes for a bit and then refactor the general case in later _if_ it seems worth it.