Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I fail to see what Rust wins in the given example, when the C# code is written properly:

    var dict = new Dictionary<string, string> { ["foo"] = "bar" };
    Console.WriteLine($"Value: {dict.GetValueOrDefault("baz", " <none>.")}");
Better look for another example.


I'm with you on this one. The Rust and C# API's are more or less equivalent. That does still repudiate the grandparent's assertion that it's easier the use C#'s dictionary.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: