3 ms·
I have looked at Flow. I have to admit, I am biased toward good-looking code. Unless you use something like LightScript[0], Flow's syntax is not as clean or str
by ralmidani 9y ago
I have looked at Flow. I have to admit, I am biased toward good-looking code. Unless you use something like LightScript[0], Flow's syntax is not as clean or straightforward as that of TS.
Edit: I just took another look. I thought parameters had to be annotated via block comments (that's how you have to do it if using CoffeeScript 2). I was wrong.
[0] http://www.lightscript.org/ http://www.lightscript.org/
- ggregoire 9y agoThe following example written in TS works in Flow too: type MyComponentProps = { prop1: string; prop2?: number; } type MyComponentState = { foo: number; bar: string; baz: number; } class MyComponent extends Component<MyComponentProps, MyComponentState> { Same syntax. Also, not sure how this could be more straightforward.
- ralmidani 9y agoThank you. I edited my comment after looking at the Flow website. My incorrect understanding came from seeing the atrocious "block comment Flow annotations" in CoffeeScript 2 (an otherwise adorable language) and thinking that was how you had to specify parameter types with Flow.