4 ms·
Do real organizations actually use C#? Every time we've evaluated it we concluded it's a worse, MS-flavor Java rewrite so we didn't take it too seriously. Does
by parliament32 2y ago
Do real organizations actually use C#? Every time we've evaluated it we concluded it's a worse, MS-flavor Java rewrite so we didn't take it too seriously. Does it have any actual advantages over Java?
- pjc50 2y agoIt is IMO better than Java these days, although they're pretty close. Whenever I have to go back to Java I find odd things missing, like unsigned long. AOT is pretty good when it works.
- CharlieDigital 2y agoLots of real orgs use C#. StackOverflow survey (self reported) for 2024 shows it at #5 leaving out HTML/CSS, and SQL[0] DevJobsScanner shows it at #4 via scraping job postings[1] It definitely has heavy adoption; well above Rust and Go despite what we see here on HN. > Does it have any actual advantages over Java? The language evolves faster and is more akin to Kotlin than to Java, IMO. The DX is fantastic and there are a few gems like LINQ, Entity Framework, and Roslyn source generators. Modern C# can be very dense yet still highly legible. C# switch expressions with pattern matching (not switch-case), for example[2], are fantastic. [0] https://survey.stackoverflow.co/2024/technology https://survey.stackoverflow.co/2024/technology [1] https://www.devjobsscanner.com/blog/top-8-most-demanded-programming-languages/ https://www.devjobsscanner.com/blog/top-8-most-demanded-prog... [2] https://timdeschryver.dev/blog/pattern-matching-examples-in-csharp https://timdeschryver.dev/blog/pattern-matching-examples-in-...
- alemanek 2y agoIt has been 8 years since I last wrote any C# code and I still miss LINQ to Objects. It felt so natural building up queries against collections and very readable.
- CharlieDigital 2y agoThey've made the language much more terse, IMO, taking a lot of cues from TypeScript/JS as well as other languages. Constructs like primary constructors, record types, pattern matching, and destructuring continue to improve ergonomics, IMO. For a quick comparison, check out https://typescript-is-like-csharp.chrlschn.dev/ https://typescript-is-like-csharp.chrlschn.dev/
- wseqyrku 2y ago> Do real organizations actually use C#? Sure. For me the best thing about dotnet is that you most likely find an official solution to most "basic" things needed to develop microservices (I intentionally call these basic because you don't want to worry about lots of things at this level). Go on the other hand excels at cross-cut and platform development.
- osigurdson 2y ago>> Does it have any actual advantages over Java? Probably not. Why learn C# if you already know Java? Similarly, why learn Java if you already know C#?
- neonsunset 2y agoJava lacks huge low-level feature set C# comes with. It is also generally less nice to work with - Maven and Gradle are a way bigger PITA than .NET CLI (which is similar to Cargo and Go CLI), NuGet and MSBuild. Base C# syntax lends itself to more streamlined expression of business logic (e.g. with pattern matching, tuples, records and their deconstruction). In Java, there are odd issues and resulting method gymnastics caused by generics with type erasure, and many of its base containers don't unify nicely as the ones in C# do to IEnumerable<T> or Span<T>. Writing highly concurrent + parallelized code is way more cumbersome (and generally less efficient) with the current rendition of virtual threads, completable futures or even upcoming structured concurrency API than doing so with .NET 'Task<T>'s and their composition. ASP.NET Core is much faster and more focused than Spring Boot. EF Core is way more powerful and significantly terser to use than Hibernate, JPA or, to an extent, JOOQ. You can also relatively easily ship fully self-contained and relatively compact (with trimming) applications, often as a single file. With additional effort, NativeAOT provides native compilation and smaller-than-Go binaries while having much wider support across ecosystem than GraalVM Native Image within JVM space (e.g. it's one command away to get a gRPC-based ASP.NET Core microservice template which compiles to fully native binary, it also does not use any special tricks - just regular code). They are very much not 1:1 languages. Depending on the domain, there may very large differences in developer productivity, level of comfort and effort required to achieve a competitive implementation. Java strengths lie in its comparatively larger and more diverse ecosystem in enterprise space alongside certain high-profile projects, predominantly by Apache foundation. On technical merits it does have less to offer. The main technical exception - Java has superior GC implementation(s). I'd say if your goal to expand your horizons, then it's more important to pick a problem that can't be nicely solved with Java. In that case, C# will offer more pleasant and moderately familiar experience over C, C++ or, to an extent, Rust (which is another great language to learn).
- 2y ago
- munificent 2y agoWhen I was at EA, almost all of the internal tools for building and editing games were written in C#.
- jeremyjh 2y agoIt is quite widely deployed in many non-software companies of all sizes that build custom software to run their business, and really seems to dominate in small and medium businesses. Its also popular in Game dev mostly due to Unity, but you have other good options to use C# in game dev as well. I can't think of another kind of software company that uses it a lot other than ones that integrate deeply into the microsoft stack. As a language, it was far, far ahead of Java for many years (the long dark tea-time of Java 7).
- wvenable 2y agoC# is easily my favorite language and Java is one of my least favorite languages.
- WuxiFingerHold 2y agoYou are overestimating the voices / anecdotes / evangelists from the internet. I did this as well ... so no offense. When reading HN or Reddit one can easily get the impression that Java, C++ and C# are dead and the world has turned to Rust and Go. Esp. C# is underrated in the real world. Here's some data of 12M scraped job offerings: https://www.devjobsscanner.com/blog/top-8-most-demanded-programming-languages/ https://www.devjobsscanner.com/blog/top-8-most-demanded-prog... JavaScript: 31.42% Python: 19.68% Java: 18.51% C#: 11.90% C/C++: 8.29% Go: 2.38% Rust: 0.39% I was a bit shocked about the Rust numbers. I'd expected it to be slightly above Go. Anyway. C# is strong. Java even more.
- steveklabnik 2y agoA lot of Rust jobs aren't "Rust jobs," that is, they don't have "Rust" in the description. Also, "job openings" is not the same as jobs, my organization isn't currently hiring engineering roles, yet we employ ~60 engineers, of whom most write Rust. And we're just a tiny startup.
- 9rx 2y ago> I'd expected it to be slightly above Go. Why's that? Go was designed explicitly to serve the particular needs of a particular area of software development that allegedly sees more than average development activity. In fact, its designers have expressed some surprise that people found it useful in other areas of programming. Rust, on the other hand, tries to be much more general purpose. Being a jack of all trades master of none, so to speak, is a great technical quality, but without particular focus it is much harder to get the numbers up. It is quite similar to why Javascript blows all of the other languages out of the water. It would be surprising if Rust had more usage like it would be surprising if C had more usage than Javascript.