4 ms·
Also, from C# dev to C# dev, you definitely should check out TypeScript. Checks like this: if (parent !== null && !(parent instanceof Entity)) { throw new
by Gehinnn 7y ago
Also, from C# dev to C# dev, you definitely should check out TypeScript.
Checks like this:
if (parent !== null && !(parent instanceof Entity))
{
throw new TypeError('parent must be an Entity instance or null');
}
will be as short as
constructor(parent: Entity | null, ...)
... and entirely checked during compile/design time.
- mhammerc 7y agoThank you for your help! It actually run only on Node (but could be adapted on browser). Yes an online demo is a good idea! I did used prettier and Xo in the past. I know I'm in the wrong but my eye are so much adapted to that C/C# style that it is way easier for me to read. For a next update/my next open-source projects, I'll think twice about it. I have no doubt Typescript is great. I've tried use it in previous very complex projects pushing JS to limits. It had a few quircks that made it unable to use, same thing for Flow. But same thing here, I'll think about it twice next time! Thanks!
- Gehinnn 7y agoFeel free to ping me on twitter (@hediet_dev) if you got stuck with typescript on your next project!