top | item 43547546

(no title)

smoothdeveloper | 11 months ago

In C#, you can't use the await keyword in a non async method, so I find the argument short sighted.

discuss

order

shortrounddev2|11 months ago

I don't see how that changes things. You'd have to async it all the way to the top but the syntax is still cleaner than F#. If you're using an Asp.Net controller you just declare the handler as async Task<IActionResult> and it's fine. Even program main methods can be async these days

malakai521|11 months ago

The syntax is exactly the same. You have `var x = await` in C# and `let! x =` in F#

The controller handler is also the same. It will be marked with `async` keyword in C# and `task` CE in F#

jayd16|11 months ago

If your code base is already using async await it's really not an issue.

int_19h|11 months ago

The point is that it's not actually different from C#, especially once you consider that F# also has task{} blocks that give you a .NET Task directly.