Settings

Theme

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

github.com

3 points by mhammerc 6 years ago · 4 comments

Reader

Gehinnn 6 years ago

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

  • Gehinnn 6 years 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.

    • mhammercOP 6 years ago

      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!

      • Gehinnn 6 years ago

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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection