4 ms·
For one, you're criticizing a web API here and not the C# language-- and you've failed to even do that convincingly since it's an intentionally verbose example
by pantaloons 13y ago
For one, you're criticizing a web API here and not the C# language-- and you've failed to even do that convincingly since it's an intentionally verbose example using an outdated API.
res.Text = (await new HtppClient().GetStringAsync(url.Text)).Length.ToString();
(Disclaimer: I work at MS.)
- ilaksh 13y agoWell, that's not bad, but I think the CoffeeScript is better $.get $('#url').val(), (res) -> $('#res').val res.length Or using LiveScript backcalls is even cooler: data <-! $.get '/x.html' $ \.res .val data Or in IcedCoffeeScript if you like 'await' await $.get 'documentation/css/docs.css', defer res console.log res Or check out the huge list of languages that compile to JavaScript at http://altjs.org/ http://altjs.org/