17 ms·
.NET 6 Preview 5
- eatonphil 5y agoIt's a great time to play with .NET on Linux/Mac these days. .NET Core (which was for not-just-Windows) became just .NET in .NET 5. F# and C# are both very easy to use. You can even get a single static binary release that will work on platforms without .NET libraries. Check out the Makefile and project file in this repo if you'd like an example: https://github.com/eatonphil/dbcore/blob/master/dbcore.fsproj https://github.com/eatonphil/dbcore/blob/master/dbcore.fspro....
- evo_9 5y agoTrue as long as you're not on an M1 Mac; right now it's a little bit of a mess since .NET 5.0 isn't fully supported and .NET 6.0 isn't quite ready for primetime (this release gets us a ton closer though). It's still doable, but with limitations; that said I still love my m1 air and .NET 6 will make it that much better/easier to do dev on it when it drops this Fall. But yeah, it's a great time for sure, just good to keep that in mind since you also can't run any of MS's (or JetBrains) IDE's (or MS SQL) on a VM in Win10 ARM. Win10ARM VM does smoke though so hopefully they releases all that on ARM, that would another nice option.
- abdusco 5y agoJetBrains has released a preview version of Rider that works reasonably well on M1. It is still buggy, but editor & IDE experience is good enough. https://rider-support.jetbrains.com/hc/en-us/articles/4401925025810 https://rider-support.jetbrains.com/hc/en-us/articles/440192...
- evo_9 5y agoIt's not an IDE issue; .Net 5.0 doesn't fully run on M1, aka you can't connect to the debugger and step into the code, among other things. VS Code is native on M1, and Visual Studio for Mac also runs via Rosetta2 (but I don't run it). Did not know that about Rider, thx I'll def check it out.
- abdusco 5y agoI can run and debug .NET 5 apps (on Rosetta) using both VS Code & JetBrains Rider. You might have to update .NET 5 SDK to a more recent version.
- immutology 5y agoI run and develop on the x64 versions of dotnet core 3.1 and dotnet 5 on my M1 Macbook Air every day and don't have problems. It runs via Rosetta 2 translation, and probably isn't as fast or memory efficient as it could be, but I don't have major issues and it runs a lot faster and keeps my mac cooler than if I try to run in Windows on ARM in Parallels. I use VS for Mac 2019 (x64) and VS Code (arm64) for development work on a near daily basis. That said, I tried installing the arm64 dotnet 6 preview and it broke the x64 versions I had installed and although I could debug/attach in VS Code, I could not get it to debug in VS for Mac 2019. From what I understand, the issue is that the dotnet binary for x64 got replaced with the arm64 one. There is only one on the system at a time and the arm64 version doesn't know how to work with the x64 architecture sdks/runtime. There is some discussion and links to related issues in this GH issue: https://github.com/dotnet/sdk/issues/16896 https://github.com/dotnet/sdk/issues/16896 Regarding SQL, I use the Docker Azure SQL Edge arm64 image and it works okay for most thing but doesn't support some of the more advanced features like full text search or spatial types. For Database Projects (dacpac), Azure Data Studio with the Database Projects extension works okay for basic editing and deployment. However, it's not nearly as complete or refined as the database project edit/deploy experience in the Windows version of VS 2019. As far as I can tell it doesn't create new refactorlog entries for renamed objects and I can't figure out how to create a new deployment profile so I have to select the database connection every time I deploy. I have been running the x64 build of dotnet 6 preview 4 and now preview 5 for a while and have not many issues. One thing that happened is that it broke the dacpac deploy in Azure Data Studio but there was a relatively simple workaround -- added a configuration setting in Azure Data Studio to override the dotnet SDK path to point to a folder where I had put dotnet 5.
- gameswithgo 5y agoIf it has been a few years since you looked at C# or F#, it may be worth a look again now. Lots and lots of optimizations have been added in the last 5 years, and you can even use SIMD intrinsics directly now. By some measures C# is now the best overall performing garbage collected language (Such as The Benchmark Game)
- Someone1234 5y agoOne of the biggest things was the addition of Span<T> and Memory<T>, and their usage in underlying types within the .Net framework. While C# always had the ability to use raw pointers, these two types allow you similar performance characteristics without unsafe blocks (and frankly are near idiot-proof instead of being a giant foot-gun with pointers to managed types). https://docs.microsoft.com/en-us/dotnet/standard/memory-and-spans/memory-t-usage-guidelines https://docs.microsoft.com/en-us/dotnet/standard/memory-and-...
- Thaxll 5y ago"By some measures" By some other measure it's not, out the three fastest: Java/C#/Go they're all pretty much as fast.
- manigandham 5y agoAdd in the massive standard library, project types, and overall productivity and it's the best platform available now. I'm working in production projects across all 3 languages now and Java and Go are way behind when it comes to producing a polished product as quickly as possible.
- Thaxll 5y agoC# is not even close to Java in term of libraries.
- NicoJuicy 5y agoWhich are missing? :) There are currently 244,641 libraries through nuget https://www.nuget.org/packages https://www.nuget.org/packages Ps. You can use libraries from f#, c# and VB.net. So as a .net developer, your statement doesn't make any sense. You could have mentioned the different frameworks. But there is interop through the CLR between languages.
- hansor 5y agoStill no any sane official library to support GUI in .NET CORE...
- AbuAssar 5y agoDid you try uno?
- aspaviento 5y agoThey are working on MAUI https://docs.microsoft.com/en-us/dotnet/maui/what-is-maui https://docs.microsoft.com/en-us/dotnet/maui/what-is-maui
- SideburnsOfDoom 5y agoMAUI (.NET Multi-platform App UI) is the new thing in cross platform UIs. https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/ https://devblogs.microsoft.com/dotnet/introducing-net-multi-... Unfortunately I don't know much about it yet, it's not my area. Is it not sane?
- MeinBlutIstBlau 5y agoI've never heard of it but I'll keep it on my radar. I love the idea of having a universal GUI using C#. I haven't done much android development, but I only know that it would be a tad less tedious if I didn't have to deal with android studio.
- oaiey 5y agoMaui is Xamarin.Forms. It is undergoing renovation to compete with React Native, Flutter and the self rendered stacks.
- egeozcan 5y agoHave a look at this: https://docs.microsoft.com/en-us/dotnet/maui/ https://docs.microsoft.com/en-us/dotnet/maui/ Example: https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/#mvu https://devblogs.microsoft.com/dotnet/introducing-net-multi-...
- tintan 5y agoAs a java developer for years it is amazing to see .net basically become the best cross platform framework.
- u678u 5y agoI moved from C# to Java project. I preferred C# Syntax but amazed by the number of Java libraries. However I've found Java world full of neck-beard developers that make everything complicated. Spring is toxic - the learning curve is steep and half the devs dont understand it well enough which leaves a huge mess. Dotnet Developers seem much more pragmatic. I wish I could go back. EDIT - I forgot about how bad Java GC is. Still with Java 16 a ParallelOldGC Full GC is taking 30 seconds on a big server.
- sz4kerto 5y agoToxic? Isn't this word too strong maybe? Spring provides consistent patterns and solutions for many things and their solutions is usually good (vary between mediocre to great). Learning curve is steep-ish when you start but quite a smooth ride later. It's maintained, reliable, not buggy.
- rcarmo 5y agoSpring is an acquired taste, and many people don't like it because they don't know the right patterns, so I agree with you and think the parent is exaggerating.
- u678u 5y agoYou're both right. I agree Spring Boot is great if you know it well and are knocking out micro-services. If you have a ball of mud like my current project with mixes of XML config, Attribute config and people rolling their own stuff it really isn't adding any value.
- eatonphil 5y agoI don't code very much Java or C#. I've tried to get into Spring because I wanted to save time but it was too complicated for my patience. I also evaluated ASP.NET and it seemed significantly more convoluted. There is a ton of documentation for both Spring and ASP.NET but both are so complicated and specific to investing in exact ways of modelling users/auth/whatnot that they are both super hard to get into as a hobbiest outsider. I like both languages and they both have good microservice libraries and general ecosystem. I just don't think it's worth saying Spring is complex without talking about ASP.NET.
- Thaxll 5y agoThe main issue with C# is that it's getting very bloated, they're adding major features every release, good luck keeping up with that.
- mikece 5y agoThe goal is to know more and more about less and less...
- manigandham 5y agoAs opposed to all the other languages that also add features with every release? You don't need to use any of the new C# features. You can still build and run C# 1.0 code today.
- bmitc 5y agoTake a look at F#. It's a superior language and doesn't add new features like C# does (which is mainly stealing from F# anyway). Also, Elixir is a language that is very stable from release to release.
- runevault 5y agoI keep hoping they'll finally steal type providers for c#, though you could argue source generators are at least a first step.
- refactor_master 5y agoCan it really be called “bloat” if the features are basically invisible unless you explicitly compile an app with them? That’s like saying the English language has accumulated too many new words, and that impacts your speech.
- Thaxll 5y agoYes because then people have 3 different way of doing the same thing. You have that new guy that comes in and whant to rewrite everything with the new immutable feature.
- thrwawaynetcor 5y agoI am a C# and ASP.NET Core developer. You should not pick up this stack for a startup or for any operation that involves less than three full-time backend developers. Iteration is so slow because all the bad OOPy practices and patterns from the 90s are still alive. In just a month our intern made a web app using Django/Python and InfluxDb that would have taken us two months to implement. It's sad because modern C# is an amazing multi-paradigm language. But the .Net ecosystem insists on partying like it's 1999.
- zerr 5y agoHow about using alternative web frameworks? e.g. Nancy, coupled with similar alternative ORM, etc...
- sbelskie 5y agoCarter is probably a better choice than Nancy nowadays, but in any case the new minimal api features coming in 6 look to provide a really excellent way to build elegant web APIs without large framework overhead.
- philliphaydon 5y agoWe kinda stopped developing Nancy when .NET core came out because MVC became more opt in rather than opt out, and was more performant. (Prior to .NET Core, Nancy could handle more RPS over .NET Framework mvc) Master Jonathan Channon (and contributors) have done an awesome job with carter! It’s definitely an awesome alternative. And I think with the stuff David Fowler has been working on to make hello world easier it will help make carter better too.
- vyrotek 5y agoI'm a C# and ASP.NET developer. You should definitely use this stack for a startup or any operation with less than three full-time developers. I've literally done this at three enterprise scale startups with just three devs (including myself). Working on the 3rd startup right now. The productivity of .NET, Visual Studio, and Azure is amazing.
- aninteger 5y agoThe only problem with .NET is that the best tooling is quite expensive. Visual Studio with ReSharper or JetBrains Rider are both up there in price and MonoDevelop didn't work with .net core last I tried (2 years ago). That kind of leaves you with VSCode or a plain old editor (vim/emacs), but you really don't want to write C# code in a basic editor.
- zip1234 5y ago$500/yr is expensive for a professional developer?
- lp0_on_fire 5y agoIt's not outrageous but it's not a trivial expensive, either.
- zip1234 5y agoIt's also free if your organization makes less than $1M.
- sumtechguy 5y agoIt really depends on your 'license' with them. For me as an individual it is basically 'free'. As the community edition is basically pro in all but name. But for a corp env it is like you say it is not 'trivial expensive'. They mowed down everyone else because it was that choice for a long time. You were talking 20-30k per year per dev in the 90s for some stacks. 150-500 per year was a bargain by that metric. But now there are 5 other IDEs you can pick from that are either cheaper or free. In some cases for some langs the cheaper ones are better in all respects. In some cases they are charging anywhere from 500-9k per year depending on how you buy it. Why would I start a greenfield project with VS in that sort of env, unless I was already a 'MS shop'? VS is nice, and one of the better IDEs but by comparison it is wildly overpriced.
- CyanLite2 5y ago
- mhoad 5y agoI don't have any .NET background or anything even particularly MS specific. However, I spent most of 2020 just playing tourist between different development / devops communities to get a feel for what are the main ideas, challenges, core truths etc in each. I looked into Java, Ruby, C#, Dart, Kubernetes, Bazel, TypeScript, Flutter, Node, lots of CNCF stuff etc. I have a bunch of interesting observations that I should probably write down somewhere at some point because I haven't seen people talk about them much yet. However, one thing that kept coming up repeatedly is Microsoft is actually doing a much better job of thinking "beyond Windows" than I would have anticipated otherwise. .NET is making its way into front end web apps now with Blazor, Microsoft has also just recently released something that they 100% do not market this way but I look at as almost a successor to .NET in some ways. The big difference is that it's language agnostic and it's entirely built around the concept of "distributed" applications. That came out of the Azure team I think and was based on everything they had learned about writing distributed / cloud native apps in the last 5-10 years. The project is called Dapr and was one of the cooler things I saw in 2020.
- manigandham 5y agoLink to Dapr: https://dapr.io/ https://dapr.io/
- mattmanser 5y agoGiven their history of abandoning front-end frameworks, I wouldn't put too much faith into Blazor. And the Azure team is, frankly, grossly incompetent. I've never used a worse application than the Azure dashboards. It is by far the absolute worst piece of software I have ever had to endure. Pathetically slow, shockingly bad UX and incredibly inconsistent.
- manigandham 5y agoWhat did they abandon? Silverlight? That went the same way as Flash because plugins were killed by browsers and mobile. Blazor is much different and a core part of the web stack. Considering you can still run WebForms apps written in C# 2.0 today, support and backwards compatibility is actually a strength of this ecosystem. But yes the Azure dashboard isn't great, however that's not relevant to .NET.
- jmkni 5y agoI'm a long time dotnet guy, but I've been working with Swift/XCode recently. There are definitely some things I like (completions in particular), but man do I miss the dotnet world. I recently had an issue where I was using a third party closed source library in Swift. A particular function I was calling was sometimes bombing out, and because it wasn't marked as a throwable function, I couldn't put a do/catch around it. As a result, when it did, my app would just crash and there was nothing I could do about it. I even asked on StackOverflow and was just told that this function can't be erroring out, even though it was lol I've worked with other languages/frameworks as well over time and nothing is as nice to work with as dotnet.
- kristianp 5y agoWhat library and what function? Chances are, the developer will pop up on hacker news and help you out!
- solarkraft 5y agoI wonder when whey will make the debugger work with non-proprietary versions of VS Code. I am not joking, I wish I was. The official C# debugger is not only proprietary, it’s also not licensed for VS Code versions compiled from source. The rest looks cool, hopes are high for MAUI. But really man, forcing me to jump through a bunch of hoops just to get a (somewhat) working debugger ... That kind of a move is a remnant of the old Microsoft that absolutely needs to die for the new Microsoft to live on.
- qntmfred 5y agojust out of curiosity, what's your use case for using a version of VS Code compiled from source?
- gostsamo 5y agoNot gp, but think about it that way: what makes necessary for VSCode to have a proprietary version and key plugins? In addition, I'm not even sure if the telemetry on VS Code can be turned off. I think "yes", but never bothered checking while VS Codium was available.
- solarkraft 5y agoUsing a program which is advertised as non-proprietary as such. Not trusting Microsoft to be nice. Pretty important in case they fall back into old Microsoft‘s Embrace, Extend, Extinguish hab... oh, look ...
- cyral 5y agoDon't know how JetBrains did it but Rider's (their C# IDE) debugger works excellently. Haven't used VisualStudio for years actually.
- solarkraft 5y agoAs far as I know they have (somewhat, they do use MSBuild) completely developed their own .NET tooling ecosystem (ReSharper being the most prominent example). And it shows that they actually know what they’re doing. I don’t know what it is with Microsoft in particular, but they have really mastered the art of building user hostile applications. God, Visual Studio is a mess. I envy you.
- kemonocode 5y agoHere's hoping .NET can some day shake off its Windows exclusivity stigma, as I've been writing pretty interoperable C# code for the past 3-4 years or so, and it's been a joy. Night and day compared to Java, at least. I'll admit it takes some time to get started, but it's smooth sailing once you get past the initial hurdles of setting up your project, understanding some idiosyncrasies when it comes to ASP.NET/Web API/Entity Framework if you're going that route for your backend and such. And now with Blazor, I can even work on the frontend and touch Javascript as little as possible.
- HeyLaughingBoy 5y agoI know. The first time I deployed a .NET application to a box running Linux it was like a great disturbance in the Force :-)
- rtomanek 5y ago> interoperable C# code for the past 3-4 years or so, and it's been a joy. Night and day compared to Java, at least. Can you give an example of this interoperability, please? Also -- what was the difference compared to Java that you noticed?
- cameronh90 5y agoIt's interoperable by default, unless you add a Windows-specific library like WinForms.
- pantalaimon 5y agoeh, Windows Forms is the default GUI library, this means relying on third party libraries if you want to write cross-platform desktop apps.
- WorldMaker 5y agoThere isn't really a "default" GUI library at this point. WinForms and WPF are both rather equal in support. (Arguably WPF gets far more updates than WinForms, most months.) MAUI (in .NET 6+) will be a first party library for some types of cross-platform desktop apps.
- xvilka 5y agoThere is ongoing work[1] on porting it also on BSD systems. I hope it will help to make it even more portable in the long run. See also other FreeBSD issues[2] that need to be solved for complete support. Or the same for NetBSD[3]. [1] https://github.com/dotnet/runtime/issues/14537 https://github.com/dotnet/runtime/issues/14537 [2] https://github.com/dotnet/runtime/labels/os-freebsd https://github.com/dotnet/runtime/labels/os-freebsd [3] https://github.com/dotnet/runtime/labels/os-netbsd https://github.com/dotnet/runtime/labels/os-netbsd
- ramshanker 5y agoA perspective from a non-CS engineer. Don't intend to undermine the progress being made. Nevertheless here I am, migrating my dot net core 3.0 application back to Dot Net Framework 4.5.1 because I need my applications to run in all those Windows 8.1 (enterprise-internal) PCs without needing admin privileges to install dot net runtime. Since 4.5.1 runtime comes pre-installed with Win 8.1. So that is the version I target for all my new inhouse civil-engineering applications. There isn't much point bloating the application by 80+ MB just to make it self contained executable of dot net core version. After all, I need civil engineering to speedup, not fighting latest framework versions.
- selimthegrim 5y agoHave you considered Blockpad (http://blockpad.net http://blockpad.net) as a platform for your applications?
- fuzzy2 5y agoIf using the self-contained deployment isn't an option then this is the correct solution. I don't see what the problem is. You can't always use the latest and greatest. I often had to use .NET 4.0 because it had to run on some way outdated systems where client IT was refusing to install updates. Bet they got hacked by now, as they should be. ;-)
- runevault 5y agoWhy not use .Net core... 3.1 I think? You can build a standalone exe that doesn't require the runtime on the end user machine. https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file https://docs.microsoft.com/en-us/dotnet/core/deploying/singl...
- gtsteve 5y agoYou might not need to do this. You can roll a fully self-contained distribution that will work for this OS with options to dotnet publish. Unless you're sending your software to Mars, I say that saving 80mb of package bloat is not worth the engineering time especially for an OS that will be EOL in less than 2 years.
- tresvert 5y agoThis is a great time to start testing the new features of .NET. Anyways, I can't get enough creating new desktop apps on win forms.
- lbriner 5y agoThe difficulty for me as a FT .Net Dev is the pace of development is hurting quality. There are many edge cases and bugs that get introduced as things change from nuget to dotnet pack, from netstandard to netcore, from net core 3.1 to net 5. Each time, something is breaking which is more often than not "won't fix, just use .net 5". Net 5 isn't even finished and they are already previewing 6? It is usually something like under .net 3.1, the build was fine and then under .net 5, an error happens, "oh yeah, you can workaround that by modifying your project file". Or you try and build in a .net 5 nuget package which means you can also reference an older netstandard 2 package that the developer has decided doesn't need updating because it hasn't changed.
- gregmac 5y agoI agree, though I wouldn't say it's the pace of development so much as the change in approach. .NET Standard made sense as a transition plan, but then was effectively abandoned. I understand that the focus went to .NET 5/6, but the effort is incomplete! Using a .NET Standard 2.0 project in .NET Framework sometimes works, and sometimes results in obscure build errors -- where you then are diagnosing why you are getting the wrong versions or errors loading packages System.Net.Http.Formatting or System.Buffers. I think there's also a bunch of hacks underlying a bunch of this stuff -- for example there will be a nuget package with version 4.3.0 that contains a .NET assembly with version 4.1.1.3 in a .dll with file version 4.0.0.0 -- and it's absolutely frustrating and infuriating. In theory you can also create a project that multi-targets .NET framework and .NET core, but in practice, while I've got this to work, it's an adventure every time and most often I just give up as it's not worth the time-sink. It kind of seems like the official migration path is just "stop everything, port to .NET 5 and you'll be good". But that's not really practical. Indeed, my experience on pure .NET Core (3.1) or .NET 5 has been very good thus far -- including easily building cross-platform native apps. It's just that the reality is there's still a lot of .NET Framework code. The other big challenge for us is in delivering apps that run on customer systems. Doing the switch to .NET Core/5/6 means we have to decide on: increasing from shipping a 5MB to a 45MB app (runtime included); requiring .NET runtime is installed (and handling auto-update failures when it's not); modifying the installer to install if needed (again handling failures). This is all tons of work, and a tough sell when we have a multi-year backlog of bugs and feature requests it has to compete with.
- mkr-hn 5y agoSo what do people generally use .NET and adjacent languages for? Is it pretty much the same use cases as Java?
- oaiey 5y agoYes. But better .. okay kidding. It is the same use case. c# is slightly more modern and lib space is cleaned up. I do not know your age, but long time ago Microsoft messed with Java and got into huge legal troubles. As a consequence they developed .NET with the language designer who did before TurboPascal and afterwards Typescript. It is a bit more optimized for productivity but so are many other languages nowadays.
- hooploop123 5y agoWhen I first started development work (my background was in engineering math), couple of my colleague mocked me for liking c# and .net. They responded by saying, “I don’t want to reply to that because I don’t want to say anything insulting”. This was in regard to good backend language for crud web server with somewhat complex business logic. Responder worked in my team, and I was their manager. It really lowered my confidence, as I had comparatively less dev exp than him. It is good to see HN also sees c# as solid and good language.
- hu3 5y agoThat was very unprofessional and disrespectful from them. Technologies should be debated by weighting their pros and cons, not with insults.
- Shadonototro 5y agothe problem i always had with dotnet was - why dotnet when java exists? then GO came to the party and completely deprecated both java/dotnet, at least to me, i never looked back - native AOT compiled executable - 1 small file - ultra fast compile time - great ecosystem for all my backend needs, it's GO with dotnet everything feels heavy, ancient and bloated, msbuild and their xml for their projects, when you need to add some logic things becomes unreadable with XML logic, it's a mess, their json attempt wasn't great either, it was just JSON vs XML, they should have went with C#, build.cs, that's it then you have deployment, it's MUCH MUCH easier than with java and with their jar/classpath bullshit, but it still is a bloat, it's a DLL mess and let's not even talk about how everything is attached to microsoft even their WASM effort isn't called WASM, you can't target a WASM module, it's BLAZOR, with MONO (why mono still exist when you have dotnet core? i have no clue, it adds to the bloat sentiment), wether you like it or not, it's BLAZOR, wich sucks because i wan't to handle hosting my way, from the beginning they vendor lock you
- kaba0 5y agoGo is ridiculously verbose and it is funny when Go advocates call Java that. The “C with GC” is sort of true about it in terms of no abstraction power resulting in one having to write many times more code with real redundancy. Also, its performance for low-level situations is not-bad due to not having to use gc due to structs, but it has place to improve on more complex use-cases with lots of garbage generated.
- Shadonototro 5y agoverbosity is the least of my problems small single file publishing, native AOT executables, fast iteration time with quick build time, non existent cold start, simplicity of the whole stack something both Java/Scala/C# fail to provide for my low level needs i use C or D/Rust for everything else it's GO
- mmgutz 5y agoDoes anyone have experience using .NET for serverless? How do start up times compare to something like Go or Node?
- FridgeSeal 5y agoGo AoT compiles into machine code so it should have very little startup time, anecdotally I’d expect .net to be in between go and Node.