by einrealist · 10y ago · 0 comments
One thing though: the engineers started to write classes for everything. I had to catch that and forced them to stay as functional as possible. Does that happen to other teams, too?
And I really like to see WebAssembly to become part of our browsers and Typescript generating it instantly.
For example, if you have a lot of paginated lists you can write an abstract class that handles all the "get the results", "put them on a list", "display pagination", "on click display the next/previous page" trivia and then inherit from that to add the UI/presentation and any specific logic. It's absolutely possible in plain javascript but I shudder at the thought of writing something like that and even worse, refactor it. Typescript with OO and generics simplifies the task considerably.
As in everything in life: "dogma is bad", "παν μέτρον άριστον", "use the best tool for the job" etc. Words to live by.
For cross cutting concerns like pagination, we already have functions that enhance the pagination controls.
That said, Typescript is most likely to support WebAssembly when WebAssembly offers a GC implementation for it to use (the WebAssembly GC is planned in the medium to long term IIRC).