Live data from Hacker News

C# 9 top-level programs and target-typed expressions

developers.redhat.com

61–70 of 188 posts

Re: C# 9 top-level programs and target-typed expressions

#61
post #6

Earlier quoted context omitted.

if you have built anything on web forms, then you really have no way forward other than rewriting all that. That alone will keep many an enterprise locked on .NET Framework for quite some time.

In our case not web forms but WCF

There is a tool out there that converts WCF to gRPC.

https://visualrecode.com/

The guy who wrote it talking about it: https://www.dotnetrocks.com/?show=1728

Re: C# 9 top-level programs and target-typed expressions

#62
post #6

Earlier quoted context omitted.

Allegedly there's an upgrade path from .NET 4.8 to .NET 5.

if you have built anything on web forms, then you really have no way forward other than rewriting all that. That alone will keep many an enterprise locked on .NET Framework for quite some time.

You can give it a shot with this project. https://github.com/FritzAndFriends/BlazorWebFormsComponents

It emulates WebForms component with Blazor. Although I would just start from scratch.

Re: C# 9 top-level programs and target-typed expressions

#63

I have been programming with c# since 2000 i think. But I do not like where the languages is going. It is becoming way to loose in a sense and it seems that it wants more than it should. If you want to do functional programming, pick a fp language. If you want to do dynamic typed programming pick a dp language. Sure you can mix some things in, but c# is becoming way to scattered imo. And it's not pretty i think.

If you have the time, I would be curious what your thoughts are on this talk by Bill Wagner. Gives a lot of insight into where C# is headed: https://www.youtube.com/watch?v=aUbXGs7YTGo

Re: C# 9 top-level programs and target-typed expressions

#64
post #14

Earlier quoted context omitted.

The upgrade path is massive rewrites, something most business are wary of. For good reasons. MS really made a grave mistake by coupling the evolution of the C# language to the .NET version. This means all projects on the .NET framework is now also stuck with an obsolete language version for no good reason. It is becoming a a lot less fun to be a C# developer because you more often will have to work with obsolete tool…

> MS really made a grave mistake by coupling the evolution of the C# language to the .NET version. For the most part that isn't true. You can use later C# compilers with older frameworks. Some features do, unavoidably, require framework support. But that being said, the changes in C# aren't often that radical that I feel particularly constrained by older versions.

You can (and I do), but it is explicitly not supported. If it breaks, you get to keep both halves.

Re: C# 9 top-level programs and target-typed expressions

#66

I think that C# is underrated. Although TypeScript is my default language choice for most programming, C# / .NET is my choice for cases where: - high performance is important - or interop with native libraries is required (because C#'s DllImport attribute makes that super simple) Another benefit is that C# is syntactically similar to TypeScript (they were both designed by Anders Hejlsberg after all), so switching bet…

C# is perfectly rated, I assure you. Not under-rated at all.

Re: C# 9 top-level programs and target-typed expressions

#67

I have been programming with c# since 2000 i think. But I do not like where the languages is going. It is becoming way to loose in a sense and it seems that it wants more than it should. If you want to do functional programming, pick a fp language. If you want to do dynamic typed programming pick a dp language. Sure you can mix some things in, but c# is becoming way to scattered imo. And it's not pretty i think.

When LINQ first came out, I personally remember creating some long rants at the bar with my drinking buddies that we didn't need no stinking FP in our OOP.

I now find myself writing half my data processing in LINQ and find myself thankful that I can chain together a few methods on a collection with possible transformation in a line or two rather than having to write 2 or 3 nested loops with all sorts of conditionals.

I'm taking the new things that come up in C# as they come, and even the ones I don't care for, I generally end up using to some extent.

Go with the flow, or pick another language, would be my suggestion.

Re: C# 9 top-level programs and target-typed expressions

#68

I think that C# is underrated. Although TypeScript is my default language choice for most programming, C# / .NET is my choice for cases where: - high performance is important - or interop with native libraries is required (because C#'s DllImport attribute makes that super simple) Another benefit is that C# is syntactically similar to TypeScript (they were both designed by Anders Hejlsberg after all), so switching bet…

C# is my goto for Windows, for sure. Is the native interop good in Linux as well? I've never even considered anything like that, would probably gravitate to C++ since that's what I'm familiar with but would seriously consider Go or Java in non-Windows situations.

Also want to add with Jetbrains Rider, you can get a consistent IDE experience across multiple platforms as well. As much as I like vscode, Rider is just fantastic.

Re: C# 9 top-level programs and target-typed expressions

#69

I think that C# is underrated. Although TypeScript is my default language choice for most programming, C# / .NET is my choice for cases where: - high performance is important - or interop with native libraries is required (because C#'s DllImport attribute makes that super simple) Another benefit is that C# is syntactically similar to TypeScript (they were both designed by Anders Hejlsberg after all), so switching bet…

What's your go to boiler plate for a new TypeScript project?

Re: C# 9 top-level programs and target-typed expressions

#70

Earlier quoted context omitted.

It is super easy with dotnet core. The new CLI is pretty simple, you use it as a package manager and compiler. Visual Studio also uses the CLI to run and debug dotnet core projects. https://docs.microsoft.com/en-us/dotnet/core/tools/

Is it possible to create a single, stand-alone, self-contained .exe? (I'm fine with only building for a single platform - Mac/Win/Linux) Needing to run my programs (which show up as .dll's) using dotnet just feels weird (and it doesn't match my intuition for 'how programs are run' in Windows cmd/etc). I'd be fine with an .exe that's not self contained but at least I run it like a 'normal' exe. :)

Yes, you can use ILMerge to merge all other DLLS into the main exe/dll: https://stackoverflow.com/questions/8077570/how-to-merge-mul...
Post reply on HN