Last Updated: February 25, 2016
·
1.424K
· 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

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

over 1 year ago ·

@nrutman And then obfuscate it.

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside