3 ms·
In C# that could be: return new Swimmer("foo") { Style = "butterfly"} .swim(); It is unidiomatic to have Swimmer.swim return 'this', though. var resu
by Someone 13y ago
In C# that could be:
return new Swimmer("foo")
{ Style = "butterfly"}
.swim();
It is unidiomatic to have Swimmer.swim return 'this', though.
var result = new Swimmer("foo")
{ Style = "butterfly"};
result.swim();
return result;
- moomin 13y agoThe thing being that C# has a feature for a whole bunch of idioms, but none of them are extensible and writing new ones requires a new version of the language. The Clojure reducers, doto, ->>, go macro could all have been implemented in 1.0. (And two of them were.) I speak as someone who codes in C# for work and Clojure as a hobby. There's lots of things that just aren't quite possible in C#, and _everything_ is possible in Clojure. Pointfree is beautiful to read and grok. It's a little trickier to debug, since pretty much every debugger on earth needs points to inspect values.