3 ms·
Union types are a gap, although records and switch expressions will get you much closer than was previously possible. Object literals are a thing, they’re call
by IneffablePigeon 4y ago
Union types are a gap, although records and switch expressions will get you much closer than was previously possible.
Object literals are a thing, they’re called anonymous types. You just new them up. And functions can be passed around as first class objects, with some minor type boilerplate in a few places.
There are a few places where you have to adjust to different naming conventions and types are obviously stricter but my experience is that for the most part modern c# has all the things I like about TS/JS.
- runevault 4y agoIt is worth mentioning the c# team is taking a serious look at Union types finally. Considering the runtime already has a version in f# I'm curious how it goes on the c# side of the house (I know semantics are different between the two languages so can't necessarily be 1:1)