HN user

ehynds

56 karma
Posts0
Comments24
View on HN
No posts found.

Here in the northeast, electricity is expensive because we rely heavily on natural gas for power but lack sufficient pipeline capacity to bring in cheaper supply, all while nuclear plants are being retired, politicians have blocked new pipelines from Canada, and the Jones act makes it costly to transport fuel by sea.

I'm sure AI isn't helping but we have plenty of problems already

About $300/mo on an app that provides real-time train tracking for Boston's commuter rail. Thankfully for me the MBTA is a mess, so each system meltdown (which happens about once a week) causes a spike in downloads.

OP is saying that `let func = () => {};` creates a named function where func.name equals "func" and "func" appears as part of the stack trace.

Your example is still an anonymous function just bound to a different context.

Still though, in situations where I care about the stack trace, I don't see myself writing:

  let doStuffCallback = () => {};
  doStuff(doStuffCallback);
over:
  doStuff(function doStuffCallback() {
  });

That seems to do it.

  let func = () => {};
  console.log(func.name); // func
and in stack traces:
  let func = () => foo();
  func()
results in:
  Uncaught ReferenceError: foo is not defined
  func @ test.js:1

You pointed out a few best-practices, but it's a shame that this article is written in the context of jQuery, rather than recognizing that these "taxes" are true with every script tag you place on your website.

The same is true whether or not you use a document.ready statement; you're thinking of window.onready, which fires once all images have been downloaded.

If all your scripts are before the closing </body>, the DOM will be ready by the time they execute, and you can safely ditch your legacy ready wrappers.

Vim: revisited 15 years ago

And then your arrow keys are free to bind to something else useful, like moving between split windows, buffers, etc.

A lot of Stop & Shops here in the Boston area have that too. Someone will randomly audit your shopping cart once every 10 trips so or to prevent theft, which is a hugh time-consuming PITA. Personally, the novelty wore off after the first use.

[dead] 15 years ago

That's why you cache methods to reduce lookups.

http://jsperf.com/global-namespace-chain-vs-string-based-loc...

In your tests the method "add" is pretty far away from it's original variable, and MUCH further away than any jQuery method is, so you're also testing the time it takes to lookup that method. In jQuery, methods are either attached to "jQuery" directly or on the prototype.