DEV Community

Discussion on: Why reflect-metadata suc*s

Collapse
 
svehla profile image
Jakub Švehla

You're right in one thing... C# & Java sucks as well

I think that you absolutely miss understand the whole point of this article... i can't imagine to write out more code without typescript and I think that TS type system is the best type system ever because you can infer almonost all types from your pure javascript code and keep 100% type safeness. Imho there is only one similar good type system and its from F# compiler. i do not blame TS, i love it... but my code looks like JS and works like TS <3 its 2 in 1, win win situation

BTW reflect-metadata is not as powerfull as the type inferring system for more complicated data types like structures etc...
its reason why you have to define pointer into Photo two times in this example:

  @OneToOne(type => Photo)
  @JoinColumn()
  // here you duplicate the pointer into Photo just to have proper static types
  photo: Photo;
Enter fullscreen mode Exit fullscreen mode