4 ms·
Something I often wonder in these sort of discussions is why C# is generally omitted. Its performance is comparable to C++, with none of the trappings. It also
by indubitable 9y ago
Something I often wonder in these sort of discussions is why C# is generally omitted. Its performance is comparable to C++, with none of the trappings. It also does an excellent job of integrating some of the most useful features of functional programming into an imperative language. And multi-processor programming with the language is also incredibly simple.
But I think the best part is in programmer time. An anecdote I find endlessly entertaining is on another forum I shared some code to solve a problem people were having an issue with, and it was assumed my code was pseudo-code. It was correct, compilable C#. And they're constantly adding incredibly useful features. For instance a recent addition is more expressive tuples:
(int number, string s, char c) triple = (2, "two", '2');
triple.number = 13;
And lambda functionality is similarly clean. A lambda value might be:
x => 2*x + 5;
Equivalently, as an anonymous method:
delegate(double x){return 2*x + 5;}
And an example of how simple arbitrary processor count parallel programming can be (using lambda syntax as above):
Parallel.ForEach(listOfThings, thing => DoSomething(thing));
Yet as typical in scenarios like this one, the author sees the decision as being between opposite extremes of C++ and Python. The only downsides of the language I've run into are a lack of some shoot yourself in the foot features of C++, like multiple inheritance, and the fact that template specialization is awkward. Garbage collection is vastly overblown. My main work is with projects that have in memory collections in the gigs of size and you'd think the collector would be a huge issue, yet it's mostly transparent and can be controlled if necessary - which in the vast majority of cases, is not.
- blub 9y agoC# started out as a boring Java clone enterprise language from the company famous for its "embrace, extend, extinguish" strategy. In fact they invented C# because they got sued for trying to "extend" Java. And until now no amount of cool features and Microsoft PR were able to remove that stench.
- pletnes 9y agoThe author is a scientist analyzing his data. I never met anyone in that crowd using C#. Are there even any good data science/numerics libs out there? C++ has a lot of number crunching libs, python even more.
- pjmlp 9y agoYes there are, IMSL and AleaGPU for starters. https://www.roguewave.com/products-services/imsl-numerical-libraries/net-libraries https://www.roguewave.com/products-services/imsl-numerical-l... http://www.quantalea.com/ http://www.quantalea.com/ .NET is used a lot for data analysis in life sciences, as most laboratory devices only expose COM and .dll interfaces. Specially for stuff like DNA sequencing, chemical structure manipulation, reaction curves analysis and such.
- icey 9y agoIt's probably more common for data scientists in the .NET world to use F#. FsLab (https://fslab.org/ https://fslab.org/) seems cool from some limited experimentation (disclaimer: I'm not a data scientist, but am data curious).
- indubitable 9y agoThis is not my field, but I have used Accord.NET (http://accord-framework.net/ http://accord-framework.net/) while learning machine learning and have no complaints, but also have little room for comparison. Any C++ library you'd consider as definitive, for some basis to compare? One other thing is that running C++ libraries in C# is, in most cases, quite trivial.
- woolvalley 9y agoIt has been for the longest time been a closed source MSFT only thing. It wasn't open source and running on linux was a second class citizen. Not sure if it is still a second class citizen. It's also seen as something fairly heavyweight to write things in, such as Java. You probably don't see it used much for the same reasons why Java isn't used.
- Pxtl 9y agoHonestly, I love C#, but if I was looking for a sane language with a wide library to draw from that matches as many use-cases as possible, I'd probably do Kotlin. Java has a solid community for just about everything, and Kotlin is close-enough to c# for my taste. But Kotlin doesn't have much name recognition outside of Android.
- indubitable 9y agoWhy do you think it's been closed source with minimal cross platform effort? Most of everything from Microsoft related to C# is open source. This includes their compiler, the runtime, and the framework and libraries. And it's been this way since 2014. The .NET standard itself has always been open and cross platform implementations like Mono go back to 2004! I'm not sure what you mean by 'heavyweight.' Its performance is head to head with C++. Here's the primary repo for .NET goodies: https://github.com/microsoft/dotnet https://github.com/microsoft/dotnet --- And if anybody downvoting could take a second to actually chime in, it would be illuminating. From my perspective all I see an immense amount of misinformation about the language, and I'm genuinely curious what people may not like about it.
- eesmith 9y agoI know little on this topic, but as you were looking for some feedback I thought I would response. Because the Microsoft version was closed source for a long time? It was released in 2000. You give 2014 as the open source date, which was only 4 years ago. Woolvalley was referring to the implementation, so bringing up the specification is not that relevant. The ECMA specification does (did?) not include ASP.NET, ADO.NET, and Windows Forms. The implementation of those APIs were potentially covered under patent, as the Microsoft Community Promise did not apply. As Wikipedia points out, "These technologies are today[when?] not fully implemented in Mono and not required for developing Mono-applications, they are simply there for developers and users who need full compatibility with the Windows system." https://en.wikipedia.org/wiki/Mono_(software)#Mono_and_Microsoft's_patents https://en.wikipedia.org/wiki/Mono_(software)#Mono_and_Micro... . While that point is moot today, that is part of the history which guides current views. If by C# you mean the ECMA specification, then that's different than C# as available for Windows by Microsoft. Is C# a first-class citizen on Linux comparable to how Visual C# is a first-class citizen on Microsoft Windows, or how C++ is a first-class citizen on Linux? I don't have the experience with that, but it doesn't seem to be the case. What languages do you consider to be "first-class" and "second-class" on Linux?