Programming does not have to be hard. You get data, you pass it to functions, you return new data. You read I/O, you write I/O. That covers everything that we actually need to do.
In short, the following are complete trash:
- Object.defineProperty, Object.getPropertyDescriptor, etc.
- Getters and setters
- Classes and Prototypes
- Weak Map and Weak Set
You will run out of feet before you run out of bullets using these.
The methods on Object that are okay: assign, keys, values, and entries. Everything else is stupidly complicated and unnecessary.
Getters and setters
Classes and Prototypes
Coupling data and methods together is not a good idea.
All we wanted was a for..of loop for looping through array values. We got an API that suffers from the same problems that getters do: unpredictable complexity, poorly conveyed semantics, and even more in this crazy language to learn.
Luckily these are not popular anymore because of async/await. Generators only served to be iterator factories and make asynchronous operations look synchronous.
Weak Map and Weak Set
Storing temporary data about data not along side that original data? What could go wrong.
Tagging data in ways that only one god system can interpret? What could go wrong.
Fuck the whole language? What could go wrong.