4 ms·
C# is a Java for the poor Missing: - native compilation, of course - mateprogramming, ctfe, mixin etc etc - raw performance - free c/c++ interop - optiona
by Shadonototro 6y ago
C# is a Java for the poor
Missing:
- native compilation, of course
- mateprogramming, ctfe, mixin etc etc
- raw performance
- free c/c++ interop
- optional GC
- manual memory management
At best it is a Java clone that tries to eat NodeJS cake at the same time, but is then eaten alive by GOLANG
C# is plagued with enterprise bullshit (OOP, dependency injection, factory bullshit, one class per file bullshit, etc etc etc)
Worse, it only has a JIT, no AOT native compilation (there is one compiler but AFAIK Microsoft is focusing on JIT) so it can't do system/native development at all
- cameronh90 6y agoC# has metaprogramming through generics, the Roslyn compiler API and source generators. C# supports limited manual memory management through unsafe and manual memory allocation methods, but this is primarily aimed at C/C++ interop. Newer performance oriented features like stackalloc and Span/Memory give most of the benefits of manual memory management without the dangers. Performance of .NET on Linux is on average better than Java and Go. Mono has an AOT implementation and Microsoft are expected to release one soon. C# normal coding style may not be to your preference, but it's become a lot less "enterprisey" in recent years. XML is nowhere to be seen any more, for example. But yes indeed it's not a very good language if you're wanting to directly manipulate registersand hardware addresses.
- Shadonototro 6y ago.net performance is good once fully warmed up JIT, wich never happen for most usecases, only in raw and longrunning benchmarks so no, real performance scenarios, .net don't do better than GO wich is AOT compiled mono performance is very bad actually generics isn't playing on same level as metaprogramming in D, not even close to templates in C++, even Rust do better here using roslyn compiler API is nice, but again, it is not the same as using the language itself already, the experience is different, it is on other hand much better than what GO has to offer
- pjmlp 6y ago> native compilation, of course There are plenty of AOT options for .NET, better improve your knowledge. > - mateprogramming, ctfe, mixin etc etc Attributes, reflection, compiler plugins, T4 templates, code generators > - raw performance So how does D stand in Techpower benchmarks or gRPC serialization performance? > optional GC If you know how to actually program in C# you also get some ways of doing it, even more so in C# 9. > - manual memory management Available since C# 1.0 via Marshal namespace. I like D, but lets not pretend C# in 2021 is the same when Alexandrescu wrote the D book.
- mhh__ 6y ago> compiler plugins This is a pretty silly point to make (D also has the other things). D does this in the language and is specified as such - not at runtime, not with compiler extensions, but with actual D code. And referring to web benchmarks is a poor measure of the language because they are about web framework performance. Weka.IO make apparently the world's fastest file system in D, so there's that.
- pjmlp 6y agoI know D since D1 days, and have bought all books produced by the community, and do advocate for D. What I don't do is blindly advocate it. Yes there is Weka.IO, apparently is the right word.
- Shadonototro 6y agoyou can't compare C# AOT solutions with what D or any other native language has to offer C# as a language is not working great in AOT environment due the managed and runtime features of the language that is the reason they are unable to strip more stuff from the executable, it's a mess so having AOT compilation doesn't mean it's automatically good, when it's bad experience, you have to say it outloud or nothing will improve everyone can add AOT compilation as bullet points just to pretend the language is capable, because it's obviously not, prove me wrong if you can, but i doubt you can, i have tested, and results are not good, at all
- 6y ago