Probably not, but it’d be closer to Clojure. Depending on codebase you’ll likely have also many repeating namespace imports (can be avoided whith implicit usings in modern C#) etc.
We start with the source-code markup you can see, remove comments, remove duplicate whitespace characters, and then apply minimum GZip compression. The measurement is the size in bytes of that GZip compressed source-code file.
Thanks to Brian Hurt for the idea of using size of compressed source-code instead of lines of code.
median
February 2025
===============
Toit 558
Perl 570
Lua 580
PHP 581
Ruby 583
Python 3 585
Julia 634
Chapel 646
Racket 696
JavaScript 698
OCaml 741
Erlang 798
Go 831
Dart 847
Smalltalk 871
Haskell 892
Java 910
Lisp 938
Swift 939
F# 943
Pascal 959
Fortran 1091
C# 1117
C 1121
C++ 1129
Rust 1235
Ada 1825
The Benchmarks Game has some highly optimized implementations and is not a good representation of typical code. Some languages allow you to go a lot lower than others if needed, which adds verbosity, that does not mean typical code must be verbose. There are things possible in C# that you just can't do in Java, for example. That does not mean typical Java code is more concise than C#. On the contrary, typical C# would be probably considerably more "dense".
I'd expect programming style to have a lot to do with it. Many modern languages are evolving toward Lisp and support ever more of its features. Generic programming and meta programming for instance.
(I think the tool used accounts for imports and defines.)
What anecdotal experience? Not that I think LLMs produce good code, but for me it has produced a lot better c# than TypeScript fo example. I guess quality matters more than quantity when it comes to LLMs training data.
I have nearly a decade of experience building .NET C# solutions on Linux and lately also on Mac, with almost everything hosted on Linux via Docker. I’m not sure what’s still missing for it to be accepted into the "first class citizen" club by the Linux elite.
I have worked with AWS, Google and Azure. Google Cloud has the worst UI of them, it slow, broken and just horrible. UI in AWS may be faster than Azure, but overal layout and organization feels a lot better in Azure. I would strongly recommend clearly separating builds from deployments, if you don't want bad surprises. In the age of containers there should really be no difference in how, where or what you deploy.
Sorry, made a typo with 'gave' -> 'have'. But the point stays , why would C# be (one of) the worst choices here (when C# has small AOT binaries, hot reload etc)?
And Linux kernel is written in C etc, so by this logic you don't even need memory safety. There is no good excuse for designing a language in modern times (this century) with every object nullable by default. C# at least mostly has solved this design mistake later by introducing nullable reference types (https://learn.microsoft.com/en-us/dotnet/csharp/nullable-ref...). Then again, Go designers insisted that generics were also unnecessary, until they changed their mind.
On the contrary, because there we have 40 years of security exploits to prove otherwise, and Linux kernel has plenty of CVEs.
C# solution doesn't work, most projects never adopted it, because it is a mess to use with third party libraries that never bothered to add the required annotations, hence why it is still a warning and optional to this day.
I’m not sure which .NET libraries you are referring to, but all the ones we use have nullable reference types enabled. If you configure warnings as errors (as you should), then it works exceptionally well. Even if you were to use a library where nullable reference types are not enabled, you only need to check for null once during the library call, rather than everywhere in your codebase.
What? NRTs are used everywhere with WarningAsErrors:nullable also gaining popularity. Whatever environment you are dealing with C# in, if it’s the opposite I suggest getting away from that ASAP.
sidenote: just a heads up that I tried emailing you recently to let you know that you might want to contact the HN mods to find out why all your comments get set to dead/hidden automatically.
Your account might have triggered some flag sometime back and relies on users vouching for your comments so they can become visible again.
I saw the email, and thanks. This is okay - I did not exercise (nor anyone should) good impulse control when dealing with bad faith arguments, which inevitably led to an account ban. Either way, Merry Christas!
reply