I voluntarily used "class" in JavaScript today. Feeling kinda bad about it. AMA
I prefer to keep my javascript as functional as possible. Some state is unavoidable but I use plain JS objects. Linters are generally not great at dealing with "this". Typescript makes this better. In this case, "class" was the best option.
-
-
The rule I apply is if I'm dealing with some persistent store, I use a class to interface with it (or in some cases I will use classes for light setter/getter functionality on xml documents). Otherwise, i keep it functional. Typescript is definitely key for me.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.