Skip to content

Commit

Permalink
Update ranting
Browse files Browse the repository at this point in the history
  • Loading branch information
timoxley committed Apr 29, 2015
1 parent 1ec4685 commit 200a079
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ console.log(bigPersonB.name) // => 'CREATED WITHOUT NEW'

## Why

The "can't call without new" restriction on ES6 classes create a needless incompatibility between tools which accept classes and tools which accept regular functions – there is no built-in means for a tool to determine whether a passed function would like to be called with new or without new, it just has to pick one and hope for the best.
The "can't call without new" restriction on ES6 classes create a needless split between tools which accept classes and tools which accept regular functions – as there is no built-in means for a tool to determine whether the function they've been passed would like to be called with `new` or without `new`, it just has to pick one and hope for the best, I guess.

While it's true that some real-world functions insist on being constructors in much the same way, at least it is possible to patch the library and/or submit a pull request explaining that requiring new is uneccessarily rigid and provides little benefit when it's entirely possible to transparently handle both cases. With ES6 classes we have no option to just patch the library as this rigidity is baked right into the implementation.
While it's true that some real-world functions will insist on being constructors in much the same way, it's not command and at least it is possible to patch such code and/or submit a pull request explaining that insisting on `new` is uneccessarily rigid and provides little benefit when it's entirely possible to transparently handle both cases. With ES6 classes we're left with fewer options as this rigidity is baked right into the implementation.

## See Also

Expand Down

0 comments on commit 200a079

Please sign in to comment.