4 ms·
They didn’t mention new Error().stack That is a de facto standard for creating a call stack anywhere without interruption. There were several things on t
by austincheney 5y ago
They didn’t mention
new Error().stack
That is a de facto standard for creating a call stack anywhere without interruption.
There were several things on that list you never need. 14-18 is for OOP which is fully optional in the language.
- dstick 5y agoSounds helpful. Any link you recommend to those unfamiliar with it that outlines the concept with helpful examples?
- austincheney 5y agoHere it is on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... Despite the warning at the top of the article the convention is widely available cross browser and in terminal runtimes like Node.
- Normal_gaussian 5y agoWith respect to the warning, MDN has a compatibility table at the bottom which shows full support on all tracked systems since very early version numbers.
- schwartzworld 5y agoOOP is optional, but so are all other paradigms. You get the cleanest code when you have the most tools for describing what you want to do to the computer. Most JS devs just use arrays for everything.
- tomxor 5y ago> OOP is optional I wish this was more widely understood (that's it's merely a pattern, not an inevitability), so much OOP code is just bags of arbitrary stuff. It's not an inherently bad pattern, just often misused.
- bluefirebrand 5y agoBoilerplate on boilerplate on boilerplate. Can you guess what my biggest problem with OOP is?
- austincheney 5y agoCode decoration?
- winrid 5y agoconsole.trace() is also a nice declarative shortcut (may not be compatible with your logging setup, but convenient locally)