3 ms·
Async computation is not the fad, it's poor syntax is. C#, F# and coffeescript have excellent syntax that remove the line noise caused by writing async code. A
by fleitz 12y ago
Async computation is not the fad, it's poor syntax is.
C#, F# and coffeescript have excellent syntax that remove the line noise caused by writing async code. Actors and channels also nicely remove line noise from async programming.
If anything as computers become more powerful and distributed you'll see threads and locks disappear rather than async computation. Async computation in an imperative style is what most want, threads and locks are what we have.
- zhong-j-yu 12y agoThat is where I disagree completely. I think the old fashioned sync/blocking/threaded style is much easier than async. Of course, C# has great async support; but it is still a complicate thing that programmers must be very cautious about when applying.
- fleitz 12y agoI don't think you've seen truly great async support, it's virtually indistinguishable from sync code. Sync: let file = File.Open("foo.txt") let data = file.Read(8192) // Do some compute stuff with data ASync: let! file = File.OpenAsync("foo.txt") let! data = file.ReadAsync(8192) // Do some compute stuff with data
- zhong-j-yu 12y agowhile the syntax can be as simple as that, there is still a difference, and the programmer still needs to be very careful. what if you accidentally forget the `"!"`?
- fleitz 12y agoUmm... it doesn't compile because it's the wrong type... But yeah multithreading is easy.