$ ./guess_the_languageProgramming Languages
Programming Languages · hard · #579

Which programming language is this?

public record Order(int Id, decimal Total);

var first = new Order(1, 9.99m);
var copy = first with { Total = 19.99m };
Console.WriteLine(copy.Total);

Answer: C#

It looks like a Java record, but the non-destructive with { ... } expression and the m decimal literal suffix exist only in C#.
Play Programming Languages ▸