HNHacker News
TopNewBestAskShowJobs

dcherman

178 karma · joined October 4, 2013

submissionscomments
dcherman··on Sergey Brin and Sundar Pichai Deliver Stirring Speeches During Employee Walk Out
I'm confused why employees are walking out and protesting at their place of work that had nothing to do with the travel ban and which actually opposes it.

Wouldn't this have been better done with a trip to LAX or another international airport to protest, or at least an office that has some relation to the government?

dcherman··on New Wyoming bill forbids utilities from using renewables
While I don't know for sure, it feels like it can be inferred from `As a large state with a small population and lots of coal` to be job protection and corporate lobbying.
dcherman··on America’s Fastest-Growing Loan Category Has Eerie Echoes of Subprime Crisis
Depends on your definition of investment and what you're looking to get out of it. If they maintain value by appreciating at least at the rate of inflation, then they're a great store of value. At that point, you need to take all expenses into consideration (including any applicable tax deductions and rental incomes from rooms) in order to determine whether you're net positive or net negative versus renting. This can't be generalized since it depends on your local housing/rental market, however I can speak for my own situation where I pay about the same for my home as I would for a rental where I'd live by myself. If I was to rent out my extra room, I'd be paying significantly less.

That's a bit long winded, just don't want people automatically rule out home ownership since not only can it be a point of pride, it actually can be financially beneficial if you're willing to do the math for your own situation.

dcherman··on Universal Basic Income already exists for the 1%
That's what the Estate Tax is for. There are ways to circumvent that via things like charitable foundations, however that's a very different debate.

The author is confusing income from dividends (either of the stock or bond variety) and interest income with income simply for existing. He chooses to use Alaska, an oil rich and low population state, as a model for the rest of the country. He states that the government would somehow build up a "big wealth fund" that would deliver "returns" without specifying where those returns would come from or the amount of those returns. A fund of the size required can't easily generate large returns since that amount of money is enough to distort markets.

Simple back of the napkin math is that based on the 2013 census, we have 242,470,820 adults living in the US. If we pay each of them $12,000 per year, that's $2,909,649,840,000 in additional mandatory spending every single year. That's more than Medicare and Social security combined, and that has no cost of living adjustments built in. The basic math shows that this idea is simply unrealistic as far as I can tell.

dcherman··on Bill seeks to put porn block on computers sold in SC
Probably that if it passes, people will buy computers across state lines and transport them back. A bounty for NC electronics stores.
dcherman··on Ok, let me explain: it’s going to be Angular 4.0
I think his point was that you're not being forced to upgrade if your current version is working for you. You don't have to be on the bleeding edge if that isn't working out for your business.
dcherman··on Interview with the author of React-like Inferno about JavaScript optimisations
I do, but it's also easy to sound smart when you're standing on the shoulders of very smart people. @jdalton and @petkaantonov are two that I've regularly followed and read their code for learning purposes. IRHydra by @mraleph is a great tool for learning about V8 internals and examining what's going on under the hood. Bluebird is an amazing example to follow if you really want to optimize, however the vast majority of libraries and apps don't need to concern themselves with some of the crazier optimizations that are performed there.

The biggest takeaways that I've had are mainly that if you really want to optimize, then write the kind of code that the various engines can optimize best. With that in mind, TypeScript is not only a great language, it's actually a great performance tool since it can help you to identify polymorphic functions that maybe could be changed to monomorphic ones if they're in the hot path.

I've got another fun hacky kind of optimization for you though that I've mainly used for benefit in some angular code/expressions that are executed potentially millions of times. If you can make some assumptions about the name of the property being accessed for security reasons and it's going to be repeatedly used, compare the following:

// Setup

const makeGetter = (prop) => new Function("obj", "return obj." + prop");

const slowGetter = (obj, prop) => obj[prop];

const fastGetter = makeGetter("foo");

const obj = { foo: "bar" };

// Test

slowGetter(obj, 'foo');

fastGetter(obj);

This is primarily an optimization for Internet Explorer, but if I recall it was somewhat positive in other browsers at the time as well. It makes more sense if you consider it in the context of executing a simple angular expression repeatedly, though 1.6.0 might narrow that gap significantly now that the expressions sandbox was removed as I think they generate code similar to my "makeGetter" factory. Haven't re-tested yet.

dcherman··on Interview with the author of React-like Inferno about JavaScript optimisations
So I watched that and heard that you used BenchmarkJS which I believe intentionally prevents optimization from occurring, otherwise many tests would just end up being optimized away. Have you considered how function inlining might affect your results versus benchmarks like you ran in the video? Have you profiled them side by side under actual usage?

"Anonymous" function calls (function expressions, either immediate or not) are generally only more expensive because they're re-created all the time. Sometimes this is necessary to create a closure, often it's not. If you were to profile `var foo = function() {}`, performance should match the function declaration variant identically, so it's not the method of declaration that affects performance.

dcherman··on Is Sugar Killing Us?
Can confirm that. The very first time I attempted a keto like diet (was actually a PSMF if I recall correctly), I felt so shitty and lightheaded in the first couple days that I bailed and tore into a small pack of cookies.

It gets a lot easier though. After going in and out of keto a couple more times, it completely stops being an issue.

dcherman··on Why I’m thankful for JavaScript fatigue
The module standard that is present in ES6 is a very different beast than CommonJS
dcherman··on American Elections Will Be Hacked
I'm not a security expert either, but my very first thought was that if we've successfully maintained a public ledger of financial transactions ( blockchain via bitcoin ), then that technology seems useful for large scale voting which is nothing more than another series of transactions.

Maybe someone more educated about blockchain could illustrate some of the pros/cons about using it in this manner?

dcherman··on Async/await support in Firefox
That's not true at all, and I expect them to become increasingly important over time. Now that we have the DOM being abstracted away into the virtual DOM in React, Angular 2, Vue, etc., it should be almost entirely possible to run your framework code entirely in a WebWorker while sending back some type of delta/patch to update the actual DOM.

I'm not sure what you mean that web sockets aren't supported since the MDN shows it as being fully available:

https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...

Where this falls down is in handling events where some actions inherently need to be synchronous (preventDefault, stopPropagation), however I think Angular 2 was starting to consider options on how to overcome that. I can't speak for progress in other frameworks.

dcherman··on You Don't Need JQuery Ajax Requests
It's possible to a degree, but only for pages on the same top level domain, and only if you're willing to relax a bit of security by setting `document.domain`.

I wrote an ajaxTransport for jQuery to accomplish this exact thing years ago; I can ask about open sourcing it if there's interest since I doubt it's in use anymore since our browser set is IE10+ at this point.

dcherman··on Not OK, Google
If that second scenario were to happen, then I think we should take a serious look at why that correlation is occurring rather than just throwing out the data because it's "racist". That we removed the classification and then it was re-discovered by other correlations really should suggest something. On the assumption that it wasn't engineered to be biased and was naturally arrived at by the algorithm itself, then that actually seems like an important data point, and could even be a nice litmus test of how we're addressing racial differences if the models evolve to be more positive over time.
dcherman··on How Twitter deploys its widgets JavaScript
Sure, but that's easily solvable by versioning assets in the filename itself. That's how the `filerev` task works for both Grunt and Gulp.
dcherman··on How Twitter deploys its widgets JavaScript
It's not a hack at all for resources you control - in fact, it's encouraged to do so in order to use very long lived Expires headers while still being able to deploy new versions of your app.

It doesn't work for unversioned library code though where you want to automatically upgrade all users of your code as is the case with Twitter it looks like.

dcherman··on What 2,000 Calories Looks Like (2014)
If you don't want to cook in bulk, a pressure cooker is very easy as well. It takes about 15-20 minutes to build the pressure and cook the chicken, but my own time investment is somewhere around 30-45 seconds.

The chicken does come out moist and tastes awesome, but that goes for the outside as well which I don't mind that much, but you can also toss it on the grill for like 20-30s a side after it's done if you want nice grill marks and a little crispier outside.

dcherman··on Ask HN: Is web programming a series of hacks on hacks?
Similar situation here, but it depends on your level of experience as well. Can you structure an AngularJS app so that it's (relatively) sane? Absolutely. It's also very easy to make a mess of things so that it's hard to reason about control flow; frameworks that are doing a better job of embracing unidirectional dataflow definitely help with this, but I don't blame Angular as it predates the wide adoption of that as a practice.

It's also more difficult to follow practices like quickly rendering above the fold content; when you use the normal practice of writing re-usable directives, you end up needing to wait until at least Angular and any dependencies are loaded prior to being able to render any content at all. Server side rendering of initial content helps to alleviate that quite a bit since even though the content may not be interactive until your app bootstraps, the perceived load time is much better as the user has something to look at.

dcherman··on Randy Pausch Last Lecture: Achieving Your Childhood Dreams (2007)
Absolutely! I don't want to spoil it for others that may not have seen or read it yet, but you know the ending and why he wrote it.

While he may not fully understand everything (the lessons, not the words), this is the kind of book that I still go back and read every couple of years and still try to pick up something new each time. I'm sure he can pick up things that are relevant to him today and still find new lessons for years to come.

dcherman··on Randy Pausch Last Lecture: Achieving Your Childhood Dreams (2007)
Still one of my favorite lectures I've watched online of all time. Highly recommend the book as well for those that haven't read it.
dcherman··on Stepping Backwards from AngularJS to JQuery – An Experiment
Even still, that's just the completely wrong technology to use for something like this regardless of scale. It sounds like it's literally static content. Just write an HTML file directly if it's a single page, or use something like `Assemble` to get easily re-usable partial support if you have multiple pages that want to share a header and footer or something.
dcherman··on Gene Wilder Has Died
What did you expect? "Welcome, sonny?" "Make yourself at home?" "Marry my daughter?" You've got to remember that these are just simple farmers. These are people of the land. The common clay of the new West. You know... morons.

He'll always be the Waco Kid to me.

dcherman··on AngularJS in the Wild: A Survey with 460 Developers
You can embrace unidirectional flow in Angular 1.X as well even if it's not enforced by the framework. I'd actually recommend it as it makes things so much easier to reason about, but I'll admit that it can be quite verbose, especially without the syntactic sugar that Angular2 provides.
dcherman··on Can Capitalism Be Redeemed?
What does that mean? Bernie is a socialist, not a capitalist. How would a Sanders campaign have redeemed US capitalism?
dcherman··on Is Faster-Than-Light Travel or Communication Possible? (1997)
What I've always found interesting (not sure if there's a name for this) is kind of the idea that if you made such a trip, you might find by the time you arrive there in 3.2 seconds, the rest of humanity has figured out true FTL travel with the technology that was developed during those 32,000 years. As a result, you arrive in what might be the equivalent of a horse and buggy at the center of the galaxy versus what everyone else is riding around in.
dcherman··on JavaScript Cancelable Promises Proposal
The request is already in flight, it's too late - you can't abort those packets from getting to your server, you can only send new ones (which maybe instruct the server to disregard your search or something).

The correct way to accomplish what you want is to either throttle or debounce your searching such that you reduce the amount of requests made in the first place.

dcherman··on CSS coding techniques
I'd rather see !important instead of this. This rule would call for quite a lengthy comment explaining just what in the hell the repeated .flat rules are for, and what other rules it's attempting to pave over such that you know when you need to add a 5th .flat as a "fix'.
dcherman··on JavaScript async/await implemented in V8
Yep. In those cases, I still prefer let personally even though I know the variable itself will not be re-assigned, kind of as an indicator that I expect the referenced object to be mutated.
dcherman··on Data Structures in JavaScript
Depending on the implementation, yup. Since both of the most popular Immutable libraries that I know of (Immutable.js, mori) have their own API for setting properties via a `.set` method, it would not be unreasonable for them to use `Object.freeze` in order to make raw mutations throw an error.

Both libraries provide their own implementation of a Set though, so in practice you would just use the library provided one.

dcherman··on Why Don't People Manage Debt Better?
The ratio of available to utilized credit definitely does impact your credit score positively. That's why for a while, I would periodically ask for limit increases 1-2 times per year on all of my cards even though I will never come close to the limits. You don't want to do this too often though; I think asking for an increase may incur a credit pull. Too many of those can hurt your score.
← PreviousPage 2 of 4Next →