[HN Gopher] .NET Myths Dispelled
       ___________________________________________________________________
        
       .NET Myths Dispelled
        
       Author : geekydev
       Score  : 77 points
       Date   : 2022-03-12 19:30 UTC (3 hours ago)
        
 (HTM) web link (blog.devgenius.io)
 (TXT) w3m dump (blog.devgenius.io)
        
       | skeeter2020 wrote:
       | Most of these are strawman setups, except for #6 (Boomer code)
       | which is not a myth but a truth. I've spent a lot of years in the
       | MS ecosystem and despite their attempt to entice many younger
       | developers to .NET (and making the world more complex as a
       | result) it's grey-haired devs like myself that have stayed loyal.
        
       | wrs wrote:
       | I agree .NET is fantastic technology. I think a lot of the
       | hesitancy in adopting it is from the historical churn described
       | in the article. It's normal for languages/runtimes to have churn
       | in their features, performance, and library. .NET has that in
       | spades, plus continual churn in its _very reason for existence_.
       | The corporate and cultural forces behind .NET may be aligned with
       | your situation right now, but five years from now, who knows?
       | There's not yet historical evidence that it will remain stable.
        
         | bennysomething wrote:
         | The switch from full fat .nets support life cycle to the
         | current dot net cores totally confusing life cycle is currently
         | pissing me off and the higher ups in my firm. Which should be
         | worry for ms. I want stability , not breaking changes.
        
           | thrower123 wrote:
           | Yes, this. We will see how well support for the supposedly
           | LTS DotNet 6 actually is long term...
           | 
           | I'm not a great fan of how the whole dotnet open source
           | ecosystem has sped up to monthly and biweekly releases.
           | Official Microsoft packages are some of the worst.
        
         | spaetzleesser wrote:
         | That's the problem. They don't have a steady design approach.
         | They do something here, something there, then abandon the
         | first, then go back to it. Desktop is a complete mess. Core
         | looks quite good but who knows what they will do in a few
         | years?
        
       | EMM_386 wrote:
       | > (Note: there's some debate on whether it's 20 or 21 years, but
       | Microsoft's Professional Developers Conference in October, 2001
       | definitely already referenced .NET in production systems)
       | 
       | I can clear this one up.
       | 
       | I was lead on a .Net production system launched in August, 2001.
       | It's 21 years.
        
         | Yoric wrote:
         | Out of curiosity, did you also work on EMM386, as your username
         | implies?
        
       | formerly_proven wrote:
       | In terms of language C# always seemed to me like it was a
       | language that expects you to use a (the) IDE, much like Delphi.
       | Which is really unfortunate in my opinion, because I usually read
       | code outside an IDE and also spend more time strictly reading
       | code than writing.
        
       | DoctorOW wrote:
       | > Myth 2: It's Slower than Node/Python/Go/Rust
       | 
       | This feels disingenuous. The author uses this heading for proof
       | that ASP.net performs faster than similar frameworks in
       | Node/Python. I could be convinced C# is faster than Go, but
       | absolutely not for Rust. The simplicity modern C# provides (look
       | at those code samples) comes at the cost of runtime performance
       | optimizations.
        
         | pharmakom wrote:
         | Benchmarks would be required to prove it, but I could actually
         | see .NET outperforming Rust in a few scenarios. First, C# can
         | be written in a way that stack allocates almost everything
         | (much like Rust) and second, the runtime information and JIT
         | compilation may allow it to make better optimisations.
        
           | DoctorOW wrote:
           | Only if you're including compile time in the benchmarks.
           | Binary to binary, JIT is a great example of Rust having a
           | compile-time optimization that .NET implements at runtime.
        
             | Yoric wrote:
             | Well, some optimizations can only be implemented at
             | runtime, so comparing Rust and C# without knowing the
             | actual scenario doesn't seem to make much sense.
        
             | woodruffw wrote:
             | Optimizing compilers and JITs are difficult to compare
             | directly: JITs have optimization pressures (e.g., selecting
             | instructions/register slots as rapidly as possible) that
             | AOT compilers don't (and vice versa), and (similarly) tend
             | to have simpler IRs.
             | 
             | In general, even the best JIT is going to underperform an
             | AOT optimizing compiler for those reasons. Microbenchmarks
             | (and compiler quality) will always vary, but the macro
             | picture is difficult to change.
        
           | Yoric wrote:
           | I'm a big Rust fan but I fully expect that C# can beat Rust
           | in _some_ benchmarks and actually in _some_ useful scenarios.
           | 
           | However, claiming outright that .Net outperforms Rust feels
           | like an apple-to-petticoat comparison.
        
           | Nuzzerino wrote:
           | > the runtime information and JIT compilation may allow it to
           | make better optimisations
           | 
           | That's a very, very slim "may", at least before .NET 6 (I
           | don't keep up with .NET anymore.)
           | 
           | https://web.archive.org/web/20100627105951/http://blogs.msdn.
           | ..
        
           | pcwalton wrote:
           | > the runtime information and JIT compilation may allow it to
           | make better optimisations.
           | 
           | In practice this mostly means speculative devirtualization.
           | This is absolutely true for C++, which tends to use virtual
           | methods a lot, but Rust doesn't use virtual methods much.
           | Moreover, profile-guided optimization (PGO), which Rust
           | supports [1], allows the Rust compiler to take advantage of
           | these speculative sorts of optimizations just as .NET does.
           | 
           | Granted, PGO is annoying to set up compared to the .NET VM,
           | which "just works". PGO'd Rust is deployed in production,
           | though.
           | 
           | [1]: https://doc.rust-lang.org/rustc/profile-guided-
           | optimization....
        
         | Rochus wrote:
         | > _but absolutely not for Rust_
         | 
         | Right. Here are measurement results based on the Are-we-fast-
         | yet benchmark suite: https://github.com/rochus-
         | keller/Oberon/blob/master/testcase.... The version of the
         | benchmark translated to C and compiled with GCC or CLANG -O2
         | runs about twice as fast as the CLI/.NET version. Rust's
         | performance is close to C's. And before you say that Mono is
         | slower than the CoreCLR have a look at these measurements:
         | https://www.quora.com/Is-the-Mono-CLR-really-slower-than-
         | Cor....
        
         | mhh__ wrote:
         | JITs precisely _can_ provide _runtime_ performance
         | optimizations.
         | 
         | What makes C#/Rust special? If you can't name anything in rust
         | that would actually effect the dataflow analysis then you may
         | need to reconsider.
        
           | FridgeSeal wrote:
           | Rust having one of the most sophisticated optimising compiler
           | backends? And a whole suite of language design choices that
           | enable fast, correct code?
        
             | mhh__ wrote:
             | The parent comment is clearly talking about language design
             | rather than the backend.
             | 
             | I say this because I often see Rust people say isn't a
             | great that rust can do xyz and then I look into it and it's
             | actually just basic dataflow analysis that any compiler
             | does or just LLVM being clever.
        
       | ourmandave wrote:
       | The actual title is: _6 .NET Myths Dispelled -- Celebrating 21
       | Years of .NET_
       | 
       | And they forgot 2...
       | 
       | Myth 7: The .NET branding dept sucks.
       | 
       | Myth 8: The .NET desktop strategy has sucked since Build 2011.
       | 
       | Oh wait, both of those are still true.
        
       | alexklark wrote:
       | Author should submit it to ms propaganda/evangelist department to
       | get a MVP medal for best bs of the month. Of course MS bs
       | regarding .NOT is nothing new. It was windows only for 21 years
       | and marketed as portable/high speed/modern/backward compartible
       | all that time. All that time it was a cherry picked lie. For the
       | last 6 years they not even mange to offer GUI library. Try to use
       | Winforms. You can't? Too bad, linux is just for servers anyway,
       | right? Go get Xamarin trash and suffer. "We are on journey, busy
       | with our foundations/pr so fk off." The right answer was not
       | changed for 10 years: - never use ms tech for web, or you be
       | vendor locked and ripped off - ms technologies in core not
       | changed since 00s, it is same old st in a layers of chocolate. As
       | soon as you get inside, you puke. - never trust ms or you be
       | vendor locked and end up with inferior legacy technologies,
       | without reach to support and with huge tech debt and eventually
       | need to just throw away everything you build - remember, facebook
       | and google not using ms, your grandma do
        
         | achtung82 wrote:
         | If the language and framework has been changing isnt it a good
         | idea to inform about these things that used to be true but no
         | longer is.
         | 
         | "never use ms tech for web, or you be vendor locked and ripped
         | off"
         | 
         | How exactly do you mean this, .Net can be run on most
         | platforms. Or could it be that you didnt read the article since
         | you assumed it was propaganda?
        
           | omginternets wrote:
           | The charitable interpretation of the parent post is that the
           | .NET team has lost all credibility, and that one should not
           | trust them to make developer-friendly decisions.
           | 
           | I don't know whether or not that statement is true, but I
           | think this is the point worth discussing.
        
             | tester756 wrote:
             | >but I think this is the point worth discussing.
             | 
             | then somebody has to say some some specific stuff instead
             | of "ms will lock you"
        
       | FridgeSeal wrote:
       | > .NET isn't open source friendly
       | 
       | The language runtime might technically be open source, but it's
       | got a huge number of closed-source packages and the ecosystem
       | appears to be only begrudgingly open source.
       | 
       | > It's slower than Node/Python/Go/Rust
       | 
       | One of 2 of these things, aren't like the others. I'd believe
       | modern .net can outpace Python, but matching or outpacing Rust is
       | something I'd have a hard time believing, especially in the "vast
       | majority of code" sense-I'm aware that .net can be written to
       | stack allocate everything. I'm also aware that basically no .net
       | code I've ever seen in business world has ever done that
       | (precluding games here, because I've not worked with them).
       | 
       | > It's for boomer enterprise development
       | 
       | Yes. Uncharitable presentation and framing, but yes. Every single
       | place I've worked at that has used .Net has had the same attitude
       | and approach to solving problems and writing code. Use Kafka for
       | our events like every other company in industry? Nah, use some
       | bizarre MS thing that nobody outside of .Net has heard of or can
       | use. Use websockees or SSE? Nah, use some bizarre .Net version
       | instead. Use Postgres because it's more than good enough and
       | other teams might need to use the database? Nah MSSQL, and all
       | the tables are named and optimised according to EntityFramework
       | and if you have to suffer through ODBC issues that's a you
       | problem!
       | 
       | Never mind the obtuse naming and the dogged insistence on
       | dependency injection at every possible turn.
       | 
       | Am I not a fan of .Net? Correct. Is it because every time I've
       | had to touch it, it's a painful and frustrating experience.
        
         | radicalbyte wrote:
         | You know that Rx in .Net kind of inspired all of the popular
         | reactive libraries/frameworks, right?
         | 
         | Other than that: if you go to a .Net shop who want Microsoft
         | Certified Developers and you expect anything than low quality-
         | stay-on-the-Enterprise-support-contract-rails then that's the
         | problem.
         | 
         | > Nah MSSQL, and all the tables are named and optimised
         | according to EntityFramework and if you have to suffer through
         | ODBC issues that's a you problem!
         | 
         | That's not in any way true - it's an ORM and it can handle any
         | database naming scheme you happen to have. I still wouldn't use
         | it - ORMs in general are a bad idea outside of a couple of use-
         | cases (i.e. CRUD-heavy systems).
        
       | ramesh31 wrote:
       | Unfortunately Nuget package management is abysmal, and a
       | development environment lives and dies by that nowadays. There's
       | also the legacy reliance on XML. It's easy to forget that the
       | reason Node took off exponentially when it did is not really
       | because it was that great itself, but because NPM (and its' small
       | package philosophy) was a bit of a revolution in package
       | management that led to network effects of adoption.
        
       | cglan wrote:
       | Gonna be honest, .NET seems to have a weird cult following on
       | here and Reddit but I find the naming to be absolutely atrocious
       | and I hate developing with it. Everything is .Net including .net
       | classic but not everything is compatible making documentation a
       | huge pain to find. It's also ridiculously over complicated and
       | enterprisy with a lot of heavy weight boilerplate that reminds me
       | of Java. It also copies a lot of the mistakes of the spring
       | framework where you'll have side effects or code paths that occur
       | that aren't really able to be found with a debugger. The language
       | itself is fine but the framework around it is just repeating all
       | the same mistakes of everything else
       | 
       | One of the reasons I love go is that everything seems to be
       | explicit. Notice something occurring? Well chances are you can
       | set a breakpoint and trace what's happening
        
         | procinct wrote:
         | I definitely don't find modern .NET (ie .NET Core) to be overly
         | enterprisy or boilerplated at all. Certainly nothing like .NET
         | framework or Java.
        
           | bluefirebrand wrote:
           | Gotta admit GP has a point about naming though.
           | 
           | Search for info on .NET and you will find stuff on ASP.NET,
           | .NET Framework, .NET Core at the very least. Probably more.
           | 
           | You have to really know what you are looking for and that's
           | hard sometimes because everything is just .NET
        
         | achtung82 wrote:
         | The thing i see a lot of people bringing up as the large
         | problem with .Net is naming and branding. I could agree with
         | those sentiments but dont really how those are serious
         | criticisms. Thats like saying i hate Java cause i prefer tea.
         | 
         | Anyway if you hate developing in .Net dont do it but I
         | personally find it a lot more enjoyable than other languages
         | ive worked with.
        
         | wvenable wrote:
         | I can't agree with this assessment. I'm curious as to what
         | environment you are comparing it to?
        
         | nick_ wrote:
         | A list of the top ten weird cult followings on HN and Reddit
         | would not include .NET
        
         | tester756 wrote:
         | >It's also ridiculously over complicated and enterprisy
         | 
         | What does it mean? dependency injection?
        
           | radicalbyte wrote:
           | There are some older libraries which are horrible enterprise-
           | ware: WCF (Windows Communication Foundation, think SOAP) and
           | older Entity Frameworks in particular.
           | 
           | From the tone of the OP I would assume that things such as
           | encouraging good engineering practises such as good interface
           | design and using appropriately sized units of code are also
           | "problems" with .Net. You hear that a lot from inexperienced
           | developers.
           | 
           | The thing is - the modern framework is far nicer and has
           | largely avoided the problem. Even to the point that I prefer
           | occasionally having to deal with some of the ugly enterprise
           | libraries to the constant hunting down of broken
           | dependencies, vague runtime bugs or massive framework churn
           | you see in the Python/Javascript world. Or having an overly
           | verbose and ugly language like Go or Java.
        
       | spaetzleesser wrote:
       | I have worked with .NET for a long time and recently did some
       | work with Java, node and python. .NET has a lot going for it but
       | i feel MS is making things more complicated than they have to be.
       | When I need to achieve something a little off the beaten path in
       | the non .NET technologies this is often pretty straightforward to
       | achieve whereas in .NET I have to find some obscure interface and
       | overrides to implement and then deal with weird side effects. I
       | think .NET has become too big for its own good to be maintained
       | by one party. The documentation also has a lot of volume but
       | almost no structure. When .NET started out it was pretty coherent
       | but in the last few years it felt very disjointed without a
       | central design philosophy. Don't even mention desktop development
       | which is a complete mess since Windows 8.
       | 
       | Maybe I am too negative on .NET but personally find the open
       | source alternatives easier to work with and more fun.
        
         | R0b0t1 wrote:
         | The .NET frameworks (blazor, etc) are too complicated. Peak
         | FizzBuzzEnterpriseEdition there.
         | 
         | The interop layer than you have to go through to do a lot of
         | stuff is actually quite tame. It just needs more time on Linux.
        
           | userbinator wrote:
           | That's the normal Java culture, which is not surprising given
           | that MS created .NET as a competitor to Java.
        
           | tester756 wrote:
           | >The interop layer than you have to go through to do a lot of
           | stuff is actually quite tame. It just needs more time on
           | Linux.
           | 
           | What do you mean?
           | 
           | I have software on prod on Linux for years and the only
           | problem I had was lack of some fonts installed that made some
           | problem when it comes to pdf generation
        
             | R0b0t1 wrote:
             | Binding to C/C++ libraries or other system libraries is not
             | something that's well documented, officially. On Windows
             | there's a lot of 3rd party effort that is easily
             | searchable. But for a long time the interop layer was not
             | (and still may not be?) working on Linux.
             | 
             | The first iterations of .NET were _just_ for webapps. You
             | could only work with and call .NET code, the only functions
             | provided were basic IO and network.
        
       | johndfsgdgdfg wrote:
       | .NET is an amazing tech built by MS. I wish more people would use
       | .NET ecosystem instead of Go, which is pushed by Google so Google
       | can make more money.
        
         | bayindirh wrote:
         | > .NET is an amazing tech built by MS. I wish more people would
         | use .NET ecosystem instead of Go...
         | 
         | After years of witnessing or being on the receiving end of the
         | things Microsoft did, I'd rather not develop with .NET. Same
         | goes for Google's Go. Rather I'd happily use C++ / Python /
         | Rust / Java / Perl, and never look back.
         | 
         | I think it's bitter to be associated with acts done to
         | undermine and stifle competition for whatever it takes rather
         | than being a tech company known with good products. Yes, I pay
         | for an Office license and like their hardware, but I can't
         | forget what they've done over the years.
        
         | phillipcarter wrote:
         | .NET exists because it is used by Microsoft to make Microsoft
         | more money. That's literally what a platform play is. What is
         | bad about Google doing this with Go?
        
         | hughrr wrote:
         | I have used both from day one. I prefer Go. 900% less faffery
         | with it.
        
         | steve_taylor wrote:
         | How much does Google charge for Go?
        
           | DoctorOW wrote:
           | I disagree with the point that Go is a big money maker for
           | Google. I assume the implication is that Go helps make sales
           | for Google Cloud the same way .Net acceptance leads to Azure
           | sales. That said, in my experience this isn't true. Some of
           | the biggest adopters of Go (Uber, Netflix, Twitch) are AWS
           | based. The real profitable part of Go for Google is the
           | scalability and efficiency of the language for Google
           | projects but that's not a very effective argument to switch
           | away from Go.
        
         | qbasic_forever wrote:
         | How is Google making money off of golang?
         | 
         | Are they selling tools for it? Not that I see.
         | 
         | Are they selling the compiler? Nope (they don't even 'own' it,
         | it's open source)
         | 
         | You really need to explain your thought process here because it
         | doesn't sound based in reality.
        
       | renox wrote:
       | So this article claims that .Net is portable, what about GUIs?
       | 
       | I doubt very much that this is the case..
        
       | lucidone wrote:
       | I used .NET Core for a backend API relatively recently (3.1) with
       | no background in .NET prior (mostly javascript/typescript, php,
       | and ruby). I found it incredibly productive and to be an
       | enjoyable developer experience. Entity framework is one of the
       | best ORMs I've ever worked with. Solutions and projects took some
       | getting used to but I like it in retrospect. I now use IntelliJ
       | products as a consequence of having used Rider for that project
       | (developing on a mac) and enjoying the experience. C# as a
       | language is now one of my favourites. I find it hard to convince
       | colleagues and peers to give it a chance (mostly ruby and
       | javascript devs) which is a shame.
        
         | manigandham wrote:
         | > _" incredibly productive"_
         | 
         | That's the best summary of the .NET stack, unfortunately it
         | requires first-hand experience to figure it out.
        
       | oconnor663 wrote:
       | > Myth 2: It's Slower than Node/Python/Go/Rust
       | 
       | I guess apples-to-apples benchmarks are so hard to agree on that
       | _any_ statement of the form  "A is slower than B" is always to
       | some degree a myth. If that's the author's position, fair enough.
       | But if we actually want to make comparisons, "C# is faster than
       | Rust" is a bold claim.
        
         | Yoric wrote:
         | ...especially when in two out of the author's three screen
         | captures, C# is actually shown as slower than Rust.
         | 
         | I didn't spent time to investigate further because I feel that
         | this headline is not really useful in the first place.
        
         | phillipcarter wrote:
         | The reason why it's a myth worth dispelling now is that The
         | (legacy) .NET Framework, which used to be ".NET" back in the
         | day, actually was hilariously slow for any kind of web or
         | networking work. It had decent CPU crunching power, but also
         | only on Windows machines.
         | 
         | Comparisons of benchmarks with C# vs. Rust or whatever are
         | unproductive and it's a shame that the article focuses on that.
         | The reality is that you can write C# or F# code today, focus on
         | solving your problem instead of performance, and have it handle
         | a production workload admirably well. That used to not be true
         | circa ~2010. Thankfully it is true now :)
        
           | bastardoperator wrote:
           | This is my experience with dotnet. Considerable amount of
           | legacy code coupled with different web frameworks along the
           | way. While the app was slow, I found the amount of time it
           | took to make changes to be the unbearable part, mostly a
           | whack a mole situation. Maybe I worked with some bad
           | developers, but they all acted as if dotnet was the best
           | thing ever with constant mentions of dependency injection and
           | blaming the GAC for problems they clearly created..
        
           | hughrr wrote:
           | I disagree. It was pretty good even back in 2005. There were
           | a couple of very large high traffic sites I ran on it back
           | then.
           | 
           | I wouldn't use it now because the big cost is always humans
           | in a project and anything .Net turns into a damage amplifier
           | because of the amount of fettling and dealing with churn you
           | have to do to get anything done. Even with .net 6.
        
         | userbinator wrote:
         | That reminds me of all the "Java is not slow" articles that
         | came out back when Java was more popular.
         | 
         | If it really wasn't slow, why would they have to defend it? We
         | don't see "C is not slow" articles.
        
       | stakkur wrote:
       | The author makes a few good points (mostly about performance),
       | but the 'myths' about open source friendly, enterprise
       | development, and cost are disingenuous at best, and just plain
       | wrong at worst.
       | 
       | I work in a large corporate environment, and .NET _is expensive_.
       | Nobody just  'uses the Community Edition', because there are pre-
       | established licensing arrangements and costs. I've seen the
       | costs.
       | 
       | .NET, whether it's good or not, is slowly going the way of the
       | dodo. What keeps it around is the corporate lock-in they've
       | established for the Microsoft stack, and that's a hard thing to
       | crack.
        
       ___________________________________________________________________
       (page generated 2022-03-12 23:00 UTC)