You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'm not trying to have a go, although I guess what I wrote came out as a bit combative.

    It's more frustration at the TypeScript compiler, which even if it's not optimising at all could have had a better standard library. It's a pet hate of mine that there are teams of people trying to make JS engines like V8 super fast, but then seemingly the rest of the world's out there finding ingenious ways to make JS code as large, incomprehensible and slow as possible.

    Smaller code without unneeded abstractions can be easy to maintain and extend too.


    Most of the apps in the current app library are not extendable or maintainable.

    I'd argue that many of the apps in the app library actually have been extended and maintained by others, precisely because they are small and are written in the language that Bangle.js runs natively (and so can be debugged easily).

  • It's more frustration at the TypeScript compiler
    Typescript is a game charger for large scale javascript applications. Having type safe code saves so much time on testing and debugging. This is why its built in as standard now to the default react and angular boilerplates. Its also why python is introducing typing.

    ingenious ways to make JS code as large, incomprehensible and slow as

    Its not built for people to read the compiled code. In my setup its not just typescript. Webpack is doing the module splitting, minification etc. I also doubt I have it set up optimally.

    So while you might be frustrated with Typescript, JavaScript isn't compatible on its own with making large scale stable applications. This is not just my opinion but an opinion held by the majority of leading tech companies using JavaScript.

    ..and just on why abstractions such as "isEmpty" are needed/good practice. If you have a large application with many developers working on it. What does it mean for an array to be empty? If its a preset length and each value is undefined is it empty? Or is it an array of undefined values. It doesn't matter which is true as long as its consistent across your app. The only way to do this is to create a single function everyone calls. This has other advantages. You can have unit test coverage so that if someone finds a faster way to determine if an array is empty that function can be rewritten and the unit tests remove any worry or time taken to test the new version. The person using isEmpty doesn't have to see the code or care how the code works, or what it means to be empty.


Avatar for Gordon @Gordon started