Live data from Hacker News

.NET Core 3.0 Concludes the .NET Framework API Porting Project

github.com

301–310 of 317 posts

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#301
post #244

Earlier quoted context omitted.

You can't return an anonymous type, but the syntactic difference between an anon type and a tuple is two characters: parens instead of curly braces.

And the little "new" in front of it. I actually preferred the curly braces version and would have loved for them improve it instead of creating a replacement. And well, I'd expect them to get it right eventually. It is at least their third evolution of that feature... there was a System.Tuple as well. Wonder if they ever come out and officially deprecate their earlier attempts.

I don't think C# have ever deprecated language features. You can still use the old "delegate{}" syntax even though we have the more concise arrow syntax.

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#302
post #7

Given that our deployment platform was Linux (for a .Net Core 3.0 project), I was determined to use Linux and VS Code for development. That was a fail; the verbose nature of C# and the Framework APIs make it impossible to be productive without significant help from a full-fledged IDE like Visual Studio. One might think the verbosity can be reduced by clever coding (and adopting a functional style), but that's not so…

> Given that our deployment platform was Linux (for a .Net Core 3.0 project), I was determined to use Linux and VS Code for development. That was a fail; the verbose nature of C# and the Framework APIs make it impossible to be productive without significant help from a full-fledged IDE like Visual Studio.

I have had and continue to have the opposite experience of you. I use Ubuntu with VS Code and a few C# plugins that have greatly allowed me to navigate the .NET Core framework and write code with minimal references.

Even, with Visual Studio (unless you use R#), you will always run into issues where you aren't sure where the function or class lives. That's why you go read the documentation or ask SO.

The more you write webapi's the easier it is.

> Structural Typing

Dynamic was the closest to it, but it has significant performance issues. Tuples and structs do exist also.

> Allow functions outside of classes

No.

> Verbosity in C#

????

> most popular libraries will nudge you strongly to use Dependency Injection throughout the app and implement everything as a class and to extract interfaces out of it.

You do realize C# is mostly a strong Object Oriented language hence why they (the libraries) urge you to do that.

If you want functional so much use F#.

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#303
post #244

Earlier quoted context omitted.

You can't return an anonymous type, but the syntactic difference between an anon type and a tuple is two characters: parens instead of curly braces.

And the little "new" in front of it. I actually preferred the curly braces version and would have loved for them improve it instead of creating a replacement. And well, I'd expect them to get it right eventually. It is at least their third evolution of that feature... there was a System.Tuple as well. Wonder if they ever come out and officially deprecate their earlier attempts.

> Wonder if they ever come out and officially deprecate their earlier attempts.

That (mostly) doesn't happen.

I would say that .NET Core was the sole attempt to deprecate a lot of the framework. And most of it came back anyway; see the title of the parent article.

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#304

Earlier quoted context omitted.

I keep coming back for a look every time there is a major release but it always seems quite cumbersome to me despite the fact I work in C# everyday. I ran through the Razor pages tutorial yesterday and I was surprised how heavy it all felt, I was expecting something like Flask or Sinatra. I'm a big fan of IDEs, I couldn't imagine using C# without one.

I've been quite happy using Nancy for the past several years. At the time we made the switch, it wasn't possible to use WebApi or MVC in a self-hosted OWIN web server, and our application had lifecycle constraints that made trying to run it out of IIS impractical. But I've come to really like the way Nancy has explicit API routes, compared to the implicit conventional style, or slapping attributes all over everything…

[deleted]

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#305

Earlier quoted context omitted.

F# is a nightmare you want to use asp.net core.

What do you base that on? I have had no problem with F# and asp.net core. Just look at safe stack, it uses saturn or giraffe which in turn runs on asp.net. https://safe-stack.github.io/

That this abstractions exists on top asp.net core to make things more ergonomic proves my point.

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#306

Earlier quoted context omitted.

I haven't seen the reluctance to use the runtime in interop scenarios. Is this just a personal interest or do you have a particular use case? I'm genuinely interested.

This debate is about Microsoft's decision some 14 years ago to build Windows userland components on top of C++ COM technology instead of .NET as some within Microsoft had wanted. Those inside Microsoft who didn't want to force everyone to use a rather heavyweight runtime including a tracing GC won the debate. It would have affected almost everyone, not just those with use cases that can tolerate the significant addit…

I see what you mean. Good point. Cheers.

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#308

Earlier quoted context omitted.

Thank god we won't. Functions outside classes never did make sense to me. People love to hate classes sometimes. For me, everything starts at classes and structs;

in C# you can make a static class, and then put functions in it. When you do this, the class is nothing more than a namespace. But the class is already in a namespace. So you now have a redundant namespace. It isn't a big deal but its a bit silly to have to do that, when writing static functions.

Yeah I agree. I really like static classes, but I've seen them being overused; As long as it doesn't causes performance problems I'm good with it. In fact calling static methods is faster;

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#309
post #181

Earlier quoted context omitted.

Don't get why people want floating functions. It makes easier to do bad coding and architecture imo. At least you must namespace them;

Consider something like the Math class. In practice it just works like a namespace for math-related functions. The only reason to have a class is because the language requires it. It would certainly be cleaner without having to define a useless class.

Well, a static Math class always did make perfect sense to me. Never bothered me. Even after I discovered languages that allow you to define functions everywhere, I still prefer static classes; As long as there's no performance penalties, I'm good. In fact, static classes method calls are really fast;

Re: .NET Core 3.0 Concludes the .NET Framework API Porting Project

#310
post #29

Earlier quoted context omitted.

> My wishlist for C# is short: [...] F# provides all of them, is shipped with .Net Core 3.0 and also works great on Linux.

F# is a nightmare you want to use asp.net core.

In a previous role some time back used F# on top of ASP.NET Core. It isn't that bad and people thought the code was quite clean in the end; we had dev's thinking going back to C# even with F# using vanilla ASP.NET would be a downgrade. There's ways to mitigate the pain of the C# specific API. We went the vanilla ASP.NET Core route (for Swashbuckle) and found only the Startup class (which could be replaced by functions in hindsight) and the Controllers (which were still clean code wise) needed to be classes. The rest (majority) of the program was typical F# code with an interfaced object usually created via an F# object expression put into ASP.NET's dependency injection. Helped to separate the web controllers from the logic layer anyway and keep the ASP.NET code to a minimal. Most of the program was written in F# style with ASP.NET used just as a web server for functions basically.

There's just few public examples on how to do this cleanly so people kinda have to work it out themselves which I think could be improved.

Post reply on HN