Live data from Hacker News

Show HN: A Tiny But Powerful Entity-Component-System on Node

github.com

1–5 of 5 posts

Re: Show HN: A Tiny But Powerful Entity-Component-System on Node

#3
post #2

It would be awesome if you could provide an online demo! Also, you should check out the JS formatting guide (I can recommend you prettier). Your code looks like being written by an C# developer :D

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.

Re: Show HN: A Tiny But Powerful Entity-Component-System on Node

#4
post #3
post #2

It would be awesome if you could provide an online demo! Also, you should check out the JS formatting guide (I can recommend you prettier). Your code looks like being written by an C# developer :D

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.

Thank 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!

Re: Show HN: A Tiny But Powerful Entity-Component-System on Node

#5
post #4
post #3

Earlier quoted context omitted.

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.

Thank 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 ve…

Feel free to ping me on twitter (@hediet_dev) if you got stuck with typescript on your next project!