You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to request to undeprecate all util.is* functions currently marked for deprecation, and keep them intact in all future versions of Node.js.
Reasons:
util.is* functions (util.isObject, util.isNumber, util.isRegExp) are immensely useful and used throughout the codebase of pretty much every node.js app.
They are succinct and help to avoid unnecessary cognitive load, while the suggested alternatives are verbose and difficult to remember, and write correctly every single time.
Take for example util.isObject and compare the function isObject:
if (isObject(functionThatReturnsObject(param1, param2)) { ... }
vs what the documentation suggests I'd have to write instead:
Uh oh!
There was an error while loading. Please reload this page.
I'd like to request to undeprecate all util.is* functions currently marked for deprecation, and keep them intact in all future versions of Node.js.
Reasons:
util.is* functions (util.isObject, util.isNumber, util.isRegExp) are immensely useful and used throughout the codebase of pretty much every node.js app.
They are succinct and help to avoid unnecessary cognitive load, while the suggested alternatives are verbose and difficult to remember, and write correctly every single time.
Take for example util.isObject and compare the function isObject:
vs what the documentation suggests I'd have to write instead:
Do you really think that the second fragment is more obvious to any software engineer out there?
The alternative implementation, e.g. lodash, is less efficient since it has to handle many corner cases not applicable to node.js. And lodash detects node.js and uses util.is* functions underneath for efficiency, e.g. https://github.com/lodash/lodash/blob/ddfd9b11a0126db2302cb70ec9973b66baec0975/lodash.js#L452
They have great typescript annotations already written and maintained.
The text was updated successfully, but these errors were encountered: