r-3ykw
Last Updated: February 25, 2016
·
1.084K
· xcambar

Protip to Dumbtip: avoid over-engineering

Today, I saw this JS code:

var that = (function () {
  return this;
}).call(this);

Although it is syntactically and programmatically correct, it reveals one common anti-pattern in many devs: over-engineering

Please, stop thinking too much when it is not absolutely necessary.

Think of your goal, then go straight to it.

2 Responses
Add your response

1093

If only they would have used a double-closure. That would have made it much better.

over 1 year ago ·
1236

@nrutman And then obfuscate it.

over 1 year ago ·