4 ms·
They’re using TypeScript. Ts classes are horrible: you have to explicitly use “this.” to access anything in the class - it’s as good as it was possible to make
by jacobn 7y ago
They’re using TypeScript. Ts classes are horrible: you have to explicitly use “this.” to access anything in the class - it’s as good as it was possible to make it with the JS legacy, but it just doesn’t work very well.
Using namespaces with state passed to the relevant function ends up being basically just as easy, and sometimes easier as you end up using more closures and can access enclosed variables directly.
Classes in languages designed for OO work a lot better.